GithubHelp home page GithubHelp logo

pyrus's Introduction

Pyrus is the package manager and installer for PHP 5.3 or newer

Pyrus provides the means to install and manage installations for
packages built using package.xml version 2.0 or newer.  Pyrus is
redesigned from the ground up for PHP 5.3 or newer, and provides
significant improvements over the older PEAR Installer.

To use Pyrus, you can download pyrus.phar from the PEAR2 website,
and execute it from the command line:
$ php pyrus.phar install PEAR2_Templates_Savant-alpha

You can also install PEAR2_Pyrus to access the API for installing
and managing packages. Once installed, a convenience script is
available from the command line.
$ pyrus install PEAR2_Templates_Savant-alpha

For more information, view the documentation at:
http://pear.php.net/manual/en/pyrus.php

pyrus's People

Contributors

addiks avatar boekkooi avatar boenrobot avatar cellog avatar clockwerx avatar cweiske avatar flavius avatar fpoirotte avatar harikt avatar helgi avatar jeichorn avatar mfonda avatar saltybeagle avatar till avatar tyrael avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyrus's Issues

\tests\Config\loadConfigFile

Description:

All tests in Pyrus\tests\Config\loadConfigFile directory fail on windows.
The reason for this is that Pyrus\Config class is not converting the *_dir config options to use DIRECTORY_SEPARATOR.

Test script:

Run:
php scripts/pyrus run-phpt -r

Expected result:

===DONE===

Actual result:

Test Failure: "__dir"
in D:\workspace\pear2\all\Pyrus\tests\Config\loadConfigFile_.php line *
Expecting:
'D:\workspace\pear2\all\Pyrus\tests\Config\loadConfigFile\testit\boo'
Received:
'D:\workspace\pear2\all\Pyrus\tests\Config\loadConfigFile\testit/boo'

C compiler cannot create executables

Trying to compile xdebug fails with "C compiler cannot create executables", although manually running the command works.

root@elysium: ~/xdebug-2.1.0> pyrus-5.3.5 build pecl/xdebug
Pyrus version 2.0.0a2 SHA-1: CA3946A5C2C7DE7CD6ED89CAC7CCC06606E006D3
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.5/pear
Building PECL extensions
PHP Notice:  Undefined property: PEAR2\Pyrus\PECLBuild::$current_callback in phar:///opt/phpfarm/inst/php-5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/PECLBuild.php on line 474

Notice: Undefined property: PEAR2\Pyrus\PECLBuild::$current_callback in phar:///opt/phpfarm/inst/php-5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/PECLBuild.php on line 474
WARNING: php_bin /opt/phpfarm/inst/php-5.3.5/bin/php appears to have a suffix farm/inst/php-5.3.5/bin/php, but config variable php_suffix does not match
cleaning build directory /opt/phpfarm/inst/php-5.3.5/pear/src/xdebug
running: /opt/phpfarm/inst/php-5.3.5/bin/phpize --clean 2>&1
Cleaning..
building in /opt/phpfarm/inst/php-5.3.5/pear/src/xdebug
running: /opt/phpfarm/inst/php-5.3.5/bin/phpize 2>&1
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
building in /opt/phpfarm/inst/php-5.3.5/pear/src/xdebug
running: /opt/phpfarm/inst/php-5.3.5/pear/src/xdebug/configure --with-php-config=/opt/phpfarm/inst/php-5.3.5/bin/php-config 2>&1
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
PEAR2\Pyrus\PECLBuild\Exception: `/opt/phpfarm/inst/php-5.3.5/pear/src/xdebug/configure --with-php-config=/opt/phpfarm/inst/php-5.3.5/bin/php-config' failed

Improve check to see if channel must be updated

(Migrated from pearweb request #17349)

Description:

pear currently checks the status using the Last-Modified: header. It would be quite nice if another mechanism could be added.

The logical thing that comes to mind is a Content-MD5 header, but it might be a bit difficult for pear-servers such as Pirum (which is based on static files).

So perhaps the easiest thing is to just download the channel file if the last-modified header changed, and do an md5 locally to see if it's indeed the same as it was.

This, because many of the pear channels i use report they need an update-channel whenever a new version of a package is added.

[Feature Req.] Set settings for a specific channel

Pyrus supports channel-specific settings as mentionned on http://pear.php.net/manual/en/pyrus.configuration.user.php, but it seems there is currently no way to set such settings apart from manually editting ~/.pear/pearconfig.xml.

Hence, what I propose is to add an option to allow the channel to be specified. I also suggest to use -c / --channel to make it coherent with pear (see pear help config-set).
Eg.
$ php pyrus.phar set -c pear.php.net handle Clicky
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /tmp/foo
Setting handle for channel pear.php.net in /home/clicky/.pear/pearconfig.xml

(I also slightly changed the last message to make it obvious what channel was impacted by the command)

pyrus list -v should show which channels are checked

When running

$ pyrus list
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.7/pear
Listing installed packages [/opt/phpfarm/inst/php-5.3.7/pear]:
$

I get no packages show, because none are installed. I'd like to check if really all channels are checked, so I tried -v, but that didn't change anything.

IMO passing -v should produce similare output to list-upgrades

./inst/bin/pyrus-5.3.7 lu
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.7/pear
(no packages installed in channel __uri)
(no packages installed in channel doc.php.net)
(no packages installed in channel pear.php.net)
(no packages installed in channel pear2.php.net)
(no packages installed in channel pecl.php.net)

download progressbar does not vanish

It seems the download progressbar is kept in the console, leading to unpretty output:

christian.weiske@cyberdyne:~/aida/fileadmin$ /opt/phpfarm/inst/php-5.3.6/bin/php /opt/phpfarm/inst/php-5.3.6/pyrus.phar ./pear2 install pear/xml_serializer-beta
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/netresearch/elysium-www/www.aida.de/cwe/fileadmin/pear2
Downloading pear.php.net/XML_Serializer

Connected...
Mime-type: application/octet-stream

Downloading pear.php.net/XML_Parser==============================================================>   ] 96% (33/34 kb)
Connected...
Mime-type: application/octet-stream

Installed pear.php.net/XML_Serializer-0.20.2=================================================>       ] 92% (14/15 kb)
Installed pear.php.net/XML_Parser-1.3.4

Display where plugins are loaded from

When a user executes pyrus from CLI, it would be helpful to:

  • notify the user when additional commands are being loaded (security)
  • inform what the plugin directory is, just in case a plugin blows up and needs removing

This also will help developers that are trying to work on plugins and aren't aware that they have a version of their plugin installed already. Could be only shown when verbosity, -v is increased.

symlinks are broken after install

Pyrus defaults the bin_dir to /usr/bin.

The transactional part of installing a package breaks when handling symlinks present in /usr/bin on Ubuntu systems. This leaves the /usr/bin dir in an inconsistent state.

building pecl/xdebug gives warnings and notices

Error:

root@elysium: ~/xdebug-2.1.0> pyrus-5.3.5 build pecl/xdebug
Pyrus version 2.0.0a2 SHA-1: CA3946A5C2C7DE7CD6ED89CAC7CCC06606E006D3
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.5/pear
Building PECL extensions
PHP Notice:  Undefined property: PEAR2\Pyrus\PECLBuild::$current_callback in phar:///opt/phpfarm/inst/php-5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/PECLBuild.php on line 474

    
Notice: Undefined property: PEAR2\Pyrus\PECLBuild::$current_callback in phar:///opt/phpfarm/inst/php-5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/PECLBuild.php on line 474
WARNING: php_bin /opt/phpfarm/inst/php-5.3.5/bin/php appears to have a suffix farm/inst/php-5.3.5/bin/php, but config variable php_suffix does not match

generate-ext gives warnings

$ pyrus generate-ext xhprof
Using PEAR installation found at /Users/bbieber/pear
PHP Warning: file_get_contents(/config.m4): failed to open stream: No such file or directory in /Users/bbieber/Documents/workspace/PEAR2_Pyrus_Developer/src/PEAR2/Pyrus/Developer/PackageFile/Commands.php on line 795
...

build xdebug: undefined property

root@elysium: ~/xdebug> /opt/phpfarm/inst/bin/pyrus-5.3.6 build pecl/xdebug
Pyrus version 2.0.0a1 SHA-1: 2FDFB5E00A6D707437DBC047AAF9D115C6484D90
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.6/pear
Building PECL extensions
PHP Notice: Undefined property: pear2\Pyrus\PECLBuild::$current_callback in phar:///opt/phpfarm/inst/php-5.3.6/pyrus.phar/PEAR2_Pyrus-2.0.0a1/php/pear2/Pyrus/PECLBuild.php on line 470

Notice: Undefined property: pear2\Pyrus\PECLBuild::$current_callback in phar:///opt/phpfarm/inst/php-5.3.6/pyrus.phar/PEAR2_Pyrus-2.0.0a1/php/pear2/Pyrus/PECLBuild.php on line 470
WARNING: php_bin /opt/phpfarm/inst/php-5.3.6/bin/php appears to have a suffix farm/inst/php-5.3.6/bin/php, but config variable php_suffix does not match

installing mime_type fails: Unable to begin transaction

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . install pear/mime_type
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
Downloading pear.php.net/MIME_Type

Connected...
Mime-type: application/octet-stream

Downloading pear.php.net/PEAR==============================================================>         ] 90% (10/11 kb)
Connected...
Mime-type: application/octet-stream

Downloading pear.php.net/Archive_Tar================================================================>] 99% (287/288 kb)
Connected...
Mime-type: application/octet-stream

Downloading pear.php.net/Structures_Graph=====================================================>      ] 93% (16/17 kb)
Connected...
Mime-type: application/octet-stream

Downloading pear.php.net/Console_Getopt==========================================================>   ] 96% (28/29 kb)
Downloading pear.php.net/XML_Util
Connected...
Mime-type: application/octet-stream

PEAR2\Pyrus\Installer\Exception: Installation failed==========================================>      ] 93% (16/17 kb)
 PEAR2\Pyrus\AtomicFileTransaction\MultiException: Unable to begin transaction
  PEAR2\Pyrus\IOException: unrecoverable transaction error: cannot create journal path /opt/phpfarm/src/../inst/php-5.3.6/.journal-bin
   PEAR2\Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction

Installation data folder wrong

Description:

When installing PEAR2_Pyrus the data for the data folder is installed in the wrong location.

Test script:

Create a new registry:
php pyrus.phar <registry_location> install PEAR2_Pyrus
php pyrus.phar <registry_location> list-channels

Goto:
<registry_location>\data\PEAR2_Pyrus\pear2.php.net\PEAR2_Pyrus\pear2.php.net

Expected result:

Data files should be placed in:
<registry_location>\data\PEAR2_Pyrus\pear2.php.net\

Actual result:

Data files are placed in:
<registry_location>\data\PEAR2_Pyrus\pear2.php.net\PEAR2_Pyrus\pear2.php.net

Allow skipping package signatures

There should be an option to ignore package signatures. There currently exists an issue with the certificate of components.ez.no/ConsoleTools. When Pyrus tries to download it's certificate it fails, but components.ez.no does a 302 redirect to the front page. Pyrus downloads the front page and dies with an exception saying that the certificate is invalid. A simple thing like this currently makes all of PHPUnit uninstallable using Pyrus.

php pyrus.phar install pear.phpunit.de/PHPUnit
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/sander/tmp/pear
Downloading pear.phpunit.de/PHPUnit

Connected...

Downloading pear.phpunit.de/DbUnit
Connected...

Downloading pear.phpunit.de/File_Iterator
Connected...

Downloading pear.phpunit.de/Text_Template
Connected...

Downloading pear.phpunit.de/PHP_CodeCoverage
Connected...

Downloading pear.phpunit.de/PHP_TokenStream
Connected...

Downloading components.ez.no/ConsoleTools
PEAR2\Pyrus\Package\Exception: Invalid abstract package components.ez.no/ConsoleTools - releasing maintainer's certificate is not a certificate

download validates package

Installing a pecl package does not work because of an bug in it. Now I just wanted to download the package and fix it, but even when just downloading a package it validates the archive:

$ pyrus-5.3.5 download pecl/xdebug
Pyrus version 2.0.0a2 SHA-1: CA3946A5C2C7DE7CD6ED89CAC7CCC06606E006D3
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.5/pear
Downloading pecl/xdebug...
Connected...
Mime-type: application/octet-stream

failed! (Invalid package downloaded, package name changed from Xdebug to xdebug)=====================>] 100% (282/282 kb)

Expected result:

I want a downloaded file that I can fix. Pyrus should not verify it.

php pyrus.phar make failing

Just downloaded PEAR2_Pyrus 2.0.0a2 from pear2.php.net and generates an exception when trying to make a package.xml for Math_Trigonometry using:

  • php ~/Downloads/pyrus.phar make

I got the devel tools installed.

Here is a stack trace using xdebug:

Pyrus version 2.0.0a2 SHA-1: CA3946A5C2C7DE7CD6ED89CAC7CCC06606E006D3
Using PEAR installation found at /home/jesus/devel/pear2packages
Creating package.xml...PHP PEAR2\Pyrus\PackageFile\Exception: Invalid package.xml, does not validate against schema in phar:///home/jesus/Downloads/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/PackageFile/v2/Validator.php on line 98
PHP Stack trace:
PHP 1. {main}() /home/jesus/Downloads/pyrus.phar:0
PHP 2. PEAR2\Pyrus\ScriptFrontend\Commands->run($args = array (0 => 'make')) /home/jesus/Downloads/pyrus.phar:52
PHP 3. PEAR2\Pyrus\Developer\PackageFile\Commands->makePackageXml($frontend = class PEAR2\Pyrus\ScriptFrontend\Commands { public $commands = array (); protected $verbose = '1'; protected $term = array ('bold' => '\033[1m', 'normal' => '\033[m') }, $args = array ('packagename' => NULL, 'channel' => NULL, 'dir' => NULL), $options = array ('nocompatible' => NULL, 'packagexmlsetup' => NULL, 'scanoptions' => NULL, 'package' => NULL, 'stub' => NULL, 'extrasetup' => NULL, 'help' => NULL)) phar:///home/jesus/Downloads/pyrus.phar/PEAR2_Pyrus-2.0.0a2/php/PEAR2/Pyrus/ScriptFrontend/Commands.php:288
PHP 4. PEAR2\Pyrus\Developer\PackageFile\PEAR2SVN->__construct($path = '/home/jesus/devel/git/github/Math_Trigonometry', $packagename = NULL, $channel = 'pear2.php.net', $return = FALSE, $fullpathsused = TRUE, $doCompatible = TRUE, $scanoptions = array ()) /home/jesus/.pear/php/PEAR2/Pyrus/Developer/PackageFile/Commands.php:52
PHP 5. PEAR2\Pyrus\Developer\PackageFile\PEAR2SVN->validate() /home/jesus/.pear/php/PEAR2/Pyrus/Developer/PackageFile/PEAR2SVN.php:101
PHP 6. PEAR2\Pyrus\PackageFile\v2\Validator->validate($pf = class PEAR2\Pyrus\Package { protected $internal = class PEAR2\Pyrus\Package\Xml { protected $archive = '/home/jesus/devel/git/github/Math_Trigonometry/package.xml'; protected $packagefile = class PEAR2\Pyrus\PackageFile { ... }; protected $from = ... }; protected $from = NULL; protected $saveAsPackage2_xml = FALSE }, $state = uninitialized) /home/jesus/.pear/php/PEAR2/Pyrus/Developer/PackageFile/PEAR2SVN.php:419
PEAR2\Pyrus\PackageFile\Exception: Invalid package.xml, does not validate against schema
PEAR2\Pyrus\PackageFile\Exception: Line 3: Element '{http://pear.php.net/dtd/package-2.1}channel': This element is not expected. Expected is ( {http://pear.php.net/dtd/package-2.1}name ).

Pear1 - could not create Dependency lock file

Description:

run phpt on all\Pyrus\tests\Registry\Pear1 directory.

Test script:

php scripts/pyrus run-phpt tests\Registry\Pear1\package\basic\basic.phpt

Expected result:

=== DONE ===

Actual result:

Could not create Dependency lock file exception

package.xml basedir='./'

Description:

When i was trying to install a pear package from one of your local repositories i got the following exeption:
PEAR2\Pyrus\Installer\Exception: failed to mkdir Dmm_ZF.\Zend
PEAR2\Pyrus\AtomicFileTransaction\Exception: Unable to make directory Dmm_ZF.
Zend\ in D:\pear\testrepo.journal-data

Test script:

Create a package change the 'baseinstalldir' in the package.xml to "./".

Expected result:

A installed package.

Actual result:

PEAR2\Pyrus\Installer\Exception: failed to mkdir Dmm_ZF.\Zend
PEAR2\Pyrus\AtomicFileTransaction\Exception: Unable to make directory Dmm_ZF.
Zend\ in D:\pear\testrepo.journal-data

Add better message when bin_dir is not writeable

Currently if a package needs to use the bin_dir and it is not writeable pyrus fails with a cryptic message.

The message should be made better and should contain the command to set the bin dir.

Automatic creation of bundles (package + dependencies)

(Migrated from pearweb request #11101)

Description:

It would be great if Pyrus could automatically create a bundle of a package. This would include all direct and indirect dependencies.

I am doing this by hand, because such a bundle has some advantages:

  • Speed: I have an application with 40 dependencies (direct and indirect), install/upgrade with bundle takes a few seconds, with a normal package multiple minutes.
  • Flexibility: Installation is possible everywhere and everytime. For example on servers without direct internet access and even if pear.php.net is down.
  • Security: You can be sure that you have all dependencies (PHPUnit2-problem) and that they are the same on every installation.

AtomicFileTransaction rename bin_dir

Description:

When installing PEAR2_Pyrus the following exception occures:
'PEAR2\Pyrus\AtomicFileTransaction\Exception' with message 'Cannot rollback - not in a transaction' in E:\workspace\all\Pyrus\src\Pyrus\AtomicFileTransaction.php:535

This exception originates in AtomicFileTransaction.php line 655.
The reason for the exception is that it tries to rename 'C:\xampp.old-php' to 'C:\xampp\php' and this is not possible because php.exe is in use.

Maybe related to https://pear.php.net/bugs/bug.php?id=17195

Test script:

php scripts/pyrus e:\test
php scripts/pyrus e:\test set preferred_state alpha
php scripts/pyrus e:\test install PEAR2_Pyrus

Expected result:

  • A successful installation
    or
  • Better exception indicating that the bin_dir needs to be changed.

Actual result:

exception 'PEAR2\Pyrus\AtomicFileTransaction\Exception' with message 'Cannot rollback - not in a transaction' in E:\workspace\all\Pyrus\src\Pyrus\AtomicFileTransaction.php:535
Stack trace:
#0 E:\workspace\all\Pyrus\src\Pyrus\Installer.php(329): PEAR2\Pyrus\AtomicFileTransaction::rollback()
#1 E:\workspace\all\Pyrus\src\Pyrus\ScriptFrontend\Commands.php(482): PEAR2\Pyrus\Installer::commit()
#2 E:\workspace\all\Pyrus\src\Pyrus\ScriptFrontend\Commands.php(276): PEAR2\Pyrus\ScriptFrontend\Commands->install(Array, Array)
#3 E:\workspace\all\Pyrus\scripts\pyrus(37): PEAR2\Pyrus\ScriptFrontend\Commands->run(Array)
#4 {main}PEAR2\Pyrus\AtomicFileTransaction\Exception: Cannot rollback - not in a transaction

Pyrus does not respect XDG_CONFIG_HOME

(migrated from pearweb request #18381)

Description:

When Pyrus initializes, it creates an unsolicited directory $HOME/.pear/ instead of $HOME/.config/pear/
There's also no way to override that setting.

Home directory spamming was an established practice in the 90s. Meanwhile there is an agreed standard on where to put non-critical and non-system configuration files. $XDG_CONFIG_HOME or at the very least defaulting to $HOME/.config/

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Btw, its use is equivalent to %APPDATA% on Windows if I'm not mistaken.

Original command not executed after prompt to install developer tools

When attempting to execute a pyrus command that requires developer tools to be installed, and developer tools are not yet installed, pyrus will ask you if you would like to install them. Upon answering yes, they will be installed, but the original command will not be executed; you will have to run it again.

Example:

mfonda@mfonda:~/pear/pyrus_fun$ php pyrus.phar generate-pear2 DemoPackage
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/mfonda/pear/pyrus_fun
The "generate-pear2" command is in the developer tools.  Install developer tools?
Please choose:
  yes
  no
[no] : yes
Downloading pear2.php.net/PEAR2_Pyrus_Developer
Connected...
Installed pear2.php.net/PEAR2_Pyrus_Developer-0.4.0
mfonda@mfonda:~/pear/pyrus_fun$ ls
cache  pyrus.phar
mfonda@mfonda:~/pear/pyrus_fun$ php pyrus.phar generate-pear2 DemoPackage
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/mfonda/pear/pyrus_fun
Creating package.xml...done

installing pecl package: PHP Notice: Undefined variable: php_errormsg

I get the following message:

Installing '/usr/lib/php5/20090626/xdebug.so'
PHP Notice:  Undefined variable: php_errormsg in /home/cweiske/php/PEAR2_Pyrus/src/Pyrus/PECLBuild.php on line 88
PHP Stack trace:
PHP   1. {main}() /home/cweiske/php/PEAR2_Pyrus/scripts/pyrus:0
PHP   2. Pyrus\ScriptFrontend\Commands->run() /home/cweiske/php/PEAR2_Pyrus/scripts/pyrus:48
PHP   3. Pyrus\ScriptFrontend\Commands->build() /home/cweiske/php/PEAR2_Pyrus/src/Pyrus/ScriptFrontend/Commands.php:307
PHP   4. Pyrus\PECLBuild->installBuiltStuff() /home/cweiske/php/PEAR2_Pyrus/src/Pyrus/ScriptFrontend/Commands.php:931

install pecl/apc: constraint failed

$ ../inst/bin/pyrus-5.3.7 install pecl/apc
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/cweiske/php/phpfarm/inst/php-5.3.7/pear
Downloading pecl.php.net/APC

Connected...
Mime-type: application/octet-stream

PEAR2\Pyrus\Registry\Exception: Error: package pecl.php.net/APC could not be installed in registry: Unable to execute statement: constraint failed
 Exception: Unable to execute statement: constraint failed

Pyrus Install - No channel.xml

(Bug migrated from pearweb bug #17588)

Description:

\PEAR2\Pyrus\Config::singleton('d:\pear\testRepo') throws a 'Fatal error: Uncaught exception 'PEAR2\Pyrus\ChannelFile\Exception' with message 'Invalid channel.xml' in D:\pear\repo\php\PEAR2\Pyrus\ChannelFile\Parser\v1.php'.

It looks like when i create a new registry with the following command (this is not my main registry):
php pyrus.phar D:\pear\testRepo install PEAR2_autoload
No channel.xml is made.

Test script:

To reproduce:

  • Create a second registry:
    php pyrus.phar D:\pear\testRepo install PEAR2_autoload
  • Run code:

Expected result:

A \PEAR2\Pyrus\Config instance.

After runnings:
php pyrus.phar D:\pear\testRepo list-channels
All works like a charm.

Actual result:

Fatal error: Uncaught exception 'PEAR2\Pyrus\ChannelFile\Exception' with message 'Invalid channel.xml' in D:\pear\repo\php\PEAR2\Pyrus\ChannelFile\Parser\v1.php:34
Stack trace:
#0 D:\pear\repo\php\PEAR2\Pyrus\ChannelRegistry\Base.php(295): PEAR2\Pyrus\ChannelFile\Parser\v1->parse('D:\pear\repo\ph...', true)
#1 D:\pear\repo\php\PEAR2\Pyrus\ChannelRegistry\Base.php(265): PEAR2\Pyrus\ChannelRegistry\Base->getDefaultChannel('pear.php.net')
#2 D:\pear\repo\php\PEAR2\Pyrus\ChannelRegistry\Base.php(304): PEAR2\Pyrus\ChannelRegistry\Base->getPearChannel()
#3 D:\pear\repo\php\PEAR2\Pyrus\ChannelRegistry\Sqlite3.php(119): PEAR2\Pyrus\ChannelRegistry\Base->initDefaultChannels()
#4 D:\pear\repo\php\PEAR2\Pyrus\ChannelRegistry\Sqlite3.php(55): PEAR2\Pyrus\ChannelRegistry\Sqlite3->_init('D:\pear\testrep...', false)
#5 D:\pear\repo\php\PEAR2\Pyrus\ChannelRegistry.php(61): PEAR2\Pyrus\ChannelRegistry\Sqlite3->__construct('D:\pear\testrep...', false)
#6 D:\pear\repo\php\PEAR2\Pyrus\Registry.php(116): PEAR2\Pyrus\ChannelRegistry->__constru in D:\pear\repo\php\PEAR2\Pyrus\Config.php on line 515

Additonal Commnet

There is one change i made in pearconfig.xml: <preferred_state>alpha</preferred_state>

When changing the back to 'stable' and retrying the same exception occures.

Missing command-line option in Pyrus to disable package signing

(Migrated from pearweb bug #18122)

Description:

I configured my Pyrus installation so that it will use a certificate to sign packages I produce.
The problem is, I also have a buildbot using the same user account which tries to build nightly snapshots of my code as unsigned packages.
Whenever the slave starts the packaging process, Pyrus prompts it to choose whether the package should be signed or not. Since the slave has no way to answer that prompt, it just sits there, until the timeout for the task is reached, at which point pyrus gets killed.

I know a simple workaround would be to use different user accounts with different Pyrus installations (configurations), but I think it would be valuable to have a command-line option to accept/refuse package signing.

I suggest adding a command-line option (--sign) so that external scripts (buildbot, cron task, etc.) can be used to create packages without being stuck at the signature prompt.
IMHO, it should support the following values:
"on" / "yes" : force signing, exit with an exception if no valid certificate was found
"off" / "no" : disable signing entirely
"ask" (default value) : prompt whether signing should be enable or not (this is the current behaviour)

Test script:

$ pyrus.phar package --sign=off --phar --tgz

Expected result:

Pyrus should build the phar & tgz archives without prompting the user whether a certificate should be used or not to sign the package.

Actual result:

Pyrus asks me whether I want a signature to be added or not:

Sign package?
Please choose:
yes
no
[yes] :

Channel registry exists bug

(Bug migrated from pearweb #17585)

Description:

Create a new \PEAR2\Pyrus\Config with a directory that is not yet a registry.
Get the channelregistry and check if 'pear2.php.net' exists.

This will return 1.

After this try to get the channel and a exception will be thrown.

Test script:

$config = PEAR2\Pyrus\Config::singleton('D:\pear\testRepo');

// Expected result false or a exception saying that the channel registry is not initialized or initialize the registry.
// Current result 1
$res = $config->channelregistry->exists('pear2.php.net'); 
if ($res) {
    echo 'Channel exists ' . PHP_EOL;
} else {
    echo 'Unknow channel' . PHP_EOL;
}

// Throws 'PEAR2\Pyrus\ChannelFile\Exception: Invalid channel.xml'
// This is unexpected behavior
$config->channelregistry->get('pear2.php.net');

Expected result:

  • Make channelregistry->exists return false
    or
  • Let it throw a exception
    or
  • Let it initialize the repository

Actual result:

See test script

fails to run when detect_unicode is enabled

[avb@www ~]$ uname -a
FreeBSD www 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64
[avb@www ~]$ php -v
PHP 5.3.5 (cli) (built: Feb 21 2011 14:33:13)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
[avb@www ~]$ php -ddetect_unicode=1 pyrus.phar
??\sP?[avb@www ~]$

Relevant bug: http://bugs.php.net/52348

We can detect this in 5.3.4+ using the constant ZEND_MULTIBYTE + ini_get('detect_unicode')

Prior versions can use key_exists("detect_unicode", ini_get_all()) + ini_get('detect_unicode')

AtomicFileTransaction rename bin_dir

Copied from http://pear.php.net/bugs/bug.php?id=17627

Description:

When installing PEAR2_Pyrus the following exception occures:

 "PEAR2\Pyrus\AtomicFileTransaction\Exception" with message "Cannot rollback - not in a transaction" in E:\workspace\all\Pyrus\src\Pyrus\AtomicFileTransaction.php:535

This exception originates in AtomicFileTransaction.php line 655.
The reason for the exception is that it tries to rename "C:\xampp.old-php" to "C:\xampp\php" and this is not possible because php.exe is in use.

Maybe related to https://pear.php.net/bugs/bug.php?id=17195

Test script:

php scripts/pyrus e:\test
php scripts/pyrus e:\test set preferred_state alpha
php scripts/pyrus e:\test install PEAR2_Pyrus

Expected result:

  • A successful installation
    or
  • Better exception indicating that the bin_dir needs to be changed.

Actual result:

exception "PEAR2\Pyrus\AtomicFileTransaction\Exception" with message "Cannot rollback - not in a transaction" in E:\workspace\all\Pyrus\src\Pyrus\AtomicFileTransaction.php:535
Stack trace:
0 E:\workspace\all\Pyrus\src\Pyrus\Installer.php(329): PEAR2\Pyrus\AtomicFileTransaction::rollback()
1 E:\workspace\all\Pyrus\src\Pyrus\ScriptFrontend\Commands.php(482): PEAR2\Pyrus\Installer::commit()
2 E:\workspace\all\Pyrus\src\Pyrus\ScriptFrontend\Commands.php(276): PEAR2\Pyrus\ScriptFrontend\Commands-&gt;install(Array, Array)
3 E:\workspace\all\Pyrus\scripts\pyrus(37): PEAR2\Pyrus\ScriptFrontend\Commands-&gt;run(Array)
4 {main}PEAR2\Pyrus\AtomicFileTransaction\Exception: Cannot rollback - not in a transaction

Pyrus: Installation of pecl/APC fails: constraint failed

# ../inst/bin/pyrus-5.3.3 install pecl/apc
Pyrus version 2.0.0a2 SHA-1: CA3946A5C2C7DE7CD6ED89CAC7CCC06606E006D3
Using PEAR installation found at /opt/phpfarm/inst/php-5.3.3/pear
Downloading pecl.php.net/APC

Connected...
Mime-type: application/octet-stream

PEAR2\Pyrus\Registry\Exception: Error: package pecl.php.net/APC could not be installed in registry: Unable to execute statement: constraint failed
 Exception: Unable to execute statement: constraint failed

php extensions installed to wrong directory

When installing a pecl package as normal user, pyrus tries to install the compiled .so extension file into the global directory (/usr/):

2118497   4 drwxr-xr-x 3 cweiske cweiske       4096 2011-08-19 11:25 /home/christian.weiske/php/phpfarm/inst/php-5.3.3/pear/src/xdebug/./.install/usr
2118498   4 drwxr-xr-x 3 cweiske cweiske       4096 2011-08-19 11:25 /home/christian.weiske/php/phpfarm/inst/php-5.3.3/pear/src/xdebug/./.install/usr/lib
2118499   4 drwxr-xr-x 3 cweiske cweiske       4096 2011-08-19 11:25 /home/christian.weiske/php/phpfarm/inst/php-5.3.3/pear/src/xdebug/./.install/usr/lib/php5
2118500   4 drwxr-xr-x 2 cweiske cweiske       4096 2011-08-19 11:25 /home/christian.weiske/php/phpfarm/inst/php-5.3.3/pear/src/xdebug/./.install/usr/lib/php5/20090626
2115769 668 -rwxr-xr-x 1 cweiske cweiske     683653 2011-08-19 11:25 /home/christian.weiske/php/phpfarm/inst/php-5.3.3/pear/src/xdebug/./.install/usr/lib/php5/20090626/xdebug.so
Installing '/usr/lib/php5/20090626/xdebug.so'
Pyrus\PECLBuild\Exception: failed to write /usr/lib/php5/20090626/xdebug.so ()

Instead, it should use the local installation path.

Pyrus\Registry->getIterator not returning traversable

Description:

When doing a foreach on Config::registry a exception is thrown.

Test script:

--TEST--

--FILE--
<?php
require __DIR__ . '/setup.php.inc';
foreach ($c->registry as $r) {
}
?>
===DONE===
--CLEAN--
<?php
$dir = __DIR__ . '/testit';
include __DIR__ . '/../../clean.php.inc';
?>
--EXPECT--
===DONE===

Expected result:

A working foreach

Actual result:

Fatal error: Uncaught exception 'Exception' with message 'Objects returned by PEAR2\Pyrus\Registry::getIterator() must 

be traversable or implement interface Iterator' in

cannot unset php_suffix config setting

Unsetting a config value does not seem to be possible:

$ ../inst/bin/pyrus-5.3.7 set php_suffix -- ""
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/cweiske/php/phpfarm/inst/php-5.3.7/pear
Error: You must provide at least 2 arguments.

PEAR2\Pyrus\Registry\Xml unwriteable/none existing folder

Description:

Create a Xml Registry with a unwriteable/none existing folder.
No exception is thrown.

Test script:

$xml = new PEAR2\Pyrus\Registry\Xml('C:\LLALALALALALALALALA');

Expected result:

Exception: 'Cannot create Xml registry'

Actual result:

Registry is created without exception.

rmdir fails on non-empty directory during uninstall

I tried installing the aws/sdk package from the channel pear.amazonwebservices.com, and later uninstalled it, and get a bunch of warnings about the directories not being empty. The package still successfully uninstalls, but some directories are left behind.

Steps to reproduce:

pyrus ./ channel-discover pear.amazonwebservices.com
pyrus ./ install aws/sdk
pyrus ./ uninstall aws/sdk

It looks like the calls is in PEAR2_Pyrus/src/PEAR2/Pyrus/Filesystem.php. I haven't investigated at all yet, but thought I would post an issue in the mean time.

Long path name error

Description:

Using pyrus.phar from a workpath with more than 80 characters results in a loop and Windows recognizing that CLI stopped working application. (a)
If the path then also contains '.' , '-' and '_' then a memory error is thrown. (b)

With lesser characters in the path, everything works fine as expected.

Test script:

a)
E:\0123456789a123456789b123456789c123456789d123456789e123456789f123456789g123456789h>E:\xampp\php\bin\php.exe pyrus.phar
b) E:\0123456789a123456789b123456789c123456789d123456789e123456789f123456789g123456789h\sub_123.asdtest-asdas>E:\xampp\php\bin\php.exe pyrus.phar

Expected result:

a & b) pyrus help page

Actual result:

a) Windows popup stating that CLI stopped working application.
b) Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1953523825 bytes) in Unknown on line 0

Provide a simple way to manage parent/child PEAR installations

(Migrated from pearweb bug #10390)

When implementing cascading registries, it would be very important for breakage reasons to also allow a reverse cascade, so that the parent registry can determine whether an upgrade would break a child registry installation. This way, the child registries would not have to be protected from a bad upgrade by the parent registry.

Show command help when option not found

When using an unknown option to a command, the global pyrus help is shown instead of the command's help:

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . install --nodeps pear/mime_type
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
Error: Unknown option "--nodeps".
Type "php pyrus.phar --help" to get help.
Type "php pyrus.phar <command> --help" to get help on specific command.

Pyrus, the installer for PEAR2

Usage:
  php pyrus.phar [/path/to/pear] [options]
  php pyrus.phar [/path/to/pear] [options] <command> [options] [args]

Options:
  -v, --verbose   increase verbosity
  -p, --paranoid  set or increase paranoia level
  -h, --help      show this help message and exit
  --version       show the program version and exit

Commands:
  install             Install a package.  Use install --plugin to install
                      plugins (alias: i)
  upgrade             Upgrade a package.  Use upgrade --plugin to upgrade
                      plugins (alias: up)
  uninstall           Uninstall a package.  Use uninstall --plugin to
...

error message for alpha/beta packages should be better

When trying to install a alpha/beta package and your preferred stability is stable, you get a message indicating the package does not exist:

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . install pear/numbers_words
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
PEAR2\Pyrus\Installer\Exception: Dependency validation failed for some packages to install, installation aborted
 PEAR2\Pyrus\Package\Dependency\Set\Exception: Unable to find a compatible release for pear.php.net/Numbers_Words

The message should be along "no stable package found, but try install -beta".

pearDirectory argument forces realpath()

realpath() is applied to every use of the pearDirectory value pulled off the first argument to the Pyrus command-line tool.

There are situations where this might not be desired behavior. For example, I'm preparing a vendor directory for an application that will use APC when deployed to production. APC treats relative include paths with some disdain, forcing a a stat call to any relative path. (See docs on apc.stat.)

Any attempt to get around the apc.stat issue with symlinks -- allowing an arguably slightly less portable environment, but a deployable vendor directory that's apc.stat=0-friendly -- fails due to the hardcoded use of realpath() in PEAR2\Pyrus\Config::singleton().

I'd like to suggest a patch that would add an --ignore-realpath option to give those in the edge-case scenario a way to get around this easily.

Pre-register or allow easy registration of multiple channels

Given the changes done to http://pear.php.net/channels/ we have an easy to maintain index of all of the known channels out there.

One comment people make frequently is in regard to 'pear's main channel is the only one enabled by default' - http://blog.astrumfutura.com/2011/06/how-would-you-engineer-a-pear2pyrus-distribution-architecture/ for instance.

Why don't we ship pyrus with either all of the channels we know about pre-registered; or provide a 'channel-discover-all' style command, which retrieves an up to date list of channels from a server?

http://pear.php.net/channels/xbel.php is the current machine readable output of the channel index page.

php folder copy is forbidden on Windows

On an install command, after downloading, pyrus trys to make a copy of /php folder. Command is aborted on my pc
(Vista, i'm admin, i'm usin wamp with php 5.3.5)

Downloading pear.php.net/XML_Util=======================================> ] 71% ( 2/ 3 kb)
Connected...
Mime-type: application/octet-stream

PHP Warning: rename(C:\wamp21\bin\php\php5.3.5,C:\wamp21\bin\php.old-php5.3.5): Le processus ne peut pas accÚder au fi
chier car ce fichier est utilisÚ par un autre processus. (code: 32) in phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR
2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction/Transaction/TwoStage.php on line 82
PHP Stack trace:
PHP 1. {main}() C:\wamp21\bin\php\php5.3.5\pyrus.phar:0
PHP 2. PEAR2\Pyrus\ScriptFrontend\Commands->run() C:\wamp21\bin\php\php5.3.5\pyrus.phar:52
PHP 3. PEAR2\Pyrus\ScriptFrontend\Commands->install() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a3
/php/PEAR2/Pyrus/ScriptFrontend/Commands.php:284
PHP 4. PEAR2\Pyrus\Installer::commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a3/php/PEAR2/Pyru
s/ScriptFrontend/Commands.php:491
PHP 5. PEAR2\Pyrus\AtomicFileTransaction::commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a3/ph
p/PEAR2/Pyrus/Installer.php:329
PHP 6. PEAR2\Pyrus\AtomicFileTransaction\Manager->commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.
0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction.php:91
PHP 7. PEAR2\Pyrus\AtomicFileTransaction\Transaction\TwoStage->commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/P
EAR2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction/Manager.php:165
PHP 8. rename() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction
/Transaction/TwoStage.php:82

Warning: rename(C:\wamp21\bin\php\php5.3.5,C:\wamp21\bin\php.old-php5.3.5): Le processus ne peut pas accÚder au fichier
car ce fichier est utilisÚ par un autre processus. (code: 32) in phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyr
us-2.0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction/Transaction/TwoStage.php on line 82

Call Stack:
0.1370 1508104 1. {main}() C:\wamp21\bin\php\php5.3.5\pyrus.phar:0
0.2222 3130352 2. PEAR2\Pyrus\ScriptFrontend\Commands->run() C:\wamp21\bin\php\php5.3.5\pyrus.phar:52
0.3953 5662400 3. PEAR2\Pyrus\ScriptFrontend\Commands->install() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/P
EAR2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/ScriptFrontend/Commands.php:284
0.4562 7040216 4. PEAR2\Pyrus\Installer::commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.
0a3/php/PEAR2/Pyrus/ScriptFrontend/Commands.php:491
51.6199 18095216 5. PEAR2\Pyrus\AtomicFileTransaction::commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR
2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/Installer.php:329
51.6199 18095216 6. PEAR2\Pyrus\AtomicFileTransaction\Manager->commit() phar://C:/wamp21/bin/php/php5.3.5/pyrus.p
har/PEAR2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction.php:91
51.7005 18095048 7. PEAR2\Pyrus\AtomicFileTransaction\Transaction\TwoStage->commit() phar://C:/wamp21/bin/php/php
5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/AtomicFileTransaction/Manager.php:165
51.7015 18095080 8. rename() phar://C:/wamp21/bin/php/php5.3.5/pyrus.phar/PEAR2_Pyrus-2.0.0a3/php/PEAR2/Pyrus/Ato
micFileTransaction/Transaction/TwoStage.php:82

PEAR2\Pyrus\Installer\Exception: Installation failed
PEAR2\Pyrus\AtomicFileTransaction\MultiException: ERROR: commit failed
PEAR2\Pyrus\IOException: CRITICAL - unable to complete transaction, rename of actual to backup path failed
PEAR2\Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction

here with a handmade copy of /php to /.old_php ...

Downloading pear.php.net/XML_Util=======================================> ] 71% ( 2/ 3 kb)
Connected...
Mime-type: application/octet-stream

PEAR2\Pyrus\Installer\Exception: Installation failed==========================================> ] 93% (16/17 kb)
PEAR2\Pyrus\AtomicFileTransaction\MultiException: Unable to begin transaction
PEAR2\Pyrus\AtomicFileTransaction\RuntimeException: Cannot begin - a backup directory still exists
PEAR2\Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction

Default bin_dir is not writeable

The default bin_dir is /usr/bin even when you do a local installation. When pyrus is initialized, it should use a local bin dir.

default channel setting has no effect

I tried to install QF2 with pyrus and again forgot to specify pear/, so I set the default channel. Unfortunately, this did not help. In the end I installed it again by specifying pear/

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . install html_quickform2-beta
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
Sorry there was an error retrieving pear2.php.net/html_quickform2-beta from the default channel
PEAR2\Pyrus\Channel\Exception: package html_quickform2 does not exist
 PEAR2\Pyrus\HTTPException: Download of http://pear2.php.net/rest/p/html_quickform2/info.xml failed, file does not exist

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . set default_channel pear.php.net
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
Setting default_channel in /home/christian.weiske/.pear/pearconfig.xml

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . install html_quickform2-beta
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
Sorry there was an error retrieving pear.php.net/html_quickform2-beta from the default channel
PEAR2\Pyrus\Channel\Exception: package html_quickform2 does not exist
 PEAR2\Pyrus\HTTPException: Download of http://pear2.php.net/rest/p/html_quickform2/info.xml failed, file does not exist

$ /opt/phpfarm/inst/bin/php-5.3.6 pyrus.phar . install pear/html_quickform2-alpha
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/christian.weiske/pytest
Downloading pear.php.net/HTML_QuickForm2

pickle generated PECL packages fail at build/install time

Pyrus version 2.0.0a1 SHA-1: E8D2B52B1C5FB9C1F02D753BECEAB96176348F77

When creating a package from the ssdeep PECL extension I attempted to run php pyrus.phar pickle, which completed successfully and produced a .tgz package as expected.

Subsequently I ran pecl install ssdeep-1.0.2.tgz to test building and installing the extension from the package.

This feedback "ERROR: file /build/buildd/php5-5.3.3/pear-build-download/ssdeep-1.0.2/examples/example.php does not exist"

Upon looking in /build/buildd/php5-5.3.3/pear-build-download/ I could see that there was no ssdeep-1.0.2 directory in there. The build directory looked like:

ls -lkha /build/buildd/php5-5.3.3/pear-build-download/
total 44K
drwxr-xr-x 5 root root 4.0K Nov 10 12:58 .
drwxr-xr-x 3 root root 4.0K Nov 10 10:42 ..
drwxr-xr-x 2 root root 4.0K Nov 10 10:46 .phar
-rw-r--r-- 1 root root 3.2K Nov 10 12:58 ax_libssdeep.m4
-rw-r--r-- 1 root root 1.2K Nov 10 12:58 config.m4
drwxr-xr-x 2 root root 4.0K Nov 10 12:58 examples
-rw-r--r-- 1 root root 3.3K Nov 10 12:58 package.xml
-rw-r--r-- 1 root root 1.9K Nov 10 12:58 php_ssdeep.h
-rw-r--r-- 1 root root 5.4K Nov 10 12:58 ssdeep.c
drwxr-xr-x 2 root root 4.0K Nov 10 12:58 tests

So it appears that PECL is extracting the files to the wrong location when a pyrus pickle package is supplied to it.

To get my package to create and build correctly I currently run php pyrus.phar pickle --donotpackage followed by php pyrus.phar package.

I have attached two files to this report one generated by each method so you can see the difference. The source for ssdeep is available via PECL SVN.

Test script:

Just in case ssdeep has been installed before we don't want PECL getting confused and attempting to use the wrong ssdeep files

rm -rf /build/buildd/php5-5.3.3/pear-build-download/*
php pyrus.phar pickle
pecl install ssdeep-1.0.2.tgz

Expected result:

4 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
building in /var/tmp/pear-build-root/ssdeep-1.0.2
running: /tmp/pear/temp/ssdeep/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20090626+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for ssdeep support... yes, shared
checking whether to enable build debug output... no
checking for ssdeep... /usr/local/lib
checking for fuzzy_compare in -lfuzzy... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /var/tmp/pear-build-root/ssdeep-1.0.2/libtool --mode=compile cc -I. -I/tmp/pear/temp/ssdeep -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssdeep-1.0.2/include -I/var/tmp/pear-build-root/ssdeep-1.0.2/main -I/tmp/pear/temp/ssdeep -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ssdeep/ssdeep.c -o ssdeep.lo
libtool: compile: cc -I. -I/tmp/pear/temp/ssdeep -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssdeep-1.0.2/include -I/var/tmp/pear-build-root/ssdeep-1.0.2/main -I/tmp/pear/temp/ssdeep -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ssdeep/ssdeep.c -fPIC -DPIC -o .libs/ssdeep.o
/bin/bash /var/tmp/pear-build-root/ssdeep-1.0.2/libtool --mode=link cc -DPHP_ATOM_INC -I/var/tmp/pear-build-root/ssdeep-1.0.2/include -I/var/tmp/pear-build-root/ssdeep-1.0.2/main -I/tmp/pear/temp/ssdeep -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -o ssdeep.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/pear-build-root/ssdeep-1.0.2/modules ssdeep.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lfuzzy
libtool: link: cc -shared .libs/ssdeep.o -L/usr/local/lib /usr/local/lib/libfuzzy.so -Wl,-rpath -Wl,/usr/local/lib -Wl,-soname -Wl,ssdeep.so -o .libs/ssdeep.so
libtool: link: ( cd ".libs" && rm -f "ssdeep.la" && ln -s "../ssdeep.la" "ssdeep.la" )
/bin/bash /var/tmp/pear-build-root/ssdeep-1.0.2/libtool --mode=install cp ./ssdeep.la /var/tmp/pear-build-root/ssdeep-1.0.2/modules
libtool: install: cp ./.libs/ssdeep.so /var/tmp/pear-build-root/ssdeep-1.0.2/modules/ssdeep.so
libtool: install: cp ./.libs/ssdeep.lai /var/tmp/pear-build-root/ssdeep-1.0.2/modules/ssdeep.la

libtool: finish: PATH="/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/sbin" ldconfig -n /var/tmp/pear-build-root/ssdeep-1.0.2/modules

Libraries have been installed in:
/var/tmp/pear-build-root/ssdeep-1.0.2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:

  • add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
  • add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
  • use the `-Wl,-rpath -Wl,LIBDIR' linker flag
  • have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-ssdeep-1.0.2" install
Installing shared extensions: /var/tmp/pear-build-root/install-ssdeep-1.0.2/usr/lib/php5/20090626+lfs/
running: find "/var/tmp/pear-build-root/install-ssdeep-1.0.2" | xargs ls -dils
1318915 4 drwxr-xr-x 3 root root 4096 Nov 10 13:19 /var/tmp/pear-build-root/install-ssdeep-1.0.2
1318939 4 drwxr-xr-x 3 root root 4096 Nov 10 13:19 /var/tmp/pear-build-root/install-ssdeep-1.0.2/usr
1318940 4 drwxr-xr-x 3 root root 4096 Nov 10 13:19 /var/tmp/pear-build-root/install-ssdeep-1.0.2/usr/lib
1318941 4 drwxr-xr-x 3 root root 4096 Nov 10 13:19 /var/tmp/pear-build-root/install-ssdeep-1.0.2/usr/lib/php5
1318942 4 drwxr-xr-x 2 root root 4096 Nov 10 13:19 /var/tmp/pear-build-root/install-ssdeep-1.0.2/usr/lib/php5/20090626+lfs
1318938 32 -rwxr-xr-x 1 root root 29829 Nov 10 13:19 /var/tmp/pear-build-root/install-ssdeep-1.0.2/usr/lib/php5/20090626+lfs/ssdeep.so

Build process completed successfully
Installing '/usr/lib/php5/20090626+lfs/ssdeep.so'
install ok: channel://pecl.php.net/ssdeep-1.0.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssdeep.so" to php.ini

Actual result:

ERROR: file /build/buildd/php5-5.3.3/pear-build-download/ssdeep-1.0.2/examples/example.php does not exist

Pyrus should expand relative paths

When a pyrus command is passed a relative path, this path does not necessarily necessarily get expanded.

For example,

$ cd /home/mfonda/pyrus
$ php pyrus.phar mypear ./

I would expect this to set my_pear_path to /home/mfonda/pyrus, but it literally gets set to ./

\PEAR2\Pyrus\Package exception

Description:

When creating a new instance of a package that is all ready in the rgistry a exception occures.

Test script:

fromString('pear2.php.net/P...') #1 D:\pear\repo\php\PEAR2\Pyrus\Package.php(55): PEAR2\Pyrus\Package\Remote->__construct('pear2.php.net/P...', Object(PEAR2\Pyrus\Package)) #2 D:\pear\packages\PackageManager\tests\u.php(7): PEAR2\Pyrus\Package->__construct('pear2.php.net/P...') #3 {main} thrown in D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php on line 282

global pyrus help shown everywhere

The global pyrus help is shown everywhere, which sucks big deal.

$ ../inst/bin/pyrus-5.3.7RC5 in
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/cweiske/php/phpfarm/inst/php-5.3.7RC5/pear
Error: You must provide at least 1 argument.
Type "php pyrus.phar --help" to get help.
Type "php pyrus.phar <command> --help" to get help on specific command.

Pyrus, the installer for PEAR2

Usage:
  php pyrus.phar [/path/to/pear] [options]
  php pyrus.phar [/path/to/pear] [options] <command> [options] [args]
... 200 more lines

-> why is the pyrus help shown there? why is the command help not shown?

$ ../inst/bin/pyrus-5.3.7RC5 in --help
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /home/cweiske/php/phpfarm/inst/php-5.3.7RC5/pear

Display information about a package

Usage:
  php pyrus.phar [options] info [options] <package> <field>

Options:
  -r, --forceremote  Assume package name is a remote package, ignoring
                     installed packages
  -h, --help         show this help message and exit

Arguments:
  package  Package name, local package archive, or package.xml.
  field    one of "description", "notes", "files"

Error: You must provide at least 1 argument.
Type "php pyrus.phar --help" to get help.
Type "php pyrus.phar <command> --help" to get help on specific command.

Pyrus, the installer for PEAR2

Usage:
  php pyrus.phar [/path/to/pear] [options]
  php pyrus.phar [/path/to/pear] [options] <command> [options] [args]

Why is the pyrus help shown here? It doesn't make sense

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.