File manager - Edit - /home/opticamezl/www/newok/Xml.php.tar
Back
home/opticamezl/www/newok/libraries/regularlabs/src/Xml.php 0000604 00000002736 15172671640 0020146 0 ustar 00 <?php /** * @package Regular Labs Library * @version 25.7.12430 * * @author Peter van Westen <info@regularlabs.com> * @link https://regularlabs.com * @copyright Copyright © 2025 Regular Labs All Rights Reserved * @license GNU General Public License version 2 or later */ namespace RegularLabs\Library; defined('_JEXEC') or die; use SimpleXMLElement; class Xml { /** * Get an object filled with data from an xml file */ public static function toObject(string $url, string $root = ''): object { $cache = new \RegularLabs\Library\Cache(); if ($cache->exists()) { return $cache->get(); } if (!str_contains($url, '<') && file_exists($url)) { $xml = @new SimpleXMLElement($url, \LIBXML_NONET | \LIBXML_NOCDATA, 1); } else { $xml = simplexml_load_string($url, "SimpleXMLElement", \LIBXML_NONET | \LIBXML_NOCDATA); } if (!@count($xml)) { return $cache->set((object) []); } if ($root) { if (!isset($xml->{$root})) { return $cache->set((object) []); } $xml = $xml->{$root}; } $json = json_encode($xml); $xml = json_decode($json); if (is_null($xml)) { $xml = (object) []; } if ($root && isset($xml->{$root})) { $xml = $xml->{$root}; } return $cache->set($xml); } } home/opticamezl/www/newok/libraries/src/Application/CLI/Output/Xml.php 0000644 00000002151 15174041720 0022000 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Application\CLI\Output; use Joomla\CMS\Application\CLI\CliOutput; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Output handler for writing command line output to the stdout interface * * @since 4.0.0 * * @deprecated 4.3 will be removed in 6.0 * Use the `joomla/console` package instead */ class Xml extends CliOutput { /** * Write a string to standard output. * * @param string $text The text to display. * @param boolean $nl True (default) to append a new line at the end of the output string. * * @return $this * * @since 4.0.0 * @throws \RuntimeException * @codeCoverageIgnore */ public function out($text = '', $nl = true) { fwrite(STDOUT, $text . ($nl ? "\n" : null)); return $this; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings