📜 ⬆️ ⬇️

Pear Channel @ (Google Code || SourceForge)

image PEAR (an acronym for the English words PHP Extension and Application Repository) is an open source PHP class library. The standard PHP package includes the PEAR class management system, which makes it easy to download and update them. In order for a class to enter PEAR it must comply with very strict rules. For example, without special need you cannot create a class with the same task as the one already created. As part of PEAR, a special PHP style has been created that all classes in the library should adhere to. This style has become the most common standard style PHP-code on the Internet. In English, “pear” means “pear”, which is the logo of the project.

In several articles we will try to consider how to create your own PEAR channel with minimal investments, create and maintain packages distributed through it, and how can we consider the options for using the PEAR channel not for its intended purpose: delivering and installing a PHP application to a client.

Update : A recently appeared bug that does not allow using third-party PEAR channels with the usual set of actions is found, but installation of packages despite this is possible, which is expected to be fixed next weekend. Here is the option to install the package "directly", on the example of the unofficial Smarty channel:
pear install http://pear-smarty.googlecode.com/svn/tags/Smarty/Smarty-2.6.24.tgz
Requirements:
The article assumes that the name of your project on Google Code: habrahabr, so, carefully pray:
Checkout from https://habrahabr.googlecode.com/svn, revision HEAD, Fully recursive, Externals included<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\wiki<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\trunk<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\branches<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\tags<br/>At revision: 1
Create a channel for our project
C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr>php pearscs.phar create habrahabr.googlecode.com/svn habrahabr<br/><br/>Created habrahabr.googlecode.com/svn<br/> | ./channel.xml<br/> | ./rest/<br/> | ./get/
Fill the initialized channel on Google Code
Commit<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\channel.xml<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\get<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\pearscs.phar<br/>C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr\rest<br/>At revision: 2
Add the created channel to the local channel list
C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr>pear channel-add channel.xml<br/>Adding Channel "habrahabr.googlecode.com/svn" succeeded
References:
PS
The author of the original article recommends making the following settings in php.ini:
[phar]<br/>phar.readonly = 0<br/>phar.require_hash = 0
In the process, it turned out that for some reason the recommended way (channel-discover) of adding a channel does not work, since supposedly PEAR cannot get a description of the channel we initialized, perhaps this is a problem in compatibility of the current versions of PEAR and Coogle Code, or the platform is dependent on my environment. since the contents of the required file can be obtained both through the browser and file_get_contents ():
C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr>pear channel-discover habrahabr.googlecode.com/svn<br/>Discovery of channel "habrahabr.googlecode.com/svn" failed (channel-add: Cannot open "http://habrahabr.googlecode.com/svn/channel.xml" (File http://habrahabr.googlecode.com:80/svn/channel.xml not valid (received: HTTP/1.1 404 Not Found)))
It also turned out that Zend Server for Windows does not provide a dll for SQLite3, I had to look for php_sqlite3.dll and php5ts.dll.
')
PP S
Accidental F5 killed the whole article, so I had to overcome the desire to score a bolt and try to restore what was written, if suddenly I didn’t mention any important step, let me know about it, and also if you already have experience in creating your own PEAR channel - share by experience. It is also supposed to work on SourceForge, and the creation of the channel will take the following form, given that the project name on SourgeForge coincides with the one chosen for Google Code:
C:\Program Files (x86)\Zend\Apache2\htdocs\habrahabr>php pearscs.phar create habrahabr.svn.sourceforge.net/viewvc/habrahabr habrahabr<br/><br/>Created habrahabr.svn.sourceforge.net/viewvc/habrahabr<br/> | ./channel.xml<br/> | ./rest/<br/> | ./get/
Unfortunately, it is not yet possible to check whether this will actually work or not.

Source: https://habr.com/ru/post/87815/


All Articles