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


Viewing file:     ci_comparador.php (2.92 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require_once(toba_dir() . '/php/3ros/cssparser.php');
//----------------------------------------------------------------
class ci_comparador extends toba_ci
{
    protected 
$estilos;
    protected 
$contenidos = array();
    protected 
$analisis;
    
    function 
mantener_estado_sesion()
    {
        
$propiedades parent::mantener_estado_sesion();
        
$propiedades[] = 'estilos';
        return 
$propiedades;
    }

    function 
get_contenido($estilo)
    {
        if (!isset(
$this->contenidos[$estilo])) {
            
$candidato toba::instalacion()->get_path()."/www/css/$estilo.css";
            if (
file_exists($candidato)) {
                
$archivo $candidato;
            } else {
                
//Si el archivo no esta en toba, esta en algun proyecto    
                
$proyectos toba_info_instancia::get_proyectos_con_estilo($estilo);
                foreach (
$proyectos as $proyecto) {
                    
$pro $proyecto['proyecto'];
                    
$candidato toba::instancia()->get_path_proyecto($pro)."/www/css/$estilo.css";
                    if (
file_exists($candidato)) {
                        
$archivo $candidato;
                    }
                }
            }
            if (! isset(
$archivo)) {
                throw new 
toba_error("No se encuentra el archivo del estilo $estilo");
            }
            
$this->contenidos[$estilo] = file_get_contents($archivo);
        }
        return 
$this->contenidos[$estilo];
    } 
    
    function 
obtener_estilos($plantilla)
    {
        
$css = new cssparser();
        @
$css->ParseStr($plantilla);
        
$res array_unique(array_keys($css->css));
        
sort($res);
        return 
$res;
    }
    
    function 
analizar_diferencias()
    {
        if (isset(
$this->analisis)) {
            return;    
        }    
        
$est_origen $this->obtener_estilos($this->get_contenido($this->estilos['origen']));
        
$est_destino $this->obtener_estilos($this->get_contenido($this->estilos['destino']));
        
$this->analisis = array('faltantes' => array(), 'sobrantes' => array());
        
//Busca los estilos faltantes
        
foreach ($est_origen as $estilo) {
            if (!
in_array($estilo$est_destino)) {
                
$this->analisis['faltantes'][] = array('estilo'=>$estilo);
            }
        }
        
//Busca la estilos sobrantes
        
foreach ($est_destino as $estilo) {
            if (!
in_array($estilo$est_origen)) {
                
$this->analisis['sobrantes'][] = array('estilo'=>$estilo);    
            }
        }
        
    }

    
//-------------------------------------------------------------------
    //--- Eventos
    //-------------------------------------------------------------------

    //----------------------------- archivos -----------------------------
    
function conf__archivos()
    {
        if (isset(
$this->estilos)) {
            return 
$this->estilos;    
        }
    }

    function 
evt__archivos__modificacion($registro)
    {
        
$this->estilos $registro;
        
$this->get_contenido($registro['origen']);
        
$this->get_contenido($registro['destino']);        
    }

    
    
//------------------------------ faltantes -----------------------------------
    
function conf__faltantes()
    {
        
$this->analizar_diferencias();
        return 
$this->analisis['faltantes'];
    }
    
    
//------------------------------ sobrantes -----------------------------------
    
function conf__sobrantes()
    {
        
$this->analizar_diferencias();
        return 
$this->analisis['sobrantes'];
    }    
    
}

?>

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