!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)

/uploads/script/vendor/composer/composer/src/Composer/Package/Comparer/   drwxr-xr-x
Free 13.31 GB of 57.97 GB (22.97%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Package\Comparer;

/**
 * class Comparer
 *
 * @author Hector Prats <hectorpratsortega@gmail.com>
 */
class Comparer
{
    private 
$source;
    private 
$update;
    private 
$changed;

    public function 
setSource($source)
    {
        
$this->source $source;
    }

    public function 
setUpdate($update)
    {
        
$this->update $update;
    }

    public function 
getChanged($toString false$explicated false)
    {
        
$changed $this->changed;
        if (!
count($changed)) {
            return 
false;
        }
        if (
$explicated) {
            foreach (
$changed as $sectionKey => $itemSection) {
                foreach (
$itemSection as $itemKey => $item) {
                    
$changed[$sectionKey][$itemKey] = $item.' ('.$sectionKey.')';
                }
            }
        }

        if (
$toString) {
            foreach (
$changed as $sectionKey => $itemSection) {
                foreach (
$itemSection as $itemKey => $item) {
                    
$changed['string'][] = $item."\r\n";
                }
            }
            
$changed implode("\r\n"$changed['string']);
        }

        return 
$changed;
    }

    public function 
doCompare()
    {
        
$source = array();
        
$destination = array();
        
$this->changed = array();
        
$currentDirectory getcwd();
        
chdir($this->source);
        
$source $this->doTree('.'$source);
        if (!
is_array($source)) {
            return;
        }
        
chdir($currentDirectory);
        
chdir($this->update);
        
$destination $this->doTree('.'$destination);
        if (!
is_array($destination)) {
            exit;
        }
        
chdir($currentDirectory);
        foreach (
$source as $dir => $value) {
            foreach (
$value as $file => $hash) {
                if (isset(
$destination[$dir][$file])) {
                    if (
$hash !== $destination[$dir][$file]) {
                        
$this->changed['changed'][] = $dir.'/'.$file;
                    }
                } else {
                    
$this->changed['removed'][] = $dir.'/'.$file;
                }
            }
        }
        foreach (
$destination as $dir => $value) {
            foreach (
$value as $file => $hash) {
                if (!isset(
$source[$dir][$file])) {
                    
$this->changed['added'][] = $dir.'/'.$file;
                }
            }
        }
    }

    private function 
doTree($dir, &$array)
    {
        if (
$dh opendir($dir)) {
            while (
$file readdir($dh)) {
                if (
$file !== '.' && $file !== '..') {
                    if (
is_link($dir.'/'.$file)) {
                        
$array[$dir][$file] = readlink($dir.'/'.$file);
                    } elseif (
is_dir($dir.'/'.$file)) {
                        if (!
count($array)) {
                            
$array[0] = 'Temp';
                        }
                        if (!
$this->doTree($dir.'/'.$file$array)) {
                            return 
false;
                        }
                    } elseif (
is_file($dir.'/'.$file) && filesize($dir.'/'.$file)) {
                        
$array[$dir][$file] = md5_file($dir.'/'.$file);
                    }
                }
            }
            if (
count($array) > && isset($array['0'])) {
                unset(
$array['0']);
            }

            return 
$array;
        }

        return 
false;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0221 ]--