• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2021-

OS/H03-May-2021-338212

PEAR/H03-May-2021-44,73232,381

docs/H03-May-2022-

man1/H03-May-2021-280266

man5/H03-May-2021-5144

packages/H03-May-2022-

scripts/H03-May-2021-970769

.travis.ymlH A D03-May-2021905 3938

CODING_STANDARDSH A D03-May-2021325 75

INSTALLH A D03-May-20212.1 KiB5343

LICENSEH A D03-May-20211.4 KiB2824

Makefile.fragH A D03-May-2021782 2314

PEAR.phpH A D03-May-202134.7 KiB1,114582

README.CONTRIBUTINGH A D03-May-202111.4 KiB249199

README.rstH A D03-May-20212.6 KiB8967

System.phpH A D03-May-202120.1 KiB629372

build-release.shH A D03-May-2021501 2618

catalogH A D03-May-202167 21

composer.jsonH A D03-May-20212 KiB8483

go-pear-list.phpH A D03-May-2021519 2010

go-pear-phar.phpH A D03-May-2021119 66

install-pear.phpH A D03-May-202110.3 KiB344300

make-command-xml.phpH A D03-May-20212.5 KiB6854

make-gopear-phar.phpH A D03-May-20217.2 KiB194149

make-installpear-nozlib-phar.phpH A D03-May-20217.7 KiB214167

make-pear-bundle.phpH A D03-May-20214.1 KiB13291

package-ErrorStack.xmlH A D03-May-20211.7 KiB6766

package-manpages.xmlH A D03-May-20213 KiB120115

package.dtdH A D03-May-20213.3 KiB10454

package2.xmlH A D03-May-202152.1 KiB1,2601,219

template.specH A D03-May-20212 KiB7356

test-modified.phpH A D03-May-20214.1 KiB153134

README.CONTRIBUTING

1$Id$
2==CONTRIBUTING GUIDE FOR PEAR CORE DEVELOPERS==
3Author: Gregory Beaver <cellog@php.net>
4
5INTRODUCTION
6------------
7
8Thank you for assisting in development of the premiere PHP installer!
9Over the years, certain protocols have developed for handling releases,
10documenting changes to the code, and coordinating efforts with the
11PHP core development team.
12
13This document attempts to explain what it means to be a maintainer of
14the PEAR package, and how to properly do maintenance.
15
16This document assumes two things:
17
181) you have already applied for a CVS account at http://www.php.net/cvs-php.php
192) you have already applied for a PEAR account at http://pear.php.net/account-request.php
20
21Fear not!  PEAR is slowly but surely evolving, and this document will hopefully only
22become smaller and simpler as this takes place.  Keep your fingers crossed!
23
24Table of Contents
25-----------------
261. Fixing bugs/Adding features
272. Writing regression tests
283. Releasing PEAR
294. synchronizing PEAR with the PHP release (PHP >= 5.1.0)
305. http://pear.php.net/go-pear and testing
316. pear.php.net and rest
32
331. FIXING BUGS/ADDING FEATURES
34------------------------------
35
36In most cases, bugs or features are opened at the official bug tracker
37located at:
38
39http://pear.php.net/package/PEAR/bugs
40
41When you fix a bug, or implement feature requested, please follow this checklist:
42
431) assign the bug to yourself in the bug tracker
442) write a .phpt-based regression test that verifies the bug, or tests the
45   new feature.  The test should be written prior to any code changes, and
46   should attempt to work properly, but fail due to the bug in PEAR or non-existing
47   feature.  Please name the test after the bug tracker number to make it easier to
48   find.  If you fix bug #12345 name the test "bug12345.phpt."  If the bug was in
49   the PEAR_Installer class, please save it in pear-core/tests/PEAR_Installer/bug12345.phpt
503) fix the bug, or add the new feature.
514) upgrade your local PEAR installation via "pear upgrade -f package2.xml"
525) do a few simple tests to see if you have fixed the bug.  This should include
53   running the regression test that you wrote.  If the test is named bug12345.phpt,
54   use "pear run-tests tests/PEAR_Installer/bug12345.phpt" from the pear-core directory
556) if the code did not fix the problem, go back to step 3 :)
567) run the remaining regression tests to ensure that you did not break existing
57   features with your bugfix/feature addition.
58      cd tests
59      pear run-tests -rq
60   if any tests fail, examine the .out files (as in bug12345.out) to determine the cause
61   of failure.
628) add an entry to the release notes in both package2.xml and package-PEAR.xml.
63   Please use the full bug summary as in:
64   * Fix Bug #12345: Foo failure in --packagingroot option [your pear username]
659) Don't be afraid to ask the older developers for help or clarification!!
66
672. WRITING REGRESSION TESTS
68---------------------------
69
70PEAR's regression tests are based on the versatile .phpt format, which is somewhat
71documented at:
72
73(official resource) http://qa.php.net/write-test.php
74(unofficial resource) http://weierophinney.net/matthew/archives/65-phpt-Tutorial.html
75
76In addition to these fine and succinct tutorials, take a quick peek at the source
77of existing unit tests, such as those in pear-core/tests/PEAR_Installer/
78
79Each test in PEAR should make use of a simple principle: only display output when
80there is an error.  This will allow simple cross-platform/cross-PHP version testing.
81In addition, use the utility PEAR_PHPTest class found in tests/phpt_test.php.inc.
82This will allow tremendous flexibility in testing.
83
84Don't be afraid to ask the older developers for help or clarification!
85
863. RELEASING PEAR
87-----------------
88
89When releasing a new version of PEAR, follow these simple steps:
90
911) set the release date in package2.xml and package-PEAR.xml to 1 week from the
92   current date.
932) run this command:
94     pear package package2.xml package-PEAR.xml
95   and fix any errors
963) upload the subsequent .tgz file (PEAR-1.4.6.tgz for PEAR version 1.4.6)
97   to a private location where others can download it
984) post a message to the pear-qa@lists.php.net mailing list asking people to
99   install the package, and try to break it, by running all commands, and running
100   the unit tests
1015) if all goes well, release the package through http://pear.php.net/release-upload.php
102   on the release date in package2.xml.  ALWAYS RELEASE A PACKAGE THAT HAS BEEN
103   TESTED BY AT LEAST 1 INDEPENDENT SOURCE.  We've had too many broken releases
104   rushed out in the past.  If you're not sure, ask one of the older devs for help
1056) After another week, when it is clear that PEAR is working, you may need to coordinate
106   the release with PHP developers.
107
1084. SYNCHRONIZING PEAR WITH THE PHP RELEASE (PHP >= 5.1.0)
109--------------------------------------------------------
110
111PHP 5.1.0 and newer make use of a new technology, the PHP archive, or "phar".
112
113The UNIX build of PHP uses install-pear-nozlib.phar, and the windows build uses
114go-pear.phar.  To create these files, follow these simple steps:
115
116cvs -d :pserver:yourcvs@cvs.php.net:/repository login [replace yourcvs with your login]
117cvs -d :pserver:yourcvs@cvs.php.net:/repository co pear-core
118cd pear-core/PEAR
119mkdir go-pear-tarballs
120cd go-pear-tarballs
121pear download -Z PEAR-stable Archive_Tar-stable Console_Getopt-stable XML_Util-stable
122cd ../..
123pear install PHP_Archive
124php make-installpear-nozlib-phar.php
125php make-gopear-phar.php
126
127Note that PHP 5.1 is required in order to create the archives, and they can be created
128on either unix or windows.
129
130Now, these files need to reside in the document root of pear.php.net.  However, the
131files are stored in cvs at pear/installphars and are released as the package
132pearweb_phars.
133
134As such, you will need to ask someone with karma to commit them if you do not have karma,
135and to release the pearweb_phars package as well.
136
137To use these files, do the following:
138
1391) UNIX
140cp install-pear-nozlib.phar /path/to/php-src/pear
141cd /path/to/php-src
142make install-pear
143
1442) WINDOWS
145php go-pear.phar
146
147That's it!  In fact, the go-pear.bat that comes with PHP 5.1.x simply contains that line,
148so that people can simply type "go-pear" to install PEAR.  The code used to run go-pear.phar
149is located in pear-core/go-pear-phar.php.  This file ultimately loads
150pear-core/PEAR/Start.php and pear-core/PEAR/Start/CLI.php.  These files are based off
151of the code in the web-based go-pear, which is discussed in the next section.
152
1535. HTTP://PEAR.PHP.NET/GO-PEAR AND TESTING
154---------------------------------
155
156One of the most common methods used to install PEAR is http://pear.php.net/go-pear
157
158go-pear is actually a file located in CVS at cvs.php.net in pearweb/public_html/go-pear
159and it contains, in a single PHP file, all of the code necessary to download PEAR and run
160it.  Unfortunately, this also makes it difficult to debug and to maintain, as there are
161more than a few hacks to make it work within a single file.  However, it does the best
162it could under the circumstances, and contains code to install the CLI and the web-based
163frontend, as well as to download the necessary packages.
164
165Testing this code is very difficult, and it is important to test on windows, and to
166familiarize yourself with related bugs that have been encountered (a search of
167http://www.beeblex.com is a good place to start).  If you are a brave and wonderful
168person, and are willing to write ApacheTest-based tests for go-pear, we would
169enshrine you in the halls of glory for at least a year or so :).
170
171The main thing to remember is that you need to be aware of how go-pear works, so
172that you can be aware of its needs in relation to PEAR.
173
1746. PEAR.PHP.NET AND REST
175-------------------------------
176
177Perhaps the most complex aspect of maintaining the PEAR installer is the interaction
178with pear.php.net.  The PEAR installer uses one protocols to access package information,
179REST (Representative State Transfer) to represent abstract meta-data about packages,
180and to respond to specific queries about this data.
181There used to be support for XML-RPC (XML remote procedure call) in older version of PEAR
182but got removed due to XML-RPC backends being obsoleted and not used anywhere.
183
184PEAR prior to version 1.4.0 exclusively uses XML-RPC, and specifically interacts with
185http://pear.php.net/xmlrpc.php, which is located at cvs.php.net in
186pearweb/public_html/xmlrpc.php.  This file in turn accesses
187pearweb/include/pear-database.php, which contains all of the specific functions used by
188the PEAR installer.  pear-database.php contains a number of xml-rpc functions not used
189at all by the installer.  Fortunately, a complete list of functions used by the installer
190is documented in http://pear.php.net/channel.xml.
191
192REST is a description of a rather loose way of representing data, and can mean many things
193but is most commonly distilled into "Every resource has one unique URL for accessing and
194representing this resource."  PEAR implements this using static XML files, located at
195http://pear.php.net/rest.  These files are auto-generated, and for more information on
196how and what is generated, check the online manual, and the code at
197pearweb/include/pear-rest.php.
198
199What is important to understand is that pear.php.net has had tremendous load issues
200recently.  The largest URL accessed at pear.php.net is xmlrpc.php, which returns a
201tremendous amount of data.  Any changes to the PEAR installer can have a profound
202effect on the performance of pear.php.net.  REST is actually a major step forward because
203it distributes this load more effectively and eliminates all dynamic code processing,
204but until PEAR 1.3.x disappears, xmlrpc will continue to be a noticeable load on the
205server.  Consider all changes with care!
206
207To implement a new feature or fix a bug, if you need to access some information
208remotely in a different way, always attempt to do this with the existing layout first.
209Only add new REST as XML-RPC has bee phased out and the installer contains no such code.
210
211If you plan to maintain the remote access portion of PEAR, it is imperative to
212become intimately familiar with how the website works.  Check out pearweb from
213CVS and study it, set up a local copy and take a day to make it work - this is no
214small endeavor, I assure you, but it is worth it for local testing.
215
216Once you have a working local mirror, simply update your local channel.xml for PEAR
217with a mirror and select that mirror.  Save this file as "mychannel.xml":
218
219<channel version="1.0" xsi:schemaLocation="http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd">
220<name>pear.php.net</name>
221<suggestedalias>pear</suggestedalias>
222<summary>PHP Extension and Application Repository</summary>
223 <servers>
224  <primary>
225   <rest>
226    <baseurl type="REST1.0">http://pear.php.net/rest/</baseurl>
227    <baseurl type="REST1.1">http://pear.php.net/rest/</baseurl>
228   </rest>
229  </primary>
230  <mirror host="localhost"> <!-- replace with the path to pearweb -->
231   <rest>
232    <baseurl type="REST1.0">http://localhost/rest/</baseurl>
233    <baseurl type="REST1.1">http://localhost/rest/</baseurl>
234   </rest>
235  </mirror>
236 </servers>
237</channel>
238
239Then:
240
241pear channel-update mychannel.xml
242pear config-set preferred_mirror localhost
243
244This will instruct the PEAR installer on your machine to access your local copy of pearweb
245as if it were the remote one.  This can be used to debug complex server interactions
246without requiring any internet access whatsoever.
247
248Again, as with all other tasks, consult one of the experienced developers if you need
249assistance setting up pearweb locally, or have any questions!

README.rst

1*************************
2PEAR - The PEAR Installer
3*************************
4.. image:: https://travis-ci.org/pear/pear-core.svg?branch=stable
5    :target: https://travis-ci.org/pear/pear-core
6
7=========================================
8What is the PEAR Installer? What is PEAR?
9=========================================
10PEAR is the PHP Extension and Application Repository, found at
11http://pear.php.net.
12
13The **PEAR Installer** is this software, which contains executable
14files and PHP code that is used to **download and install** PEAR code
15from pear.php.net.
16
17PEAR contains useful **software libraries and applications** such as
18MDB2 (database abstraction), HTML_QuickForm (HTML forms management),
19PhpDocumentor (auto-documentation generator), DB_DataObject
20(Data Access Abstraction), and many hundreds more.
21Browse all available packages at http://pear.php.net, the list is
22constantly growing and updating to reflect improvements in the PHP language.
23
24.. warning::
25  Do not run PEAR without installing it - if you downloaded this
26  tarball manually, you MUST install it.  Read the instructions in INSTALL
27  prior to use.
28
29
30=============
31Documentation
32=============
33Documentation for PEAR can be found at http://pear.php.net/manual/.
34Installation documentation can be found in the INSTALL file included
35in this tarball.
36
37
38=====
39Tests
40=====
41Run the tests without installation as follows::
42
43  $ ./scripts/pear.sh run-tests -r tests
44
45You should have the ``Text_Diff`` package installed to get nicer error output.
46
47To run the tests with another PHP version, modify ``php_bin`` and set the
48``PHP_PEAR_PHP_BIN`` environment variable::
49
50  $ pear config-set php_bin /usr/local/bin/php7
51  $ PHP_PEAR_PHP_BIN=/usr/local/bin/php7 ./scripts/pear.sh run-tests -r tests
52
53Happy PHPing, we hope PEAR will be a great tool for your development work!
54
55
56Test dependencies
57=================
58* ``zlib``
59
60
61=========
62Releasing
63=========
64Create a PEAR package as well as phars for pear-less installation::
65
66    $ rm -f PEAR-*.tgz
67    $ pear package package2.xml
68    $ cd go-pear-tarballs
69    $ rm -f PEAR-*
70    $ cp ../PEAR-*.tgz .
71    $ gunzip PEAR-*.tgz
72    $ pear download -Z Archive_Tar Console_Getopt Structures_Graph XML_Util
73    $ mkdir src && cd src
74    $ for i in ../*.tar; do tar xvf $i; done
75    $ mv *\/* .
76    $ cd ../../
77    $ php make-gopear-phar.php
78    $ php make-installpear-nozlib-phar.php
79
80(Or simply run ``build-release.sh``).
81
82``go-pear.phar`` is contains the PEAR installer installer that asks questions
83where to install it.
84It is available from http://pear.php.net/go-pear.phar.
85
86``install-pear-nozlib.phar`` installs PEAR automatically without asking
87anything.
88It is shipped with PHP itself.
89