403Webshell
Server IP : 68.178.247.200  /  Your IP : 216.73.216.14
Web Server : Apache
System : Linux p3plzcpnl489463.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : x9dppmxs4rgd ( 8559391)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/x9dppmxs4rgd/public_html/wp-content/plugins/wpide/PHP-Parser/lib/PHPParser/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/x9dppmxs4rgd/public_html/wp-content/plugins/wpide/PHP-Parser/lib/PHPParser/Template.php
<?php

class PHPParser_Template
{
    protected $parser;
    protected $template;

    /**
     * Creates a new code template from a template string.
     *
     * @param PHPParser_Parser $parser   A parser instance
     * @param string           $template The template string
     */
    public function __construct(PHPParser_Parser $parser, $template) {
        $this->parser   = $parser;
        $this->template = $template;
    }

    /**
     * Get the statements of the template with the passed in placeholders
     * replaced.
     *
     * @param array $placeholders Placeholders
     *
     * @return PHPParser_Node[] Statements
     */
    public function getStmts(array $placeholders) {
        return $this->parser->parse(
            $this->getTemplateWithPlaceholdersReplaced($placeholders)
        );
    }

    protected function getTemplateWithPlaceholdersReplaced(array $placeholders) {
        if (empty($placeholders)) {
            return $this->template;
        }

        return strtr($this->template, $this->preparePlaceholders($placeholders));
    }

    /*
     * Prepare the placeholders for replacement. This means that
     * a) all placeholders will be surrounded with __.
     * b) ucfirst/lcfirst variations of the placeholders are generated.
     *
     * E.g. for an input array of ['foo' => 'bar'] the result will be
     * ['__foo__' => 'bar', '__Foo__' => 'Bar'].
     */
    protected function preparePlaceholders(array $placeholders) {
        $preparedPlaceholders = array();

        foreach ($placeholders as $name => $value) {
            $preparedPlaceholders['__' . $name . '__'] = $value;

            if (ctype_lower($name[0])) {
                $ucfirstName = ucfirst($name);
                if (!isset($placeholders[$ucfirstName])) {
                    $preparedPlaceholders['__' . $ucfirstName . '__'] = ucfirst($value);
                }
            }

            if (ctype_upper($name[0])) {
                $lcfirstName = lcfirst($name);
                if (!isset($placeholders[$lcfirstName])) {
                    $preparedPlaceholders['__' . $lcfirstName . '__'] = lcfirst($value);
                }
            }
        }

        return $preparedPlaceholders;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit