OXIESEC PANEL
- Current Dir:
/
/
usr
/
share
/
php
/
Composer
/
Repository
/
Pear
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/20/2024 06:32:22 AM
rwxr-xr-x
📄
BaseChannelReader.php
2.47 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
ChannelInfo.php
1.19 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
ChannelReader.php
3.14 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
ChannelRest10Reader.php
4.73 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
ChannelRest11Reader.php
4 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
DependencyConstraint.php
1.22 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
DependencyInfo.php
1.15 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
PackageDependencyParser.php
10.65 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
PackageInfo.php
2.07 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
ReleaseInfo.php
1 KB
01/31/2018 03:28:18 PM
rw-r--r--
Editing: BaseChannelReader.php
Close
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Repository\Pear; use Composer\Util\RemoteFilesystem; /** * Base PEAR Channel reader. * * Provides xml namespaces and red * * @author Alexey Prilipko <palex@farpost.com> */ abstract class BaseChannelReader { /** * PEAR REST Interface namespaces */ const CHANNEL_NS = 'http://pear.php.net/channel-1.0'; const ALL_CATEGORIES_NS = 'http://pear.php.net/dtd/rest.allcategories'; const CATEGORY_PACKAGES_INFO_NS = 'http://pear.php.net/dtd/rest.categorypackageinfo'; const ALL_PACKAGES_NS = 'http://pear.php.net/dtd/rest.allpackages'; const ALL_RELEASES_NS = 'http://pear.php.net/dtd/rest.allreleases'; const PACKAGE_INFO_NS = 'http://pear.php.net/dtd/rest.package'; /** @var RemoteFilesystem */ private $rfs; protected function __construct(RemoteFilesystem $rfs) { $this->rfs = $rfs; } /** * Read content from remote filesystem. * * @param $origin string server * @param $path string relative path to content * @throws \UnexpectedValueException * @return \SimpleXMLElement */ protected function requestContent($origin, $path) { $url = rtrim($origin, '/') . '/' . ltrim($path, '/'); $content = $this->rfs->getContents($origin, $url, false); if (!$content) { throw new \UnexpectedValueException('The PEAR channel at ' . $url . ' did not respond.'); } return str_replace('http://pear.php.net/rest/', 'https://pear.php.net/rest/', $content); } /** * Read xml content from remote filesystem * * @param $origin string server * @param $path string relative path to content * @throws \UnexpectedValueException * @return \SimpleXMLElement */ protected function requestXml($origin, $path) { // http://components.ez.no/p/packages.xml is malformed. to read it we must ignore parsing errors. $xml = simplexml_load_string($this->requestContent($origin, $path), "SimpleXMLElement", LIBXML_NOERROR); if (false === $xml) { throw new \UnexpectedValueException(sprintf('The PEAR channel at ' . $origin . ' is broken. (Invalid XML at file `%s`)', $path)); } return $xml; } }