:: DOWNLOAD
:: ABOUT
:: LICENSING
:: DONATE
CRNRSTN v2.0.0 :: DOCUMENTATION
    Search
    setClientMobile() ::
    Due to the fact that the CRNRSTN Suite :: was engineered to sit so "low level" in the grand scheme of an application...sitting directly on top of the running $_SERVER environment and hooking into it at run time, it is necessary to provide functionality that will support the manual/brute force "straight lining" or persisting of the client's mobile device identity for the duration of their session (or until resetDeviceDetect() is appropriately called). Otherwise...for example, a mobile device or tablet user (maybe coming to the site from a link in an email) who clicks a link within the LAMP application to view the "desktop version" will still be met with whatever mobile device experience has been prepared in the application...with no way to change their stars. SO SAD! Enter stage left, setClientMobile(). This method forcefully pushes mobile device indicators to the CRNRSTN managed session of said user, so that...regardless of their device or activity within the application...the user may receive the experience that they desire without any cursing and frustration. Hooray!!
    Technical specifications ::
    • Currently tested on an Ubuntu Server 18.04 running PHP 7.0.22/MySQLi 5.0.12 and CentOS 7 Linux (a 100% compatible rebuild of the Red Hat Enterprise Linux) running PHP 5.6.32/MySQLi 5.5.58.
    • It is recommended that you upgrade to the latest official release of PHP to take advantage of gains in security and processing efficiency together with the latest features and functionality.
    Invoking class ::
    crnrstn_user
    Method definition ::
    setClientMobile()
    Returned value ::
    TRUE
    Example 1 ::
    Set the client's sesson profile in the CRNRSTN Suite :: to indicate that they are a mobile device.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    <?php
    /*
    // J5
    // Code is Poetry */
    require('_crnrstn.root.inc.php');
    include_once(
    $CRNRSTN_ROOT '/_crnrstn.config.inc.php');

    //
    // FORCE MOBILE DEVICE PROFILE TO SESSION
    $tmp $oCRNRSTN_USR->setClientMobile();

    //
    // LET'S CHECK TO SEE IF THE USER IS MOBILE. YES, WE
    // FORCED THIS WITH setClientMobile() ON LINE 10 ABOVE.
    $iAmMobile $oCRNRSTN_USR->isClientMobile();

    //
    // MUST CALL resetDeviceDetect() RIGHT NOW...OR YA'LL
    // WILL NEVER SEE THE DESKTOP VERSION OF THIS PAGE! SERIOUSLY!
    $oCRNRSTN_USR->resetDeviceDetect();

    //
    // NOW TO SUPPORT MOBILE DEVICES ON THIS DOCUMENTATION WEB
    // SITE...GENUINELY. AGAIN, IF I DON'T CALL THE FOLLOWING
    // METHOD, THEN MOBILE DEVICES WILL BE FORCED TO GET
    // DESKTOP 100% OF THE TIME ON THIS DOCUMENTATION PAGE.
    // SERIOUSLY!
    $tmp $oCRNRSTN_USR->isClientMobile(true);

    if(
    $iAmMobile){
        
    //
        // MOBILE DEVICE EXPERIENCE
        
    echo 'Hey, I am now permanently mobile...and will be so until resetDeviceDetect() is called!';

    }else{
        
    //
        // DESKTOP EXPERIENCE. THIS WILL NEVER RUN,YO.
        // WE BRUTE FORCED MOBILE PROFILE ON LINE 10 ABOVE.
        // YOU WILL BE MOBILE!  ;)
        
    echo 'I am not mobile!';

    }

    ?>
    Example 1 Output ::
    Hey, I am now permanently mobile...and will be so until resetDeviceDetect() is called!