!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)

/var/www/html/main_file/vendor/spatie/laravel-google-calendar/src/   drwxrwxr-x
Free 13.17 GB of 57.97 GB (22.72%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Spatie\GoogleCalendar;

use 
Google_Client;
use 
Google_Service_Calendar;
use 
Spatie\GoogleCalendar\Exceptions\InvalidConfiguration;

class 
GoogleCalendarFactory
{
    public static function 
createForCalendarId(string $calendarId): GoogleCalendar
    
{
        
$config config('google-calendar');

        
$client self::createAuthenticatedGoogleClient($config);

        
$service = new Google_Service_Calendar($client);

        return 
self::createCalendarClient($service$calendarId);
    }

    public static function 
createAuthenticatedGoogleClient(array $config): Google_Client
    
{
        
$authProfile $config['default_auth_profile'];

        if (
$authProfile === 'service_account') {
            return 
self::createServiceAccountClient($config['auth_profiles']['service_account']);
        }
        if (
$authProfile === 'oauth') {
            return 
self::createOAuthClient($config['auth_profiles']['oauth']);
        }

        throw 
InvalidConfiguration::invalidAuthenticationProfile($authProfile);
    }

    protected static function 
createServiceAccountClient(array $authProfile): Google_Client
    
{
        
$client = new Google_Client;

        
$client->setScopes([
            
Google_Service_Calendar::CALENDAR,
        ]);

        
$client->setAuthConfig($authProfile['credentials_json']);

        if (
config('google-calendar')['user_to_impersonate']) {
            
$client->setSubject(config('google-calendar')['user_to_impersonate']);
        }

        return 
$client;
    }

    protected static function 
createOAuthClient(array $authProfile): Google_Client
    
{
        
$client = new Google_Client;

        
$client->setScopes([
            
Google_Service_Calendar::CALENDAR,
        ]);

        
$client->setAuthConfig($authProfile['credentials_json']);

        
$client->setAccessToken(file_get_contents($authProfile['token_json']));

        return 
$client;
    }

    protected static function 
createCalendarClient(Google_Service_Calendar $servicestring $calendarId): GoogleCalendar
    
{
        return new 
GoogleCalendar($service$calendarId);
    }
}

:: 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.0067 ]--