!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/proyectos/toba_testing/php/testing/test_administrador/   drwxr-xr-x
Free 14.75 GB of 61.93 GB (23.81%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

class test_reflexion extends test_toba
{
    protected 
$padre;
    protected 
$hijo;
    
    function 
get_descripcion()
    {
        return 
"Creación de archivos y clases PHP";
    }    

    function 
tearDown()
    {
        
$this->borrar_archivo();
    }
    
    function 
path_hijo()
    {
        return 
dirname(__FILE__)."/archivo_{$this->hijo}.php";    
    }
    
    function 
path_padre()
    {
        return 
dirname(__FILE__)."/archivo_{$this->padre}.php";    
    }
    
    function 
borrar_archivo()
    {
        if (
file_exists($this->path_hijo()))
            
unlink($this->path_hijo());
    }
    
    function 
crear_archivo_hijo($contenido)
    {
        
$fp fopen($this->path_hijo(), 'w');
        
fwrite($fp$contenido);
        
fclose($fp);
    }
    
    function 
generar_todo()
    {
        return array(
            
'constructor' => 1,
            
'basicos' => 1,
            
'eventos' => 2,
            
'nivel_comentarios' => 3
        
);    
    }
    
    
//--------------------------------------------------------------------------------
    //---------------GENERACION DEL ARCHIVO Y SUBCLASE BASICA-------------------------
    //--------------------------------------------------------------------------------
    
function test_creacion_archivo_y_directorio()
    {
        
$path dirname(__FILE__)."/dir1/dir2/archivo.php";
        
$archivo = new toba_archivo_php($path);
        
$archivo->crear_basico();
        
$this->assertTrue(file_exists($path));
        
        
//Limpiar el resultado
        
unlink($path);
        
rmdir(dirname(__FILE__)."/dir1/dir2");
        
rmdir(dirname(__FILE__)."/dir1");        
    }
    
    function 
test_creacion_archivo_y_generacion_clase()
    
// El archivo no existe en absoluto
    
{
        
$this->hijo "hijo_vacio";
        
$this->padre "padre_hijo_vacio";

        
//Se crea el archivo del hijo
        
$archivo = new toba_archivo_php($this->path_hijo());
        
$archivo->crear_basico(); 

        
//Se genera la subclase
        
$padre = new toba_archivo_php($this->path_padre());
        
$clase = new toba_clase_php($this->hijo$archivo$this->padre$this->path_padre());
        
$clase->set_meta_clase( new info_componente(array()));
        
$clase->generar($this->generar_todo()); 

        
//Se incluyen y se verifica que funcionan correctamente
        
$padre->incluir();
        
$archivo->incluir();
        
$clase = new ReflectionClass($this->hijo);
        
$this->AssertEqual($this->hijo$clase->getName());
    }
    
    function 
test_generacion_clase_archivo_con_codigo_previo()
    
// El hijo ya contiene un código, tendría que insertar la subclase sin molestar
    
{
        
$this->hijo "hijo_codigo_previo";
        
$this->padre "padre_hijo_codigo_previo";

        
$contenido 
"<?php
    /*
    * 
    */
    class clase_previa
    {
        function esta_es_una_funcion_previa()
        {
            //Esto trata de engañar al parser del archivo
            ?><?php
        }
    }

?>"
;
        
//Se crea el archivo del hijo
        
$this->crear_archivo_hijo($contenido);
        
        
//Se genera la subclase
        
$archivo = new toba_archivo_php($this->path_hijo());
        
$padre = new toba_archivo_php($this->path_padre());
        
$clase = new toba_clase_php($this->hijo$archivo$this->padre$this->path_padre());
        
$clase->set_meta_clase( new info_componente(array()));        
        
$clase->generar($this->generar_todo()); 

        
//Se incluyen y se verifica que funcionan correctamente
        
$padre->incluir();
        
$archivo->incluir();
        
$clase = new ReflectionClass($this->hijo);
        
$this->AssertEqual($this->hijo$clase->getName());
    }    


}


?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.8096 ]--