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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/spatie/laravel-analytics/src/   drwxr-xr-x
Free 13.12 GB of 57.97 GB (22.64%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Spatie\Analytics;

use 
DateTimeInterface;
use 
Google_Service_Analytics;
use 
Illuminate\Contracts\Cache\Repository;

class 
AnalyticsClient
{
    
/** @var \Google_Service_Analytics */
    
protected $service;

    
/** @var \Illuminate\Contracts\Cache\Repository */
    
protected $cache;

    
/** @var int */
    
protected $cacheLifeTimeInMinutes 0;

    public function 
__construct(Google_Service_Analytics $serviceRepository $cache)
    {
        
$this->service $service;

        
$this->cache $cache;
    }

    
/**
     * Set the cache time.
     *
     * @param int $cacheLifeTimeInMinutes
     *
     * @return self
     */
    
public function setCacheLifeTimeInMinutes(int $cacheLifeTimeInMinutes)
    {
        
$this->cacheLifeTimeInMinutes $cacheLifeTimeInMinutes 60;

        return 
$this;
    }

    
/**
     * Query the Google Analytics Service with given parameters.
     *
     * @param string $viewId
     * @param \DateTimeInterface $startDate
     * @param \DateTimeInterface $endDate
     * @param string $metrics
     * @param array $others
     *
     * @return array|null
     */
    
public function performQuery(string $viewIdDateTimeInterface $startDateDateTimeInterface $endDatestring $metrics, array $others = [])
    {
        
$cacheName $this->determineCacheName(func_get_args());

        if (
$this->cacheLifeTimeInMinutes == 0) {
            
$this->cache->forget($cacheName);
        }

        return 
$this->cache->remember($cacheName$this->cacheLifeTimeInMinutes, function () use ($viewId$startDate$endDate$metrics$others) {
            
$result $this->service->data_ga->get(
                
"ga:{$viewId}",
                
$startDate->format('Y-m-d'),
                
$endDate->format('Y-m-d'),
                
$metrics,
                
$others
            
);

            while (
$nextLink $result->getNextLink()) {
                if (isset(
$others['max-results']) && count($result->rows) >= $others['max-results']) {
                    break;
                }

                
$options = [];

                
parse_str(substr($nextLinkstrpos($nextLink'?') + 1), $options);

                
$response $this->service->data_ga->call('get', [$options], 'Google_Service_Analytics_GaData');

                if (
$response->rows) {
                    
$result->rows array_merge($result->rows$response->rows);
                }

                
$result->nextLink $response->nextLink;
            }

            return 
$result;
        });
    }

    public function 
getAnalyticsService(): Google_Service_Analytics
    
{
        return 
$this->service;
    }

    
/*
     * Determine the cache name for the set of query properties given.
     */
    
protected function determineCacheName(array $properties): string
    
{
        return 
'spatie.laravel-analytics.'.md5(serialize($properties));
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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