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


Viewing file:     Generator.php (5 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Additional tools for HTML_Template_PHPLIB
 *
 * PHP Versions 4 and 5
 *
 * @category HTML
 * @package  HTML_Template_PHPLIB
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
 * @version  CVS: $Id$
 * @link     http://pear.php.net/package/HTML_Template_PHPLIB
 */
require_once 'HTML/Template/PHPLIB/Helper.php';

/**
* Generates code to be used with templates
*
* @category HTML
* @package  HTML_Template_PHPLIB
* @author   Christian Weiske <cweiske@php.net>
* @license  http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link     http://pear.php.net/package/HTML_Template_PHPLIB
*/
class HTML_Template_PHPLIB_Generator
{

    
/**
    * Creates the code to use a given template file
    *
    * @param string $strFile    Template file
    * @param string $strTplName Template reference name
    * @param string $strPrefix  Prefix to prepend before the code
    *
    * @return string PHP code
    */
    
function getCodeBlockDefinition(
        
$strFile$strTplName null$strPrefix '$tpl'
    
) {
        
$arBlocks HTML_Template_PHPLIB_Generator::getBlocks(
            
HTML_Template_PHPLIB_Helper::getLines($strFile)
        );

        if (
$strTplName === null) {
            
$strTplName
                
HTML_Template_PHPLIB_Generator::getTemplateNameFromFilename(
                    
$strFile
                
);
        }

        
$nl    "\r\n";
        
$code  '';
        
$code .= $strPrefix ' = new HTML_Template_PHPLIB();' $nl;
        
$code .= HTML_Template_PHPLIB_Generator::getCodeBlock(
            
$arBlocks$strTplName$strPrefix
        
);
        
$code .= $nl;
        
$code .= '//TODO: do something with the code' $nl;
        
$code .= $nl;

        
$code .= $strPrefix '->finish('
            
trim($strPrefix) . "->parse('TMP', '" $strTplName "'));"
            
$nl;

        return 
$code;
    }
//function getCodeBlockDefinition($strFile, $strTplName = null, ..)



    /**
    * Creates the PHP code for the given array of blocks.
    *
    * @param array  $arBlocks   Array of blocks, see getBlocks()
    * @param string $strTplName Template reference name
    * @param string $strPrefix  Prefix to prepend before the code
    *
    * @return string PHP code
    */
    
function getCodeBlock($arBlocks$strTplName$strPrefix '$tpl')
    {
        
$nl   "\r\n";
        
$code '';
        foreach (
$arBlocks as $arBlock) {
            if (
count($arBlock['sub']) > 0) {
                
$code .= HTML_Template_PHPLIB_Generator::getCodeBlock(
                    
$arBlock['sub'], $strTplName$strPrefix
                
);
            }
            
$code .= $strPrefix "->setBlock('" $strTplName "','"
                    
$arBlock['name'] . "', '"
                    
$arBlock['name'] . "_ref');" $nl;
        }

        return 
$code;
    }
//function getCodeBlock($arBlocks, $strTplName, $strPrefix = '$tpl')



    /**
    * Returns an array of blocks in the given template code.
    * The array values are array with a key "name" and
    *  "sub", an array of nested blocks.
    *
    * @param array $arLines Template code lines
    *
    * @return array Array of blocks
    *
    * @static
    */
    
function getBlocks($arLines)
    {
        
$arBlocks = array();
        
$arRefs   = array();
        
$strRegex '/<!--\s+(BEGIN|END)\s+([a-zA-Z0-9_]*)\s+-->/';
        foreach (
$arLines as $strLine) {
            
$arMatches = array();
            if (!
preg_match($strRegex$strLine$arMatches)) {
                continue;
            }
            
$strType      $arMatches[1];
            
$strBlockName $arMatches[2];
            if (
$strType == 'BEGIN') {
                
$arBlock = array(
                    
'name' => $strBlockName,
                    
'sub'  => array()
                );
                if (
count($arRefs) == 0) {
                    
$arBlocks[$arBlock['name']] = $arBlock;
                    
$arRefs[$strBlockName]      = &$arBlocks[$arBlock['name']];
                } else {
                    
end($arRefs);
                    
$strOldBlock key($arRefs);

                    
$arRefs[$strOldBlock]['sub'][$strBlockName] = $arBlock;
                    
$arRefs[$strBlockName]
                        =& 
$arRefs[$strOldBlock]['sub'][$strBlockName];
                }
            } else {
                unset(
$arRefs[$strBlockName]);
            }
        }

        return 
$arBlocks;
    }
//function getBlocks($arLines)



    /**
    * Creates a name that can be used as handle for a template,
    *  from the given file name.
    *
    * @param string $strFile File name
    *
    * @return string Template name
    */
    
function getTemplateNameFromFilename($strFile)
    {
        
$strTplName basename($strFile);
        
//remove extension
        
$nDotPos strpos($strTplName'.');
        if (
$nDotPos !== false) {
            
$strTplName substr($strTplName0$nDotPos);
        }

        return 
$strTplName;
    }
//function getTemplateNameFromFilename($strFile)

}//class HTML_Template_PHPLIB_Generator

?>

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