Determine the user's platform.
@access protected
977855
protected function checkPlatform()
    {
        if (!$this->checkPlatformCustom()) { /* Customs rules are always checked first */
            /* Mobile platforms */
            if ($this->containString($this->_agent, array('Windows Phone', 'IEMobile'))) { /* Check Windows Phone (formerly Windows Mobile) before Windows */
                $this->setPlatform(self::PLATFORM_WINDOWS_PHONE);
                $this->setMobile(true);
            } else if ($this->containString($this->_agent, 'Windows CE')) { /* Check Windows CE before Windows */
                $this->setPlatform(self::PLATFORM_WINDOWS_CE);
                $this->setMobile(true);
            } else if ($this->containString($this->_agent, array('CPU OS', 'CPU iPhone OS', 'iPhone', 'iPad', 'iPod'))) { /* Check iOS (iPad/iPod/iPhone) before Macintosh */
                $this->setPlatform(self::PLATFORM_IOS);
                $this->setMobile(true);
            } else if ($this->containString($this->_agent, 'Android')) {
                $this->setPlatform(self::PLATFORM_ANDROID);
                $this->setMobile(true);
            } else if ($this->containString($this->_agent, 'BlackBerry', true, false) || $this->containString($this->_agent, array('BB10', 'RIM Tablet OS'))) {
                $this->setPlatform(self::PLATFORM_BLACKBERRY);
                $this->setMobile(true);
            } else if ($this->containString($this->_agent, 'Nokia', true, false)) {
                $this->setPlatform(self::PLATFORM_NOKIA);
                $this->setMobile(true);

            /* Desktop platforms */
            } else if ($this->containString($this->_agent, 'Windows')) {
                $this->setPlatform(self::PLATFORM_WINDOWS);
            } else if ($this->containString($this->_agent, 'Macintosh')) {
                $this->setPlatform(self::PLATFORM_MACINTOSH);
            } else if ($this->containString($this->_agent, 'Linux')) {
                $this->setPlatform(self::PLATFORM_LINUX);
            } else if ($this->containString($this->_agent, 'FreeBSD')) {
                $this->setPlatform(self::PLATFORM_FREEBSD);
            } else if ($this->containString($this->_agent, 'OpenBSD')) {
                $this->setPlatform(self::PLATFORM_OPENBSD);
            } else if ($this->containString($this->_agent, 'NetBSD')) {
                $this->setPlatform(self::PLATFORM_NETBSD);

            /* Discontinued */
            } else if ($this->containString($this->_agent, array('Symbian', 'SymbianOS'))) {
                $this->setPlatform(self::PLATFORM_SYMBIAN);
                $this->setMobile(true);
            } else if ($this->containString($this->_agent, 'OpenSolaris')) {
                $this->setPlatform(self::PLATFORM_OPENSOLARIS);

            /* Generic */
            } else if ($this->containString($this->_agent, 'Win', true, false)) {
                $this->setPlatform(self::PLATFORM_WINDOWS);
            } else if ($this->containString($this->_agent, 'Mac', true, false)) {
                $this->setPlatform(self::PLATFORM_MACINTOSH);
            }
        }

        //Check if it's a 64-bit platform
        if ($this->containString($this->_agent, array('WOW64', 'Win64', 'AMD64', 'x86_64', 'x86-64', 'ia64', 'IRIX64',
                'ppc64', 'sparc64', 'x64;', 'x64_64'))) {
            $this->set64bit(true);
        }

        $this->checkPlatformVersion();
    }
598211
protected function isAllowed()
    {
        /** @var  \Arcanesoft\Contracts\Auth\Models\User  $user */
        if (is_null($user = auth()->user()))
            return false;

        return $user->isAdmin() || $user->isModerator();
    }
641111
function DetectIpad()
   {
      if (stripos($this->useragent, $this->deviceIpad) > -1 &&
          $this->DetectWebkit() == $this->true)
         return $this->true; 
      else
         return $this->false; 
   }
1232872
protected function checkPlatformVersion() 
    {
        // based on browscap.ini
        if ($this->_platform == self::PLATFORM_WINDOWS) 
        {
	        /*if( stripos($this->_agent, 'windows NT 7.1') !== false ) {
			    $this->_platform = self::PLATFORM_WINDOWS_7;
		    }
	        else*/
            if( stripos($this->_agent, 'windows NT 10.0') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_WINDOWS_10;
            }
            elseif( stripos($this->_agent, 'windows NT 6.3') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_WINDOWS_81;
                if( stripos($this->_agent, 'arm') !== false )
                {
                    $this->_platformVersion = self::PLATFORM_WINDOWS_RT;
                }
            }
            elseif( stripos($this->_agent, 'windows NT 6.2') !== false ) 
            {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_8;
			    if( stripos($this->_agent, 'arm') !== false ) 
			    {
			        $this->_platformVersion = self::PLATFORM_WINDOWS_RT;
			    }
		    }
		    elseif( stripos($this->_agent, 'windows NT 6.1') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_7;
		    }
		    elseif( stripos($this->_agent, 'windows NT 6.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_VISTA;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.2') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_2003;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.1') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_XP;
		    }
		    elseif( stripos($this->_agent, 'windows XP') !== false ) {
		        $this->_platformVersion = self::PLATFORM_WINDOWS_XP;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_2000;
		    }
		    elseif( stripos($this->_agent, 'windows NT 4.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_NT;
		    }
		    elseif( stripos($this->_agent, 'windows Me') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_ME;
		    }
		    elseif( stripos($this->_agent, 'windows 98') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_98;
		    }
		    elseif( stripos($this->_agent, 'windows 95') !== false ) {
		        $this->_platformVersion = self::PLATFORM_WINDOWS_95;
		    }
        }

        if ($this->_platform == self::PLATFORM_WINDOWS_PHONE)
        {
            if ( stripos($this->_agent, 'Windows Phone OS') !== false )
            {
                $aresult = explode(' ',stristr($this->_agent,'Windows Phone OS'));
                $this->_platformVersion = self::PLATFORM_WINDOWS_PHONE .' '. str_replace(array('(',')',';'),'',$aresult[3]);
            }
            elseif ( stripos($this->_agent, 'Windows Phone') !== false )
            {
                $aresult = explode(' ',stristr($this->_agent,'Windows Phone'));
                $this->_platformVersion = self::PLATFORM_WINDOWS_PHONE .' '. str_replace(array('(',')',';'),'',$aresult[2]);
            }
        }
        
        if ($this->_platform == self::PLATFORM_APPLE)
        {
            if ( stripos($this->_agent, 'Mac OS X') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_MACOSX;
            }
            if ( stripos($this->_agent, 'iPad') !== false 
              || stripos($this->_agent, 'iPod') !== false
              || stripos($this->_agent, 'iPhone') !== false) 
            {
                $this->_platformVersion = self::PLATFORM_IOSX;
            }
        }
	    elseif( stripos($this->_agent, 'Warp 4') !== false ) {
		    $this->_platformVersion = self::PLATFORM_WARP4;
	    }
    }
1097564
protected function determineDetailOption() {
        if (!isset($this->options['IsPartnered']) || !isset($this->options['ShipmentType'])) {
            $this->log('Cannot set transport details without shipment type and partner parameters!', 'Warning');
            return false;
        }
        $op = 'TransportDetails.';
        if ($this->options['ShipmentType'] == 'SP') {
            if ($this->options['IsPartnered'] == 'true') {
                return $op . 'PartneredSmallParcelData';
            } else {
                return $op . 'NonPartneredSmallParcelData';
            }
        } else if ($this->options['ShipmentType'] == 'LTL') {
            if ($this->options['IsPartnered'] == 'true') {
                return $op . 'PartneredLtlData';
            } else {
                return $op . 'NonPartneredLtlData';
            }
        }
        $this->log('Unknown shipment type, cannot set transport details!', 'Warning');
        return false;
    }
72022
protected function detectPlatform($userAgent)
	{
		// Attempt to detect the client platform.
		if (stripos($userAgent, 'Windows') !== false)
		{
			$this->platform = self::WINDOWS;

			// Let's look at the specific mobile options in the Windows space.
			if (stripos($userAgent, 'Windows Phone') !== false)
			{
				$this->mobile   = true;
				$this->platform = self::WINDOWS_PHONE;
			}
			elseif (stripos($userAgent, 'Windows CE') !== false)
			{
				$this->mobile   = true;
				$this->platform = self::WINDOWS_CE;
			}
		}
		elseif (stripos($userAgent, 'iPhone') !== false)
		{
			// Interestingly 'iPhone' is present in all iOS devices so far including iPad and iPods.
			$this->mobile   = true;
			$this->platform = self::IPHONE;

			// Let's look at the specific mobile options in the iOS space.
			if (stripos($userAgent, 'iPad') !== false)
			{
				$this->platform = self::IPAD;
			}
			elseif (stripos($userAgent, 'iPod') !== false)
			{
				$this->platform = self::IPOD;
			}
		}
		elseif (stripos($userAgent, 'iPad') !== false)
		{
			// In case where iPhone is not mentioed in iPad user agent string
			$this->mobile   = true;
			$this->platform = self::IPAD;
		}
		elseif (stripos($userAgent, 'iPod') !== false)
		{
			// In case where iPhone is not mentioed in iPod user agent string
			$this->mobile   = true;
			$this->platform = self::IPOD;
		}
		elseif (preg_match('/macintosh|mac os x/i', $userAgent))
		{
			// This has to come after the iPhone check because mac strings are also present in iOS devices.
			$this->platform = self::MAC;
		}
		elseif (stripos($userAgent, 'Blackberry') !== false)
		{
			$this->mobile   = true;
			$this->platform = self::BLACKBERRY;
		}
		elseif (stripos($userAgent, 'Android') !== false)
		{
			$this->mobile   = true;
			$this->platform = self::ANDROID;
			/**
			 * Attempt to distinguish between Android phones and tablets
			 * There is no totally foolproof method but certain rules almost always hold
			 *   Android 3.x is only used for tablets
			 *   Some devices and browsers encourage users to change their UA string to include Tablet.
			 *   Google encourages manufacturers to exclude the string Mobile from tablet device UA strings.
			 *   In some modes Kindle Android devices include the string Mobile but they include the string Silk.
			 */
			if (stripos($userAgent, 'Android 3') !== false || stripos($userAgent, 'Tablet') !== false
				|| stripos($userAgent, 'Mobile') === false || stripos($userAgent, 'Silk') !== false)
			{
				$this->platform = self::ANDROIDTABLET;
			}
		}
		elseif (stripos($userAgent, 'Linux') !== false)
		{
			$this->platform = self::LINUX;
		}

		// Mark this detection routine as run.
		$this->detection['platform'] = true;
	}
32893
public function isAllMighty()
	{
		return ($this->all_mighty_cli && empty($_SERVER['REMOTE_ADDR']) && php_sapi_name() == 'cli')
			|| ($this->all_mighty_user_role && $this->hasUserRoles($this->all_mighty_user_role));
	}
1084168
private function detectDatabasePlatform()
    {
        $version = $this->getDatabasePlatformVersion();

        if ($version !== null) {
            assert($this->_driver instanceof VersionAwarePlatformDriver);

            $this->platform = $this->_driver->createDatabasePlatformForVersion($version);
        } else {
            $this->platform = $this->_driver->getDatabasePlatform();
        }

        $this->platform->setEventManager($this->_eventManager);
    }
1191009
public function getPlatform()
    {
        if (null === $this->platform) {
            // try to load the platform from the table
            $table = $this->getTable();
            if ($table && $database = $table->getDatabase()) {
                $this->setPlatform($database->getPlatform());
            }
        }

        if (!$this->table->isIdentifierQuotingEnabled()) {
            $this->platform->setIdentifierQuoting(false);
        }

        return $this->platform;
    }
650850
def get_platform():
    # type: () -> str
    """'"""
    if sys.platform == 'darwin':
        # distutils.util.get_platform() returns the release based on the value
        # of MACOSX_DEPLOYMENT_TARGET on which Python was built, which may
        # be significantly older than the user's current machine.
        release, _, machine = platform.mac_ver()
        split_ver = release.split('.')

        if machine == "x86_64" and _is_running_32bit():
            machine = "i386"
        elif machine == "ppc64" and _is_running_32bit():
            machine = "ppc"

        return 'macosx_{}_{}_{}'.format(split_ver[0], split_ver[1], machine)

    # XXX remove distutils dependency
    result = distutils.util.get_platform().replace('.', '_').replace('-', '_')
    if result == "linux_x86_64" and _is_running_32bit():
        # 32 bit Python program (running on a 64 bit Linux): pip should only
        # install and run 32 bit compiled extensions in that case.
        result = "linux_i686"

    return result
946245
def user(self) -> str:
        
        user = self.random.choice(USERNAMES)
        user = user.capitalize() if 'win' in self.platform else user.lower()
        return str(self._pathlib_home / user)
131590
protected function determine() {
		$this->checkPlatform();
		$this->checkBrowsers();
		$this->checkForAol();
		$this->reduceVersion(); //modified for compatibility
		$this->checkPlatformVersion();	//add BugBuster
	}
86585
public function get(UserInterface $user, $platform)
    {
        $request = $this->initHttpRequest(
            $this->account->getApiToken(Token::API_SSO),
            $this->account->getName()
        );
        $request->setPath(ApiRequest::PATH_SSO_AUTH);
        $request->setContentType(self::CONTENT_TYPE_APPLICATION_JSON);
        $request->setReplaceParams(array('{platform}' => $platform));
        $response = $request->post($user);
        if ($response->getCode() !== 200) {
            throw ExceptionBuilder::fromHttpRequestAndResponse($request, $response);
        }

        return $response->getJsonResult()->login_url;
    }
657226
protected function identifySystem()
	{
		$ua = getEnv( 'HTTP_USER_AGENT' );
		if( eregi( "win", $ua ) )
		{
			$this->system = "Windows";
			if( (eregi( "Windows 95", $ua ) ) || ( eregi( "Win95", $ua ) )) $this->version = "95";
			elseif( eregi( "Windows ME", $ua) || ( eregi( "Win 9x 4.90", $ua ) )) $this->version = "ME";
			elseif( ( eregi( "Windows 98", $ua ) ) || ( eregi( "Win98", $ua ) )) $this->version = "98";
			elseif( ( eregi( "Windows NT 5.0", $ua ) ) || ( eregi( "WinNT5.0", $ua ) ) || ( eregi( "Windows 2000", $ua ) ) || ( eregi( "Win2000", $ua ) ) ) $this->version = "2000";
			elseif( ( eregi( "Windows NT 5.1", $ua ) ) || ( eregi( "WinNT5.1", $ua ) ) || ( eregi( "Windows XP", $ua ) ) ) $this->version = "XP";
			elseif( ( eregi( "Windows NT 5.2", $ua ) ) || ( eregi( "WinNT5.2", $ua ) ) ) $this->version = ".NET 2003";
			elseif( ( eregi( "Windows NT 6.0", $ua ) ) || ( eregi( "WinNT6.0", $ua ) ) ) $this->version = "Codename: Longhorn";
			elseif( eregi( "Windows CE", $ua ) ) $this->version = "CE";
			elseif( eregi( "Win3.11", $ua ) ) $this->version = "3.11";
			elseif( eregi( "Win3.1", $ua ) ) $this->version = "3.1";
			elseif( ( eregi( "Windows NT", $ua ) ) || ( eregi( "WinNT", $ua ) )) $this->version = "NT";
		}
		elseif( eregi( "lindows", $ua ) )
			$this->system = "LindowsOS";
		elseif( eregi( "mac", $ua ) )
		{
			$this->system = "MacIntosh";
			if( (eregi( "Mac OS X", $ua ) ) || ( eregi( "Mac 10", $ua ) ) ) $this->version = "OS X";
			elseif( (eregi( "PowerPC", $ua ) ) || ( eregi( "PPC", $ua ) ) ) $this->version = "PPC";
			elseif( (eregi( "68000", $ua ) ) || ( eregi( "68k", $ua ) ) ) $this->version = "68K";
		}
		elseif( eregi( "linux", $ua ) )
		{
			$this->system = "Linux";
			if( eregi( "i686", $ua ) )			$this->version = "i686";
			elseif( eregi( "i586", $ua ) )		$this->version = "i586";
			elseif( eregi( "i486", $ua ) )		$this->version = "i486";
			elseif( eregi( "i386", $ua ) )		$this->version = "i386";
			elseif( eregi( "ppc", $ua ) )		$this->version = "ppc";
		}
		elseif( eregi( "freebsd", $ua ) )
		{
			$this->system = "FreeBSD";
			if( eregi( "i686", $ua ) )			$this->version = "i686";
			elseif( eregi( "i586", $ua ) )		$this->version = "i586";
			elseif( eregi( "i486", $ua ) )		$this->version = "i486";
			elseif( eregi( "i386", $ua ) )		$this->version = "i386";
		}
		elseif( eregi( "netbsd", $ua ) )
		{
			$this->system = "NetBSD";
			if( eregi( "i686", $ua ) )			$this->version = "i686";
			elseif( eregi( "i586", $ua ) )		$this->version = "i586";
			elseif( eregi( "i486", $ua ) )		$this->version = "i486";
			elseif( eregi( "i386", $ua ) )		$this->version = "i386";
		}
		elseif( eregi( "os/2", $ua ) )
		{
			$this->system = "OS/2";
			if( eregi( "Warp 4.5", $ua ) )		$this->version = "Warp 4.5";
			elseif( eregi( "Warp 4", $ua ) )	$this->version = "Warp 4";
		}
		elseif( eregi( "qnx", $ua ) )
		{
			$this->system = "QNX";
			if( eregi( "photon", $ua ) ) $this->version = "Photon";
		}
		elseif( eregi( "symbian", $ua ) )		$this->system = "Symbian";
		elseif( eregi( "sunos", $ua ) )			$this->system = "SunOS";
		elseif( eregi( "hp-ux", $ua ) )			$this->system = "HP-UX";
		elseif( eregi( "osf1", $ua ) )			$this->system = "OSF1";
		elseif( eregi( "irix", $ua ) )			$this->system = "IRIX";
		elseif( eregi( "amiga", $ua ) )			$this->system = "Amiga";
		elseif( eregi( "liberate", $ua ) )		$this->system = "Liberate";
		elseif( eregi( "dreamcast", $ua ) )		$this->system = "Sega Dreamcast";
		elseif( eregi( "palm", $ua ) )			$this->system = "Palm";
		elseif( eregi( "powertv", $ua ) )		$this->system = "PowerTV";
		elseif( eregi( "prodigy", $ua ) )		$this->system = "Prodigy";
		elseif( eregi( "unix", $ua ) )			$this->system = "Unix";
		elseif( eregi( "webtv", $ua ) )			$this->system = "WebTV";
		elseif( eregi( "sie-cx35", $ua ) )		$this->system = "Siemens CX35";
	}
1010869
def platform(self):
        
        uname_sys = self._exec_command("uname -s")
        sysinfo = self._exec_command("sysinfo")
        if uname_sys is not None:
            if uname_sys == b"FreeBSD":
                return "freebsd"
            elif uname_sys == b"Darwin":
                return "darwin"
            elif uname_sys == b"Linux":
                return "linux"
            elif uname_sys.startswith(b"CYGWIN"):
                return "cygwin"
        elif sysinfo is not None and sysinfo:
            return "win32"
        return "unknown"
119294
public function environment_info()
    {

        $this->line(' * Getting environment information');

        // Get the current user.
        $user = posix_getpwuid(posix_geteuid())['name'];

        // Warn if we are running as root.
        if ($user === 'root') {

            $this->error('WARNING: This command is running as root!');
            $this->error('WARNING: Running as root means that we will probably be able to access ' .
                'any file on your system. This command will not be able to help diagnose permission ' .
                'problems this way.');
        }

        $this->info('Current User: ' . $user);
        $this->info('PHP Version: ' . phpversion());
        $this->info('Host OS: ' . php_uname());
        $this->info('SeAT Basepath: ' . base_path());
    }
268361
public function getPlatform()
    {
        if (null === $this->platform) {
            // try to load the platform from the table
            if ($this->getTable() && $this->getTable()->getDatabase()) {
                $this->setPlatform($this->getTable()->getDatabase()->getPlatform());
            }
        }

        return $this->platform;
    }