!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/ecom1.picotech.app/public_html_ecom1/vendor/laravel/breeze/src/Console/   drwxr-xr-x
Free 25.37 GB of 117.98 GB (21.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Laravel\Breeze\Console;

use 
Illuminate\Console\Command;
use 
Illuminate\Filesystem\Filesystem;
use 
Illuminate\Support\Str;
use 
RuntimeException;
use 
Symfony\Component\Finder\Finder;
use 
Symfony\Component\Process\PhpExecutableFinder;
use 
Symfony\Component\Process\Process;

class 
InstallCommand extends Command
{
    use 
InstallsApiStackInstallsBladeStackInstallsInertiaStacks;

    
/**
     * The name and signature of the console command.
     *
     * @var string
     */
    
protected $signature 'breeze:install {stack=blade : The development stack that should be installed (blade,react,vue,api)}
                            {--dark : Indicate that dark mode support should be installed}
                            {--inertia : Indicate that the Vue Inertia stack should be installed (Deprecated)}
                            {--pest : Indicate that Pest should be installed}
                            {--ssr : Indicates if Inertia SSR support should be installed}
                            {--composer=global : Absolute path to the Composer binary which should be used to install packages}'
;

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Install the Breeze controllers and resources';

    
/**
     * Execute the console command.
     *
     * @return int|null
     */
    
public function handle()
    {
        if (
$this->option('inertia') || $this->argument('stack') === 'vue') {
            return 
$this->installInertiaVueStack();
        } elseif (
$this->argument('stack') === 'react') {
            return 
$this->installInertiaReactStack();
        } elseif (
$this->argument('stack') === 'api') {
            return 
$this->installApiStack();
        } elseif (
$this->argument('stack') === 'blade') {
            return 
$this->installBladeStack();
        }

        
$this->components->error('Invalid stack. Supported stacks are [blade], [react], [vue], and [api].');

        return 
1;
    }

    
/**
     * Install Breeze's tests.
     *
     * @return void
     */
    
protected function installTests()
    {
        (new 
Filesystem)->ensureDirectoryExists(base_path('tests/Feature'));

        
$stubStack $this->argument('stack') === 'api' 'api' 'default';

        if (
$this->option('pest')) {
            
$this->requireComposerPackages('pestphp/pest:^1.16''pestphp/pest-plugin-laravel:^1.1');

            (new 
Filesystem)->copyDirectory(__DIR__.'/../../stubs/'.$stubStack.'/pest-tests/Feature'base_path('tests/Feature'));
            (new 
Filesystem)->copyDirectory(__DIR__.'/../../stubs/'.$stubStack.'/pest-tests/Unit'base_path('tests/Unit'));
            (new 
Filesystem)->copy(__DIR__.'/../../stubs/'.$stubStack.'/pest-tests/Pest.php'base_path('tests/Pest.php'));
        } else {
            (new 
Filesystem)->copyDirectory(__DIR__.'/../../stubs/'.$stubStack.'/tests/Feature'base_path('tests/Feature'));
        }
    }

    
/**
     * Install the middleware to a group in the application Http Kernel.
     *
     * @param  string  $after
     * @param  string  $name
     * @param  string  $group
     * @return void
     */
    
protected function installMiddlewareAfter($after$name$group 'web')
    {
        
$httpKernel file_get_contents(app_path('Http/Kernel.php'));

        
$middlewareGroups Str::before(Str::after($httpKernel'$middlewareGroups = ['), '];');
        
$middlewareGroup Str::before(Str::after($middlewareGroups"'$group' => ["), '],');

        if (! 
Str::contains($middlewareGroup$name)) {
            
$modifiedMiddlewareGroup str_replace(
                
$after.',',
                
$after.','.PHP_EOL.'            '.$name.',',
                
$middlewareGroup,
            );

            
file_put_contents(app_path('Http/Kernel.php'), str_replace(
                
$middlewareGroups,
                
str_replace($middlewareGroup$modifiedMiddlewareGroup$middlewareGroups),
                
$httpKernel
            
));
        }
    }

    
/**
     * Installs the given Composer Packages into the application.
     *
     * @param  mixed  $packages
     * @return void
     */
    
protected function requireComposerPackages($packages)
    {
        
$composer $this->option('composer');

        if (
$composer !== 'global') {
            
$command = ['php'$composer'require'];
        }

        
$command array_merge(
            
$command ?? ['composer''require'],
            
is_array($packages) ? $packages func_get_args()
        );

        (new 
Process($commandbase_path(), ['COMPOSER_MEMORY_LIMIT' => '-1']))
            ->
setTimeout(null)
            ->
run(function ($type$output) {
                
$this->output->write($output);
            });
    }

    
/**
     * Update the "package.json" file.
     *
     * @param  callable  $callback
     * @param  bool  $dev
     * @return void
     */
    
protected static function updateNodePackages(callable $callback$dev true)
    {
        if (! 
file_exists(base_path('package.json'))) {
            return;
        }

        
$configurationKey $dev 'devDependencies' 'dependencies';

        
$packages json_decode(file_get_contents(base_path('package.json')), true);

        
$packages[$configurationKey] = $callback(
            
array_key_exists($configurationKey$packages) ? $packages[$configurationKey] : [],
            
$configurationKey
        
);

        
ksort($packages[$configurationKey]);

        
file_put_contents(
            
base_path('package.json'),
            
json_encode($packagesJSON_UNESCAPED_SLASHES JSON_PRETTY_PRINT).PHP_EOL
        
);
    }

    
/**
     * Delete the "node_modules" directory and remove the associated lock files.
     *
     * @return void
     */
    
protected static function flushNodeModules()
    {
        
tap(new Filesystem, function ($files) {
            
$files->deleteDirectory(base_path('node_modules'));

            
$files->delete(base_path('yarn.lock'));
            
$files->delete(base_path('package-lock.json'));
        });
    }

    
/**
     * Replace a given string within a given file.
     *
     * @param  string  $search
     * @param  string  $replace
     * @param  string  $path
     * @return void
     */
    
protected function replaceInFile($search$replace$path)
    {
        
file_put_contents($pathstr_replace($search$replacefile_get_contents($path)));
    }

    
/**
     * Get the path to the appropriate PHP binary.
     *
     * @return string
     */
    
protected function phpBinary()
    {
        return (new 
PhpExecutableFinder())->find(false) ?: 'php';
    }

    
/**
     * Run the given commands.
     *
     * @param  array  $commands
     * @return void
     */
    
protected function runCommands($commands)
    {
        
$process Process::fromShellCommandline(implode(' && '$commands), nullnullnullnull);

        if (
'\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) {
            try {
                
$process->setTty(true);
            } catch (
RuntimeException $e) {
                
$this->output->writeln('  <bg=yellow;fg=black> WARN </> '.$e->getMessage().PHP_EOL);
            }
        }

        
$process->run(function ($type$line) {
            
$this->output->write('    '.$line);
        });
    }

    
/**
     * Remove Tailwind dark classes from the given files.
     *
     * @param  \Symfony\Component\Finder\Finder  $finder
     * @return void
     */
    
protected function removeDarkClasses(Finder $finder)
    {
        foreach (
$finder as $file) {
            
file_put_contents($file->getPathname(), preg_replace('/\sdark:[^\s"\']+/'''$file->getContents()));
        }
    }
}

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