1. Go to this page and download the library: Download corneltek/pearx library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
corneltek / pearx example snippets
use CacheKit\FileSystemCache;
$channel = new PEARX\Channel($host);
// find package from the remote pear host
$package = $channel->findPackage('PEAR');
// traverse pear channel categories
$categories = $channel->getCategories();
foreach( $categories as $category ) {
// $category->name
// $category->infoUrl
$packages = $category->getPackages();
foreach( $packages as $package ) {
$package->name;
$package->summary;
$package->desc;
$package->channel;
$package->license;
$package->deps;
$package->releases;
$package->stable; // version string
$package->alpha; // version string
$package->latest; // version string
$stability = $package->getRelease('0.0.1');
}
}
$cache = new CacheKit\FileSystemCache(array(
'expiry' => 60 * 30, // 30 minutes
'cache_dir' => '/tmp/cache',
));
$d = new CurlDownloader;
$d->setProgressHandler( new \CurlKit\ProgressBar );
$channel = new PEARX\Channel($host, array(
'cache' => $cache,
'downloader' => $d,
));