!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/vendor/phpunit/phpunit/src/Framework/Constraint/String/   drwxrwxrwx
Free 13.14 GB of 57.97 GB (22.66%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     StringContains.php (4.29 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Framework\Constraint;

use function 
is_string;
use function 
mb_detect_encoding;
use function 
mb_stripos;
use function 
mb_strtolower;
use function 
sprintf;
use function 
str_contains;
use function 
strlen;
use function 
strtr;
use 
PHPUnit\Util\Exporter;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 */
final class StringContains extends Constraint
{
    private 
readonly string $needle;
    private 
readonly bool $ignoreCase;
    private 
readonly bool $ignoreLineEndings;

    public function 
__construct(string $needlebool $ignoreCase falsebool $ignoreLineEndings false)
    {
        if (
$ignoreLineEndings) {
            
$needle $this->normalizeLineEndings($needle);
        }

        
$this->needle            $needle;
        
$this->ignoreCase        $ignoreCase;
        
$this->ignoreLineEndings $ignoreLineEndings;
    }

    
/**
     * Returns a string representation of the constraint.
     */
    
public function toString(): string
    
{
        
$needle $this->needle;

        if (
$this->ignoreCase) {
            
$needle mb_strtolower($this->needle'UTF-8');
        }

        return 
sprintf(
            
'contains "%s" [%s](length: %s)',
            
$needle,
            
$this->getDetectedEncoding($needle),
            
strlen($needle),
        );
    }

    public function 
failureDescription(mixed $other): string
    
{
        
$stringifiedHaystack Exporter::export($othertrue);
        
$haystackEncoding    $this->getDetectedEncoding($other);
        
$haystackLength      $this->getHaystackLength($other);

        
$haystackInformation sprintf(
            
'%s [%s](length: %s) ',
            
$stringifiedHaystack,
            
$haystackEncoding,
            
$haystackLength,
        );

        
$needleInformation $this->toString(true);

        return 
$haystackInformation $needleInformation;
    }

    
/**
     * Evaluates the constraint for parameter $other. Returns true if the
     * constraint is met, false otherwise.
     */
    
protected function matches(mixed $other): bool
    
{
        
$haystack $other;

        if (
'' === $this->needle) {
            return 
true;
        }

        if (!
is_string($haystack)) {
            return 
false;
        }

        if (
$this->ignoreLineEndings) {
            
$haystack $this->normalizeLineEndings($haystack);
        }

        if (
$this->ignoreCase) {
            
/*
             * We must use the multibyte-safe version, so we can accurately compare non-latin uppercase characters with
             * their lowercase equivalents.
             */
            
return mb_stripos($haystack$this->needle0'UTF-8') !== false;
        }

        
/*
         * Use the non-multibyte safe functions to see if the string is contained in $other.
         *
         * This function is very fast, and we don't care about the character position in the string.
         *
         * Additionally, we want this method to be binary safe, so we can check if some binary data is in other binary
         * data.
         */
        
return str_contains($haystack$this->needle);
    }

    private function 
getDetectedEncoding(mixed $other): string
    
{
        if (
$this->ignoreCase) {
            return 
'Encoding ignored';
        }

        if (!
is_string($other)) {
            return 
'Encoding detection failed';
        }

        
$detectedEncoding mb_detect_encoding($othernulltrue);

        if (
$detectedEncoding === false) {
            return 
'Encoding detection failed';
        }

        return 
$detectedEncoding;
    }

    private function 
getHaystackLength(mixed $haystack): int
    
{
        if (!
is_string($haystack)) {
            return 
0;
        }

        if (
$this->ignoreLineEndings) {
            
$haystack $this->normalizeLineEndings($haystack);
        }

        return 
strlen($haystack);
    }

    private function 
normalizeLineEndings(string $string): string
    
{
        return 
strtr(
            
$string,
            [
                
"\r\n" => "\n",
                
"\r"   => "\n",
            ],
        );
    }
}

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