!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/classify.picotech.app/public_html/vendor/stevebauman/location/src/Drivers/   drwxr-xr-x
Free 29.1 GB of 117.98 GB (24.66%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     MaxMind.php (4.54 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Stevebauman\Location\Drivers;

use 
Exception;
use 
GeoIp2\Database\Reader;
use 
GeoIp2\Model\City;
use 
GeoIp2\WebService\Client;
use 
Illuminate\Support\Fluent;
use 
Stevebauman\Location\Position;

class 
MaxMind extends Driver
{
    
/**
     * {@inheritdoc}
     */
    
protected function hydrate(Position $positionFluent $location)
    {
        
$position->countryName $location->country;
        
$position->countryCode $location->country_code;
        
$position->isoCode $location->country_code;
        
$position->regionCode $location->regionCode;
        
$position->regionName $location->regionName;
        
$position->cityName $location->city;
        
$position->postalCode $location->postal;
        
$position->metroCode $location->metro_code;
        
$position->timezone $location->time_zone;
        
$position->latitude $location->latitude;
        
$position->longitude $location->longitude;

        return 
$position;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function process($ip)
    {
        try {
            
$record $this->fetchLocation($ip);

            if (
$record instanceof City) {
                return new 
Fluent([
                    
'country' => $record->country->name,
                    
'country_code' => $record->country->isoCode,
                    
'city' => $record->city->name,
                    
'regionCode' => $record->mostSpecificSubdivision->isoCode,
                    
'regionName' => $record->mostSpecificSubdivision->name,
                    
'postal' => $record->postal->code,
                    
'timezone' => $record->location->timeZone,
                    
'latitude' => (string) $record->location->latitude,
                    
'longitude' => (string) $record->location->longitude,
                    
'metro_code' => (string) $record->location->metroCode,
                ]);
            }

            return new 
Fluent([
                
'country' => $record->country->name,
                
'country_code' => $record->country->isoCode,
            ]);
        } catch (
Exception $e) {
            return 
false;
        }
    }

    
/**
     * Attempt to fetch the location model from Maxmind.
     *
     * @param string $ip
     *
     * @return \GeoIp2\Model\City
     *
     * @throws \Exception
     */
    
protected function fetchLocation($ip)
    {
        
$maxmind $this->isWebServiceEnabled()
            ? 
$this->newClient($this->getUserId(), $this->getLicenseKey(), $this->getOptions())
            : 
$this->newReader($this->getDatabasePath());

        if (
$this->isWebServiceEnabled() || $this->getLocationType() === 'city') {
            return 
$maxmind->city($ip);
        }

        return 
$maxmind->country($ip);
    }

    
/**
     * Returns a new MaxMind web service client.
     *
     * @param string $userId
     * @param string $licenseKey
     * @param array  $options
     *
     * @return Client
     */
    
protected function newClient($userId$licenseKey, array $options = [])
    {
        return new 
Client($userId$licenseKey$options);
    }

    
/**
     * Returns a new MaxMind reader client with
     * the specified database file path.
     *
     * @param string $path
     *
     * @return \GeoIp2\Database\Reader
     */
    
protected function newReader($path)
    {
        return new 
Reader($path);
    }

    
/**
     * Returns true / false if the MaxMind web service is enabled.
     *
     * @return mixed
     */
    
protected function isWebServiceEnabled()
    {
        return 
config('location.maxmind.web.enabled'false);
    }

    
/**
     * Returns the configured MaxMind web user ID.
     *
     * @return string
     */
    
protected function getUserId()
    {
        return 
config('location.maxmind.web.user_id');
    }

    
/**
     * Returns the configured MaxMind web license key.
     *
     * @return string
     */
    
protected function getLicenseKey()
    {
        return 
config('location.maxmind.web.license_key');
    }

    
/**
     * Returns the configured MaxMind web option array.
     *
     * @return array
     */
    
protected function getOptions()
    {
        return 
config('location.maxmind.web.options', []);
    }

    
/**
     * Returns the MaxMind database file path.
     *
     * @return string
     */
    
protected function getDatabasePath()
    {
        return 
config('location.maxmind.local.path'database_path('maxmind/GeoLite2-City.mmdb'));
    }

    
/**
     * Returns the MaxMind location type.
     *
     * @return string
     */
    
protected function getLocationType()
    {
        return 
config('location.maxmind.local.type''city');
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]--