!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/php/lib/   drwxr-xr-x
Free 14.92 GB of 61.93 GB (24.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/**
 * Clase que permite leer/grabar en archivos de configuración .ini
 * @package Varios
 */
class toba_ini
{
    private 
$path null;
    private 
$titulo;
    private 
$entradas=array();
    
    function 
__construct$path null )
    {
        if ( isset( 
$path ) ) {
            
$this->path $path;
            if ( 
file_exists$this->path ) ) {
                
$this->entradas parse_ini_file$this->pathtrue );
            }
        }
    }

    function 
agregar_titulo$titulo )
    {
        
$this->titulo $titulo;    
    }

    
//-----------------------------------------------------------
    //    Manipulacion de ENTADAS
    //-----------------------------------------------------------

    
function get_entradas()
    {
        return 
$this->entradas;
    }
    
    function 
existe_entrada($seccion$nombre=null)
    {
        if (! isset(
$nombre)) {
            return isset(
$this->entradas[$seccion]);
        } else {
            return isset(
$this->entradas[$seccion][$nombre]);
        }
    }

    function 
agregar_entrada($nombre$datos)
    {
        
$this->entradas$nombre ] = $datos;
    }

    function 
eliminar_entrada$nombre )
    {
        if ( isset( 
$this->entradas$nombre ] ) ) {
            unset( 
$this->entradas$nombre ] );
        } else {
            throw new 
toba_error("La entrada '$nombre' no existe");
        }
    }

    function 
get_datos_entrada$nombre 
    {
        if ( isset( 
$this->entradas$nombre ] ) ) {
            return 
$this->entradas$nombre ];
        } else {
            throw new 
toba_error("La entrada '$nombre' no existe en '{$this->path}'");
        }
    }

    function 
get($seccion$clave=null$defecto=null$obligatorio=true)
    {
        if(isset(
$clave) && isset($this->entradas[$seccion][$clave])) {
            return 
$this->entradas[$seccion][$clave];
        }
        if (! isset(
$clave) && isset($this->entradas[$seccion])) {
            return 
$this->entradas[$seccion];
        }
        if (
$obligatorio) {
            throw new 
toba_error("No se encuentra definido el parámetro '$seccion$clave en {$this->path}");
        } else {
            return 
$defecto;
        }
    }
    
    function 
set_datos_entrada$nombre$datos 
    {
        if ( isset( 
$this->entradas$nombre ] ) ) {
            
$this->entradas$nombre ] = $datos;
        } else {
            throw new 
toba_error("La entrada '$nombre' no existe");
        }
    }

    
//-----------------------------------------------------------
    //    Generacion
    //-----------------------------------------------------------

    
function guardar$archivo null )
    {
        if ( ! isset( 
$archivo ) ) {
            if ( ! isset( 
$this->path ) )  {
                throw new 
toba_error('Es necesario especificar el PATH del INI que se desea generar');    
            } else {
                
$archivo $this->path;    
            }
        }
        
file_put_contents($archivo$this->generar_ini() );
    }

    private function 
generar_ini()
    {
        
$ini "";
        if ( isset( 
$this->titulo ) ) {
            
$ini .= "; $this->titulo \n";
            
$ini .= "\n";
        }
        
// Secciones
        
foreach ( $this->entradas as $nombre => $datos ) {
            if ( 
is_array$datos ) ) {
                
$ini .= "\n";
                
$ini .= "[$nombre]\n";
                foreach ( 
$datos as $directiva => $valor ) {
                    
$ini .= "$directiva = \"$valor\"\n";
                }

            } else {
                
$ini .= "$nombre = \"$datos\"\n";
            }
        }
        return 
$ini;    
    }
}
?>

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