GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - phpbrew/PEARX: PEAR Channel Library (This library doesn't depend on PEAR)

BranchesTags
Open more actions menu

Latest commit

 

History

120 Commits
120 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src/PEARX
src/PEARX
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
Doxyfile
Doxyfile
 
 
README.md
README.md
 
 
build.xml
build.xml
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
package.ini
package.ini
 
 
package.xml
package.xml
 
 
phpdox.xml
phpdox.xml
 
 
phprelease.ini
phprelease.ini
 
 
phpunit-ci.xml
phpunit-ci.xml
 
 
phpunit.xml
phpunit.xml
 
 

Repository files navigation

PEARX

PEARX - A Non-PEAR-Dependent PEAR library for PHP 5.3 (PSR-0 compliance)

Features:

  • Package XML parser.
  • Package XML builder.
  • Package XML installer.
  • Faster than the original PEAR code.
  • Can run without PEAR dependency.
  • Support Cache.
  • PSR-0 compliance.

Install

$ git clone https://github.com/phpbrew/PEARX.git
$ cd PEARX
$ onion bundle
$ sudo pear install -f package.xml

Synopsis

Channel operations:

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');
    }
}

To use PEARX with Cache and CurlDownlaoder

<?php
    $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,
    ));

Parsing Package XML:

    $parser = new PEARX\PackageXml\Parser;

    $package = $parser->parse($file);
    ok($package->getName());
    ok($package->getChannel());
    ok($package->getDate());
    ok($package->getTime());
    ok($package->getDateTime() );

    /* ContentFile objects */
    $contents = $package->getContents();
    ok($contents);

    foreach( $contents as $content ) {
        ok($content->file);
        ok($content->role);
    }

    $filelist = $package->getInstallFileList();
    foreach( $filelist as $install ) {
        ok($install->from);
        ok($install->to);
    }

About

PEAR Channel Library (This library doesn't depend on PEAR)

Topics

pearphp

Resources

Readme
Activity
Custom properties

Stars

9 stars

Watchers

7 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.