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


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

namespace rest\lib;


use 
rest\rest;

class 
modelo_recursos {


    
/**
     * Recibe un arreglo de modelos
     * @param $models
     * @return array
     */
    
public function to_swagger($models)
    {
        
$out = array();
        foreach (
$models as $id_modelo =>$m) {
            
$nuevo $this->to_swagger_modelo($id_modelo$m);

            
$out[$id_modelo] = $nuevo;
        }
        return 
$out;
    }


    protected function 
to_swagger_modelo($id$modelo_in)
    {
        
$required = array();
        
$properties = array();

        foreach (
$modelo_in as $campo => $def) {
            
$this->get_property($properties$campo$def);
        }

//        $required[] = $campo;
        
return $nuevo = array(
            
'id' => $id,
            
'required' => array_values($required),
            
'properties' => $properties
        
);
    }


    protected function 
get_property(&$properties$campo$def)
    {
        
$property = array();
        if(
is_numeric($campo)){ //solo el campo  0=> nombre
            
$campo $def;
            
$def = array();
        }

        
//TODO, hacer mas modelos para representar estos subrecursos?
        
if(isset($def['_compuesto'])){
            
$def = array('type' => $campo); //lo muestro asi por ahora
        
}

        
//    Defaults para los campos
        
if (!isset($def['type'])) {
            
$def['type'] = 'string';
        }

        
//paso derecho los campos no especiales
        
foreach ($def as $k => $campo_def) {
            if (
strpos($k'_') !== 0) {
                
$property[$k] = $campo_def;
            }
        }
        
$properties[$campo] = $property;
    }
}

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