cvs: peardoc /en/chapters faq.xml /en/chapters/faq devs.xml documentation.xml users.xml

From: Date: Tue, 12 Dec 2006 12:39:04 +0000
Subject: cvs: peardoc /en/chapters faq.xml /en/chapters/faq devs.xml documentation.xml users.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9058@lists.php.net to get a copy of this message
cweiske Tue Dec 12 12:39:04 2006 UTC Added files: /peardoc/en/chapters/faq devs.xml documentation.xml users.xml Modified files: /peardoc/en/chapters faq.xml Log: Splitting FAQ in user, developer and documentation section Adding four new faq entries

http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/faq.xml?r1=1.30&r2=1.31&diff_format=u Index: peardoc/en/chapters/faq.xml diff -u peardoc/en/chapters/faq.xml:1.30 peardoc/en/chapters/faq.xml:1.31 --- peardoc/en/chapters/faq.xml:1.30 Fri Oct 20 19:57:00 2006 +++ peardoc/en/chapters/faq.xml Tue Dec 12 12:39:03 2006 @@ -1,756 +1,13 @@ -<!-- $Revision: 1.30 $ --> -<!-- [mj] The FAQ needs some heavy revision - don't translate it right - now --> +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.31 $ --> <chapter id="faq"> <title>FAQ - Frequently Asked Questions</title> <titleabbrev>FAQ</titleabbrev> - <sect1 id="faq.whatis"> - <title> - What is PEAR? - </title> - <para> - This is described <link linkend="introduction">here</link>. - </para> - </sect1> - <sect1 id="faq.pearinhomedir"> - <title> - I've got an old installation of PEAR and don't have the permissions to install a new version - what now? - </title> - <titleabbrev> - Installing PEAR in your home directory - </titleabbrev> - <para> - If <command>$ which pear</command> gives you something like <filename>/usr/local/bin/pear</filename> - and <command>$ pear -v</command> shows a very old version or if you don't want - to use it for other reasons, you have to install PEAR in your home directory. - </para> - <para> - Go to http://go-pear.org, save as <filename>gopear.php</filename> and do - <command>$ php gopear.php</command> or try - <command>$ lynx -source http://pear.php.net/go-pear | php -q</command>. - </para> - <para> - Use <filename>/home/user/pear</filename> as prefix while installing PEAR, where user is your - username. - </para> - <para> - Once the installation is done, edit your PATH variable to include your planned new PEAR directory - <emphasis>before</emphasis> the old one. - </para> - <para> - For example put a <command>export PATH=/home/user/pear/bin:$PATH</command> - at the end of your <filename>~/.bashrc</filename> or <filename>~/.profile</filename> - under Linux. <command>$ echo $PATH</command> should give you now - <filename>/home/user/pear/bin:[...]</filename> - </para> - <para> - <command>$ which pear</command> should result in <filename>/home/user/pear/bin/pear</filename> - and <command>$ pear -v</command> something like "PEAR Version: 1.4.8" - (at the time of writing) or newer. Check the latest stable version at - http://pear.php.net/package/PEAR under <emphasis>Current Release</emphasis>. - </para> - <para> - Now all you need is to set your <emphasis>include_path</emphasis> correctly, most - likely via - <programlisting role="php"> - <![CDATA[ - <?php - $path = ini_get('include_path'); - ini_set('include_path', '/home/user/pear'.PATH_SEPARATOR.$path); - ?> - ]]> - </programlisting> - </para> - </sect1> - <sect1 id="faq.noreleasesfound"> - <title> - How do I install a package when I get the error message - &quot;No release with state equal to: 'stable' found for 'Packagename'&quot;? - </title> - <titleabbrev> - No release with state equal to: 'stable' found for 'Packagename' - </titleabbrev> - <simpara> - answer by Greg Beaver - </simpara> - <para> - The package in question does have releases, but none that are stable. - There are two solutions. - </para> - <para> - <orderedlist> - <listitem> - <para> - Set preferred_state to alpha or beta and then install - </para> - <para> - <command>$ pear config-set preferred_state alpha</command> - </para> - <para> - <command>$ pear install Packagename</command> - </para> - </listitem> - <listitem> - <para> - Find out the stability or version number of the latest release and install it directly. - </para> - <para> - <command>$ pear install Packagename-alpha</command> - </para> - <para> - <command>$ pear install Packagename-1.5.3</command> - </para> - </listitem> - </orderedlist> - </para> - </sect1> - <sect1 id="faq.contributor"> - <title> - How do I become a PEAR contributor and/or how do I get CVS access to - PEAR? - </title> - <titleabbrev> - Becoming contributor - </titleabbrev> - <para> - This is described <link linkend="developers.intro">here</link>. - </para> - </sect1> - <sect1 id="faq.c-module"> - <title> - I have written a PHP module in C. What are the rules of including - this in PEAR? - </title> - <titleabbrev> - C-Modules - </titleabbrev> - <para> - The <ulink url="&url.pecl;">PECL project</ulink> (a spin-off from - PEAR) is the place where C extensions for PHP are published. - </para> - </sect1> - <sect1 id="faq.separated"> - <title> - Why is PEAR separated into pear/ and pear-core/? - </title> - <titleabbrev> - Why pear/ and pear-core/? - </titleabbrev> - <simpara> - The first elements of PEAR were stored in the directory pear-core (once php-src/pear) - and so they were bundled with each new PHP release. - </simpara> - <simpara> - For future releases of PEAR this isn't workable because PEAR will - become too big to be bundled with every release of PHP. So there - was a decision to commit all new elements to an own top level - directory pear. The other elements which are currently remaining - in php-src/pear will be moved to the new top level directory soon. - Only the PEAR package manager code will be bundled with every new - release automatically. - </simpara> - </sect1> - <sect1 id="faq.directory-structure"> - <title> - Why does the directory structure of pear/ and pear-core/ differ? - </title> - <titleabbrev> - Why do pear/ and pear-core/ differ? - </titleabbrev> - <para> - The directory structure of <filename>pear-core/</filename> - matches that of the install tree (by default - <filename>/usr/local/lib/php</filename>), and are organized as a - simple hierarchy. However, the directory structure of - <filename>pear/</filename> is based on what package the files - belong to. Where files are located in each package directory is - completely independent from where they end up being installed, - this is all determined by the package description file. - </para> - </sect1> - <sect1 id="faq.flat-structure"> - <title> - Why a flat directory structure instead of a deep? - </title> - <titleabbrev> - Flat structure - </titleabbrev> - <simpara> - In CVS, PEAR code is organized by package instead of hierarchical - like it would finally be installed. For example, if you want to - use the XML_RPC class, you include "XML/RPC.php". It's easy to - think that in CVS, this file should be in pear/XML/RPC.php, but - that's not the case. XML_RPC is an independent package with its - own directory in CVS, in this case the RPC.php file is actually - located at pear/XML_RPC/RPC.php. The package description file - (package.xml) is used to say where the files should finally be - installed. - </simpara> - <simpara> - The reason CVS is organized this way is that it makes package - administration much easier. - </simpara> - </sect1> - <sect1 id="faq.unstable-code"> - <title> - Can I commit experimental/unstable stuff? - </title> - <titleabbrev> - Unstable code - </titleabbrev> - <para> - Yes. But make sure, that you mark up the experimental/unstable - status of the project in the documentation. The best place to do - this is in the <filename>package.xml</filename> in the - &lt;state&gt;-tag. - The values for this tag are - <variablelist> - <varlistentry> - <term>alpha</term> - <listitem> - <simpara> - early stages of development, all things could change (API, - behavoir) without notice, expect lots of bugs - </simpara> - </listitem> - </varlistentry> - <varlistentry> - <term>beta</term> - <listitem> - <simpara> - API should normally not change, usable software, expect bugs - </simpara> - </listitem> - </varlistentry> - <varlistentry> - <term>devel</term> - <listitem> - <simpara> - a release for other developers who want early access to test - and give feedback, code quality may vary from pre-alpha to - stable - </simpara> - </listitem> - </varlistentry> - <varlistentry> - <term>stable</term> - <listitem> - <simpara> - the software has a fixed <acronym>API</acronym>, it has - undergone tests, and documentation exists. This release is a - recommended release for use in production environments. - </simpara> - </listitem> - </varlistentry> - <varlistentry> - <term>snapshot</term> - <listitem> - <simpara> - a CVS snapshot from a certain date - </simpara> - </listitem> - </varlistentry> - </variablelist> - </para> - </sect1> - <sect1 id="faq.add-examples"> - <title> - Am I expected to add examples and/or test files to my package and - where to store them? - </title> - <titleabbrev> - Adding examples - </titleabbrev> - <para> - Examples are a good idea, especially when your class has a complex - API. But examples are only a part of a documentation. Don't create - examples instead of a documentation. You should store the - documentation and the examples in a sub directory 'docs' of the - package directory. - </para> - <para> - Test scripts are recommended when your class has to be compiled, - requires special extentions/programs or needs correctly installed - additional files (i.e. templates, graphics). Store them in sub - directory called 'tests'. - </para> - </sect1> - <sect1 id="faq.competitive-packages"> - <title> - Are different packages or classes with similar features allowed? - </title> - <titleabbrev> - Competitive code - </titleabbrev> - <simpara> - There is no problem with competitive packages, but we want to - avoid pollution with 10 template classes, 7 different mail classes, - and 3 different layers for databases doing the same only with - different function names. - </simpara> - <para> - First of all, do a reality check: Why do I want to commit a new - package? Really bad answers are <quote>To see my name in - PEAR</quote> or <quote>I didn't understand the API of the existing - class</quote>. - </para> - <para> - A good reason for a new class is often, that you are missing a - function, behaviour or speed in an existing implementation. In - this case, you should take a look at this class, if it possible - to extend this class. If not, then you have a good reason to - commit a new class. <quote>If not</quote> means, it isn't possible - to add the required functionality without changing the basics of - this class. - </para> - <simpara> - If you write a new class, try to keep API compatibility with - existing classes as far as possible! If it isn't possible to keep - the class compatible himself, try to create a wrapper class to - keep compatibility. Don't care, if this wrapper needs a lot of - time or memory, a wrapper class only has to keep compatibility and - make migration easier. - </simpara> - <para> - Committing a competitive class has to be announced on the <ulink url="mailto:&email.pear.dev;">PEAR developers mailinglist</ulink>! - </para> - </sect1> - <sect1 id="faq.question"> - <title> - I have a question about PEAR. Where should I ask? - </title> - <titleabbrev> - Asking questions - </titleabbrev> - <para> - <itemizedlist> - <listitem> - <para> - General questions about the usage of PEAR components - should be posted to the mailing list - <ulink url="mailto:&email.pear.general;">&email.pear.general;</ulink>. - </para> - </listitem> - <listitem> - <para> - All technical discussions concerning the development of PEAR - components should be posted to <ulink url="mailto:&email.pear.dev;"> - &email.pear.dev;</ulink>. - </para> - </listitem> - <listitem> - <para> - Question concerning the website can be sent to - <ulink url="mailto:&email.pear.webmaster;"> - &email.pear.webmaster;</ulink>. - </para> - </listitem> - </itemizedlist> - </para> - <para> - Information on subscribing this mailing lists can be found - <ulink url="&url.pear.support;">here</ulink>. - </para> - <para> - On all mailing lists mentioned above the language is english and - the way you ask questions should always be polite :-). - </para> - </sect1> - <sect1 id="faq.require"> - <title> - A required package includes a package, my package needs it too. - Should I include it again? - </title> - <para> - Yes. You should include every package, you need with - <function>require_once</function> or <function>include_once - </function>, also when it is included already by another package. - </para> - </sect1> - <sect1 id="faq.windows"> - <title> - Does PEAR work on windows? - </title> - <titleabbrev> - PEAR &amp; Windows - </titleabbrev> - <para> - To make PEAR work on Windows, you simple need to add the PEAR - installation dir (e.g. <filename>c:\php\pear</filename>) to the - include_path directive in your <filename>php.ini</filename>. - </para> - <simpara> - Note: There are some classes (like Schedule/At.php), that do not - work on Windows, because they use *nix specific commands. - </simpara> - </sect1> - <sect1 id="faq.licenses"> - <title> - What licenses are allowed in PEAR/PECL? - </title> - <titleabbrev> - Allowed licenses - </titleabbrev> - <para> - Currently PEAR supports the following list of licenses: - </para> - <itemizedlist> - <listitem> - <simpara> - PHP License - </simpara> - </listitem> - <listitem> - <simpara> - Apache License - </simpara> - </listitem> - <listitem> - <simpara> - LGPL - </simpara> - </listitem> - <listitem> - <simpara> - BSD style - </simpara> - </listitem> - <listitem> - <simpara> - MIT License - </simpara> - </listitem> - </itemizedlist> - <para> - Other licenses may be added to this list on a case-by-case - basis. Please get in touch with the <ulink url="mailto:&email.pear.dev;">PEAR developers mailing list</ulink> - for this. - </para> - <para> - The allowed licenses were chosen to allow integration into closed source, - open source as well as commercial applications. The only limitation is that - the original credits must stay in the sources. For LGPL the license additionally - requires that all changes to the source code must be licensed under the LGPL - to anyone the source is distributed to. - </para> - <para> - For PECL extensions that are linked into PHP, the license - must be compatible with the PHP license. That means you can not GPL - a PECL extension or you would be violating the GPL. Note also that if - you write an extension that links against a GPL'ed library you will be - violating the GPL. If you need to link against a GPL'ed library, get - permission from the author of the library to use the library under a - compatible license. - </para> - <para> - The license of any PEAR/PECL package can be found in the head of - all source code files, inside the &lt;license&gt; tag of the package - description file (<filename>package.xml</filename>) and also on the package - homepage. - </para> - </sect1> - <sect1 id="faq.tabs-vs-spaces"> - <title> - Why does the PEAR coding standard insist on space-only indentation? - </title> - <titleabbrev> - Tabs vs. Spaces - </titleabbrev> - <para> - Using spaces and avoiding tabs is the only way to ensure that a - piece of code is rendered consistently in all editors and viewers. - Many editors render tabs as 4 spaces, and a lot of editors, - terminal programs and utilities render tabs as 8 spaces. Example: - <literallayout><![CDATA[printf("%s", - $arg);]]></literallayout> - - Here, there are 7 spaces before "$arg". If this code was written - in an editor with 4-space tabs, it would store it as one tab and - three spaces. Now, if another developer edits the same file in an - editor with 8-space tabs, it will look like this: - - <literallayout><![CDATA[printf("%s", - $arg);]]></literallayout> - </para> - <para> - Likewise, consider this code written with 8-space tabs: - - <literallayout><![CDATA[ if ($foo && - $bar) { - }]]></literallayout> - - If viewed in a 4-space-tab editor, it will look like this: - - <literallayout><![CDATA[ if ($foo && - $bar) { - }]]></literallayout> - </para> - <simpara> - In a community like PEAR where people use lots of different - systems and editors, using tabs simply doesn't work. People will - end up doing whitespace commits fixing rendering in their editor, - while breaking it for others. - - With only spaces it will look the same to everyone. - </simpara> - <para> - Jamie Zawinski has written a - <ulink url="&url.tabs.vs.spaces;">piece on - the subject too</ulink>. - </para> - <para> - There is also a tool called <ulink url="&url.astyle;"> - Astyle</ulink> which can help you convert your code to the appropriate - style. - </para> - </sect1> - <sect1 id="faq.windows-build-out-of-date"> - <title> - go-pear.php or bundled packages in the windows build of PHP 4.3.x is out of date! - </title> - <titleabbrev> - PHP 4.3.x pear bundle out of date - </titleabbrev> - <para> - Unlike other aspects of PEAR development, the windows build of PHP 4.3.x is not tracked - in CVS. Instead, it is located on the machine that builds windows snapshots. Often, - this will not be updated when the rest of PEAR is updated. Note that PHP 5.x releases - use a different build system and are automatically updated to the latest versions of - PEAR. - </para> - <para> - If you find that PHP 4.3.x has out-of-date versions of packages, or no longer works, then - please report that the windows bundle of PEAR is out of date to &email.pear.dev; - </para> - </sect1> - <sect1 id="faq.translators-revision-tracking"> - <title> - Is there a tool to help PEAR manual translators to track files changes? - </title> - <titleabbrev> - Revision Tracking - </titleabbrev> - <para> - Working on the translations is not just translating an English file - and commiting the results. Much of the work is needed to update - the already translated ones, to get in sync with the content of - the English files. To follow the modifications in the English tree, - you should <ulink url="mailto:&email.pear.doc-subscribe;">subscribe to the PEAR - documentation mailing list</ulink> - to get CVS commit messages, or read the archives. If you never update your - files, the translations can get useless. - </para> - <simpara> - Updating a foreign language file can get difficult, as you may not - know when and who translated that file, so you may not know where - you should look for the updates needed. We have one system - for tracking the revisions and modification dates of the files in <literal>peardoc</literal>. - </simpara> - <sect2 id="faq.translators.revcheck-comments"> - <title>The Revision Comments</title> - <para> - Instead of storing all responsibilities in a central file, the revision - comment system stores them in the files they provide information about. - Information about translator, revision numbers, and status information - is stored in the revision comment. - Let's see what would be in the header of the example file - <filename>bookinfo.xml</filename> file in this case: - <programlisting> -&lt;!-- EN-Revision: 1.16 Maintainer: jane Status: ready --&gt; - </programlisting> - </para> - <para> - We can see the revision number for the last english file used to - update the translation (EN-Revision: 1.16), the translator cvs account - name. - But we can also add some other status information in the case it is - needed (eg. "partial" for incomplete translations). This revision - comment system is basically about storing the information in - the XML files, and not in a central place. This is extremely - convenient now, as there are more than 2400 files in the - English tree. - </para> - <para> - Currently, all three fields (English revision, Maintainer, Status) - are needed. Maintainer is intended to be a CVS user name, or some - nickname without a space, status can be anything without a space. - Note, that this header is not updated by CVS (in contrast with - <literal>$Revision</literal>, which is updated automatically). - This is only updated when you edit the contents of the comment - yourself. - </para> - <para> - You may see this as a good thing, but using these comments, - you lose the quick look on the whole list of your - files. - No, you do not lose this, but get much more! - If you would like to build a full list of you files, you - can go to the /peardoc/ directory and run: - <programlisting> -./scripts/revcheck_pear.php xx > revcheck.html - </programlisting> - Here <literal>xx</literal> is the imaginary language code. - After running this script you'll get a - <filename>revcheck.html</filename> in the same directory. - You can find revision comparisions and links to diffs - for all the files in this language. - You can also add a further restriction parameter, the maintainer name, - so the script will only list the files corresponding to - the given maintainer. - </para> - <para> - There are some optional extensions introduced for this script, - to be available in this generated HTML page. - This is why the <filename>translation.xml</filename> files are - introduced. - Here comes a simple <filename>translation.xml</filename> file - for the imaginary xx language : - <programlisting><![CDATA[ -<?xml version="1.0" encoding="iso-8859-1" ?> -<!DOCTYPE translation SYSTEM "../dtds/translation.dtd"> - -<translation> - - <intro> - This is some introductory text for the xx language translators - about who is the manager of the translation, and where to find - more information. This paragraph is printed on the top of the - generated revcheck.html page. - </intro> - - <translators> - <person name="Joe Doe" email="joe@hotmail.com" - nick="joedoe" cvs="yes" editor="yes"/> - <person name="Jane Smith" email="jsmith@yahoo.com" - nick="jane" cvs="yes"/> - <person name="Joe Forever" email="joe@forever.net" - nick="joefo" cvs="no"/> - </translators> - - <work-in-progress> - <file name="appendices/aliases.xml" person="joedoe" - type="working"/> - <file name="functions/dbx.xml" person="joefo" - type="working"/> - </work-in-progress> - -</translation> -]]></programlisting> - In this file, you can add users without a CVS account, and can - assign ready documents or work-in-progress files to them. - The biggest advantage of using this addon is that all this information - is used to generate dynamic tables of translators and files in - the <filename>revcheck.html</filename> file. - All translators are linked to from the individual files they are assigned - to, and there is a nice table showing the state of files for - all the translators. - Assigning ready files may be needed if a time consuming update is - in progress on that file. - </para> - <para> - There are two optional parameters you can add to a &lt;file&gt;, - if you would like to record it: the <literal>date</literal> - and <literal>revision</literal>. - Date is assumed to be the date when the work was started, revision - is the checked out revision of the English file used to start the work - (denoted as CO-Revision in the generated table). - There is currently no fixed format for the <literal>date</literal> - parameter. - </para> - <para> - Another addon to this system is just to give credit to all people - who worked on one file, and not just the current maintainer. To achieve - this goal, we added the credit comments. One credit comment in - eg. <filename>history.xml</filename> may look like this (in case - Joe Doe translated the file initially, but Jane followed him to - be the maintainer): - <programlisting> -&lt;!-- CREDITS: joedoe --&gt; - </programlisting> - The credits comment can contain a comma-separated list. These - comments only affect the display of the translators table in - <filename>revcheck.html</filename>. - </para> - </sect2> - </sect1> - <sect1 id="faq.ssl-certificate"> - <title> - Why does my browser show strange warnings when logging in to the website? - </title> - <titleabbrev> - SSL Certificate - </titleabbrev> - <para> - You are seeing the warnings because <literal>pear.php.net</literal> - uses a SSL key that is signed by <ulink url="&url.cacert;">CAcert</ulink>, - whose root certificate is unfortunately not bundled with most - browser. - </para> - <para> - If you are using a Mozilla browser, you can import the certificate - <ulink url="&url.cacert.mozilla;">on this site</ulink> by clicking - on the link <quote>Root Certificate (PEM Format)</quote>. When - asked if you want to trust the new Certificate Authority, you need - to check at least the <quote>Trust this CA to identify web sites.</quote> - box and click "Ok". - </para> - <para> - People using Internet Explorer may find help <ulink url="&url.cacert.ie;">here</ulink>. - </para> - <para> - Mac OS X users must download the above mentioned PEM file. The - certificate can then be imported with the <quote>Keychain Access</quote> - utility via <quote>Import</quote> in the <quote>File</quote> menu. - </para> - </sect1> - <sect1 id="faq.no-handlers"> - <title> - Why do I get "No handlers for package.xml version 2.0" when I try to - install a package? - </title> - <titleabbrev> - No handlers for package.xml version 2.0 - </titleabbrev> - <para> - You are using a PEAR version lower than 1.4.0. - </para> - <para> - To install the package, you have to update PEAR via: - </para> - <para> - <command>$ pear upgrade PEAR</command> - </para> - <para> - This will install the latest available version of PEAR which is capable of - installing packages that have only a package.xml version 2.0. - </para> - </sect1> - <sect1 id="faq.read-only-folders-windows"> - <title> - Installing into customized windows folders fails - </title> - <titleabbrev> - read-only isn't really read-only for customized windows folders - </titleabbrev> - <para> - To know that the folder has a customized view, Windows sets the - &quot;read-only&quot; attribute to the folder. The - &quot;read-only&quot; attribute is not actually used to control write - access. You can create files in a &quot;read-only&quot; folder. - <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;326549"> - http://support.microsoft.com/default.aspx?scid=kb;en-us;326549</ulink> - </para> - <para> - The PEAR Installer detects the read-only attribute and refuses to install - into these folders. Unfortunately, there is no way to distinguish between - customized folders and actual read-only folders on Windows. - </para> - <para> - The work-around is to avoid installing PEAR packages into customized - Windows folders. - </para> - </sect1> + &chapters.faq.users; + &chapters.faq.devs; + &chapters.faq.documentation; + &blankpagehack; </chapter> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/faq/devs.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/faq/devs.xml +++ peardoc/en/chapters/faq/devs.xml <?xml version="1.0" encoding="utf-8"?> <sect1 id="faq.devs"> <title>Developer FAQ</title> <sect2 id="faq.contributor"> <title> How do I become a PEAR contributor and/or how do I get CVS access to PEAR? </title> <titleabbrev> Becoming contributor </titleabbrev> <para> This is described <link linkend="developers.intro">here</link>. </para> </sect2> <sect2 id="faq.c-module"> <title> I have written a PHP module in C. What are the rules of including this in PEAR? </title> <titleabbrev> C-Modules </titleabbrev> <para> The <ulink url="&url.pecl;">PECL project</ulink> (a spin-off from PEAR) is the place where C extensions for PHP are published. </para> </sect2> <sect2 id="faq.separated"> <title> Why is PEAR separated into pear/ and pear-core/? </title> <titleabbrev> Why pear/ and pear-core/? </titleabbrev> <simpara> The first elements of PEAR were stored in the directory pear-core (once php-src/pear) and so they were bundled with each new PHP release. </simpara> <simpara> For future releases of PEAR this isn't workable because PEAR will become too big to be bundled with every release of PHP. So there was a decision to commit all new elements to an own top level directory pear. The other elements which are currently remaining in php-src/pear will be moved to the new top level directory soon. Only the PEAR package manager code will be bundled with every new release automatically. </simpara> </sect2> <sect2 id="faq.directory-structure"> <title> Why does the directory structure of pear/ and pear-core/ differ? </title> <titleabbrev> Why do pear/ and pear-core/ differ? </titleabbrev> <para> The directory structure of <filename>pear-core/</filename> matches that of the install tree (by default <filename>/usr/local/lib/php</filename>), and are organized as a simple hierarchy. However, the directory structure of <filename>pear/</filename> is based on what package the files belong to. Where files are located in each package directory is completely independent from where they end up being installed, this is all determined by the package description file. </para> </sect2> <sect2 id="faq.flat-structure"> <title> Why a flat directory structure instead of a deep? </title> <titleabbrev> Flat structure </titleabbrev> <simpara> In CVS, PEAR code is organized by package instead of hierarchical like it would finally be installed. For example, if you want to use the XML_RPC class, you include "XML/RPC.php". It's easy to think that in CVS, this file should be in pear/XML/RPC.php, but that's not the case. XML_RPC is an independent package with its own directory in CVS, in this case the RPC.php file is actually located at pear/XML_RPC/RPC.php. The package description file (package.xml) is used to say where the files should finally be installed. </simpara> <simpara> The reason CVS is organized this way is that it makes package administration much easier. </simpara> </sect2> <sect2 id="faq.unstable-code"> <title> Can I commit experimental/unstable stuff? </title> <titleabbrev> Unstable code </titleabbrev> <para> Yes. But make sure, that you mark up the experimental/unstable status of the project in the documentation. The best place to do this is in the <filename>package.xml</filename> in the &lt;state&gt;-tag. The values for this tag are <variablelist> <varlistentry> <term>alpha</term> <listitem> <simpara> early stages of development, all things could change (API, behavoir) without notice, expect lots of bugs </simpara> </listitem> </varlistentry> <varlistentry> <term>beta</term> <listitem> <simpara> API should normally not change, usable software, expect bugs </simpara> </listitem> </varlistentry> <varlistentry> <term>devel</term> <listitem> <simpara> a release for other developers who want early access to test and give feedback, code quality may vary from pre-alpha to stable </simpara> </listitem> </varlistentry> <varlistentry> <term>stable</term> <listitem> <simpara> the software has a fixed <acronym>API</acronym>, it has undergone tests, and documentation exists. This release is a recommended release for use in production environments. </simpara> </listitem> </varlistentry> <varlistentry> <term>snapshot</term> <listitem> <simpara> a CVS snapshot from a certain date </simpara> </listitem> </varlistentry> </variablelist> </para> </sect2> <sect2 id="faq.add-examples"> <title> Am I expected to add examples and/or test files to my package and where to store them? </title> <titleabbrev> Adding examples </titleabbrev> <para> Examples are a good idea, especially when your class has a complex API. But examples are only a part of a documentation. Don't create examples instead of a documentation. You should store the documentation and the examples in a sub directory 'docs' of the package directory. </para> <para> Test scripts are recommended when your class has to be compiled, requires special extentions/programs or needs correctly installed additional files (i.e. templates, graphics). Store them in sub directory called 'tests'. </para> </sect2> <sect2 id="faq.competitive-packages"> <title> Are different packages or classes with similar features allowed? </title> <titleabbrev> Competitive code </titleabbrev> <simpara> There is no problem with competitive packages, but we want to avoid pollution with 10 template classes, 7 different mail classes, and 3 different layers for databases doing the same only with different function names. </simpara> <para> First of all, do a reality check: Why do I want to commit a new package? Really bad answers are <quote>To see my name in PEAR</quote> or <quote>I didn't understand the API of the existing class</quote>. </para> <para> A good reason for a new class is often, that you are missing a function, behaviour or speed in an existing implementation. In this case, you should take a look at this class, if it possible to extend this class. If not, then you have a good reason to commit a new class. <quote>If not</quote> means, it isn't possible to add the required functionality without changing the basics of this class. </para> <simpara> If you write a new class, try to keep API compatibility with existing classes as far as possible! If it isn't possible to keep the class compatible himself, try to create a wrapper class to keep compatibility. Don't care, if this wrapper needs a lot of time or memory, a wrapper class only has to keep compatibility and make migration easier. </simpara> <para> Committing a competitive class has to be announced on the <ulink url="mailto:&email.pear.dev;">PEAR developers mailinglist</ulink>! </para> </sect2> <sect2 id="faq.require"> <title> A required package includes a package, my package needs it too. Should I include it again? </title> <para> Yes. You should include every package, you need with <function>require_once</function> or <function>include_once </function>, also when it is included already by another package. </para> </sect2> <sect2 id="faq.licenses"> <title> What licenses are allowed in PEAR/PECL? </title> <titleabbrev> Allowed licenses </titleabbrev> <para> Currently PEAR supports the following list of licenses: </para> <itemizedlist> <listitem> <simpara> PHP License </simpara> </listitem> <listitem> <simpara> Apache License </simpara> </listitem> <listitem> <simpara> LGPL </simpara> </listitem> <listitem> <simpara> BSD style </simpara> </listitem> <listitem> <simpara> MIT License </simpara> </listitem> </itemizedlist> <para> Other licenses may be added to this list on a case-by-case basis. Please get in touch with the <ulink url="mailto:&email.pear.dev;">PEAR developers mailing list</ulink> for this. </para> <para> The allowed licenses were chosen to allow integration into closed source, open source as well as commercial applications. The only limitation is that the original credits must stay in the sources. For LGPL the license additionally requires that all changes to the source code must be licensed under the LGPL to anyone the source is distributed to. </para> <para> For PECL extensions that are linked into PHP, the license must be compatible with the PHP license. That means you can not GPL a PECL extension or you would be violating the GPL. Note also that if you write an extension that links against a GPL'ed library you will be violating the GPL. If you need to link against a GPL'ed library, get permission from the author of the library to use the library under a compatible license. </para> <para> The license of any PEAR/PECL package can be found in the head of all source code files, inside the &lt;license&gt; tag of the package description file (<filename>package.xml</filename>) and also on the package homepage. </para> </sect2> <sect2 id="faq.tabs-vs-spaces"> <title> Why does the PEAR coding standard insist on space-only indentation? </title> <titleabbrev> Tabs vs. Spaces </titleabbrev> <para> Using spaces and avoiding tabs is the only way to ensure that a piece of code is rendered consistently in all editors and viewers. Many editors render tabs as 4 spaces, and a lot of editors, terminal programs and utilities render tabs as 8 spaces. Example: <literallayout><![CDATA[printf("%s", $arg);]]></literallayout> Here, there are 7 spaces before "$arg". If this code was written in an editor with 4-space tabs, it would store it as one tab and three spaces. Now, if another developer edits the same file in an editor with 8-space tabs, it will look like this: <literallayout><![CDATA[printf("%s", $arg);]]></literallayout> </para> <para> Likewise, consider this code written with 8-space tabs: <literallayout><![CDATA[ if ($foo && $bar) { }]]></literallayout> If viewed in a 4-space-tab editor, it will look like this: <literallayout><![CDATA[ if ($foo && $bar) { }]]></literallayout> </para> <simpara> In a community like PEAR where people use lots of different systems and editors, using tabs simply doesn't work. People will end up doing whitespace commits fixing rendering in their editor, while breaking it for others. With only spaces it will look the same to everyone. </simpara> <para> Jamie Zawinski has written a <ulink url="&url.tabs.vs.spaces;">piece on the subject too</ulink>. </para> <para> There is also a tool called <ulink url="&url.astyle;"> Astyle</ulink> which can help you convert your code to the appropriate style. </para> </sect2> </sect1> http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/faq/documentation.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/faq/documentation.xml +++ peardoc/en/chapters/faq/documentation.xml <?xml version="1.0" encoding="utf-8"?> <sect1 id="faq.documentation"> <title>Documentation/translation FAQ</title> <sect2 id="faq.docs-pagedoesnotshowup"> <title> I added some new package documentation, but the pages don't show up in the compiled manual! </title> <titleabbrev>New pages hidden</titleabbrev> <para> Most likely you forgot to <command>./configure</command> again. This will make sure that new pages are detected and included. </para> <para> Another reason could be that you did not add links in the parent page. In <filename>en/package/</filename> are the category xml files that contain links to the package documentation files. Add the link to your new pages there. </para> </sect2> <sect2 id="faq.docs-allonterminal"> <title> Compiling the manual shows it on the terminal, but does not generate files! </title> <titleabbrev>Manual echoed on console</titleabbrev> <para> <filename>configure</filename> did not find the Docbook DSSSL stylesheets. Install them first. </para> </sect2> <sect2 id="faq.translators-revision-tracking"> <title> Is there a tool to help PEAR manual translators to track files changes? </title> <titleabbrev> Revision Tracking </titleabbrev> <para> Working on the translations is not just translating an English file and commiting the results. Much of the work is needed to update the already translated ones, to get in sync with the content of the English files. To follow the modifications in the English tree, you should <ulink url="mailto:&email.pear.doc-subscribe;">subscribe to the PEAR documentation mailing list</ulink> to get CVS commit messages, or read the archives. If you never update your files, the translations can get useless. </para> <para> Updating a foreign language file can get difficult, as you may not know when and who translated that file, so you may not know where you should look for the updates needed. We have one system for tracking the revisions and modification dates of the files in <literal>peardoc</literal>. </para> <sect3 id="faq.translators.revcheck-comments"> <title>The Revision Comments</title> <para> Instead of storing all responsibilities in a central file, the revision comment system stores them in the files they provide information about. Information about translator, revision numbers, and status information is stored in the revision comment. Let's see what would be in the header of the example file <filename>bookinfo.xml</filename> file in this case: <programlisting> &lt;!-- EN-Revision: 1.16 Maintainer: jane Status: ready --&gt; </programlisting> </para> <para> We can see the revision number for the last english file used to update the translation (EN-Revision: 1.16), the translator cvs account name. But we can also add some other status information in the case it is needed (eg. "partial" for incomplete translations). This revision comment system is basically about storing the information in the XML files, and not in a central place. This is extremely convenient now, as there are more than 2400 files in the English tree. </para> <para> Currently, all three fields (English revision, Maintainer, Status) are needed. Maintainer is intended to be a CVS user name, or some nickname without a space, status can be anything without a space. Note, that this header is not updated by CVS (in contrast with <literal>$Revision</literal>, which is updated automatically). This is only updated when you edit the contents of the comment yourself. </para> <para> You may see this as a good thing, but using these comments, you lose the quick look on the whole list of your files. No, you do not lose this, but get much more! If you would like to build a full list of you files, you can go to the /peardoc/ directory and run: <programlisting>../scripts/revcheck_pear.php xx > revcheck.html </programlisting> Here <literal>xx</literal> is the imaginary language code. After running this script you'll get a <filename>revcheck.html</filename> in the same directory. You can find revision comparisions and links to diffs for all the files in this language. You can also add a further restriction parameter, the maintainer name, so the script will only list the files corresponding to the given maintainer. </para> <para> There are some optional extensions introduced for this script, to be available in this generated HTML page. This is why the <filename>translation.xml</filename> files are introduced. Here comes a simple <filename>translation.xml</filename> file for the imaginary xx language : <programlisting><![CDATA[ <?xml version="1.0" encoding="iso-8859-1" ?> <!DOCTYPE translation SYSTEM "../dtds/translation.dtd"> <translation> <intro> This is some introductory text for the xx language translators about who is the manager of the translation, and where to find more information. This paragraph is printed on the top of the generated revcheck.html page. </intro> <translators> <person name="Joe Doe" email="joe@hotmail.com" nick="joedoe" cvs="yes" editor="yes"/> <person name="Jane Smith" email="jsmith@yahoo.com" nick="jane" cvs="yes"/> <person name="Joe Forever" email="joe@forever.net" nick="joefo" cvs="no"/> </translators> <work-in-progress> <file name="appendices/aliases.xml" person="joedoe" type="working"/> <file name="functions/dbx.xml" person="joefo" type="working"/> </work-in-progress> </translation> ]]></programlisting> In this file, you can add users without a CVS account, and can assign ready documents or work-in-progress files to them. The biggest advantage of using this addon is that all this information is used to generate dynamic tables of translators and files in the <filename>revcheck.html</filename> file. All translators are linked to from the individual files they are assigned to, and there is a nice table showing the state of files for all the translators. Assigning ready files may be needed if a time consuming update is in progress on that file. </para> <para> There are two optional parameters you can add to a &lt;file&gt;, if you would like to record it: the <literal>date</literal> and <literal>revision</literal>. Date is assumed to be the date when the work was started, revision is the checked out revision of the English file used to start the work (denoted as CO-Revision in the generated table). There is currently no fixed format for the <literal>date</literal> parameter. </para> <para> Another addon to this system is just to give credit to all people who worked on one file, and not just the current maintainer. To achieve this goal, we added the credit comments. One credit comment in eg. <filename>history.xml</filename> may look like this (in case Joe Doe translated the file initially, but Jane followed him to be the maintainer): <programlisting> &lt;!-- CREDITS: joedoe --&gt; </programlisting> The credits comment can contain a comma-separated list. These comments only affect the display of the translators table in <filename>revcheck.html</filename>. </para> </sect3> </sect2> </sect1> http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/faq/users.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/faq/users.xml +++ peardoc/en/chapters/faq/users.xml <?xml version="1.0" encoding="utf-8"?> <sect1 id="faq.users"> <title>User FAQ</title> <sect2 id="faq.whatis"> <title> What is PEAR? </title> <para> This is described <link linkend="introduction">here</link>. </para> </sect2> <sect2 id="faq.noreleasesfound"> <title> How do I install a package when I get the error message &quot;No release with state equal to: 'stable' found for 'Packagename'&quot;? </title> <titleabbrev> No release with state equal to: 'stable' found for 'Packagename' </titleabbrev> <simpara> answer by Greg Beaver </simpara> <para> The package in question does have releases, but none that are stable. There are two solutions. </para> <para> <orderedlist> <listitem> <para> Set preferred_state to alpha or beta and then install </para> <para> <command>$ pear config-set preferred_state alpha</command> </para> <para> <command>$ pear install Packagename</command> </para> </listitem> <listitem> <para> Find out the stability or version number of the latest release and install it directly. </para> <para> <command>$ pear install Packagename-alpha</command> </para> <para> <command>$ pear install Packagename-1.5.3</command> </para> </listitem> </orderedlist> </para> </sect2> <sect2 id="faq.no-handlers"> <title> Why do I get "No handlers for package.xml version 2.0" when I try to install a package? </title> <titleabbrev> No handlers for package.xml version 2.0 </titleabbrev> <para> You are using a PEAR version lower than 1.4.0. </para> <para> To install the package, you have to update PEAR via: </para> <para> <command>$ pear upgrade PEAR</command> </para> <para> This will install the latest available version of PEAR which is capable of installing packages that have only a package.xml version 2.0. </para> </sect2> <sect2 id="faq.no-documentation"> <title> There is no end-user documentation for this package! How am I supposed to know how it works? </title> <titleabbrev> No package documentation </titleabbrev> <para> Even if not all packages do have end-user documentation in the PEAR manual, nearly all of the packages do include examples. The examples are automatically installed when you install a package via the command line installer and are located in <filename>$peardir/docs/$packagename/</filename>. </para> <para> You can find the example/documentation directory by executing <command>$ pear config-get doc_dir</command> on command line. </para> </sect2> <sect2 id="faq.question"> <title> I have a question about PEAR. Where should I ask? </title> <titleabbrev> Asking questions </titleabbrev> <para> <itemizedlist> <listitem> <para> General questions about the usage of PEAR components should be posted to the mailing list <ulink url="mailto:&email.pear.general;">&email.pear.general;</ulink>. </para> </listitem> <listitem> <para> All technical discussions concerning the development of PEAR components should be posted to <ulink url="mailto:&email.pear.dev;"> &email.pear.dev;</ulink>. </para> </listitem> <listitem> <para> Question concerning the website can be sent to <ulink url="mailto:&email.pear.webmaster;"> &email.pear.webmaster;</ulink>. </para> </listitem> </itemizedlist> </para> <para> Information on subscribing this mailing lists can be found <ulink url="&url.pear.support;">here</ulink>. </para> <para> On all mailing lists mentioned above the language is english and the way you ask questions should always be polite :-). </para> </sect2> <sect2 id="faq.windows"> <title> Does PEAR work on windows? </title> <titleabbrev> PEAR &amp; Windows </titleabbrev> <para> To make PEAR work on Windows, you simple need to add the PEAR installation dir (e.g. <filename>c:\php\pear</filename>) to the include_path directive in your <filename>php.ini</filename>. </para> <simpara> Note: There are some classes (like Schedule/At.php), that do not work on Windows, because they use *nix specific commands. </simpara> </sect2> <sect2 id="faq.windows-build-out-of-date"> <title> go-pear.php or bundled packages in the windows build of PHP 4.3.x is out of date! </title> <titleabbrev> PHP 4.3.x pear bundle out of date </titleabbrev> <para> Unlike other aspects of PEAR development, the windows build of PHP 4.3.x is not tracked in CVS. Instead, it is located on the machine that builds windows snapshots. Often, this will not be updated when the rest of PEAR is updated. Note that PHP 5.x releases use a different build system and are automatically updated to the latest versions of PEAR. </para> <para> If you find that PHP 4.3.x has out-of-date versions of packages, or no longer works, then please report that the windows bundle of PEAR is out of date to &email.pear.dev; </para> </sect2> <sect2 id="faq.ssl-certificate"> <title> Why does my browser show strange warnings when logging in to the website? </title> <titleabbrev> SSL Certificate </titleabbrev> <para> You are seeing the warnings because <literal>pear.php.net</literal> uses a SSL key that is signed by <ulink url="&url.cacert;">CAcert</ulink>, whose root certificate is unfortunately not bundled with most browser. </para> <para> If you are using a Mozilla browser, you can import the certificate <ulink url="&url.cacert.mozilla;">on this site</ulink> by clicking on the link <quote>Root Certificate (PEM Format)</quote>. When asked if you want to trust the new Certificate Authority, you need to check at least the <quote>Trust this CA to identify web sites.</quote> box and click "Ok". </para> <para> People using Internet Explorer may find help <ulink url="&url.cacert.ie;">here</ulink>. </para> <para> Mac OS X users must download the above mentioned PEM file. The certificate can then be imported with the <quote>Keychain Access</quote> utility via <quote>Import</quote> in the <quote>File</quote> menu. </para> </sect2> <sect2 id="faq.read-only-folders-windows"> <title> Installing into customized windows folders fails </title> <titleabbrev> read-only isn't really read-only for customized windows folders </titleabbrev> <para> To know that the folder has a customized view, Windows sets the &quot;read-only&quot; attribute to the folder. The &quot;read-only&quot; attribute is not actually used to control write access. You can create files in a &quot;read-only&quot; folder. <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;326549"> http://support.microsoft.com/default.aspx?scid=kb;en-us;326549</ulink> </para> <para> The PEAR Installer detects the read-only attribute and refuses to install into these folders. Unfortunately, there is no way to distinguish between customized folders and actual read-only folders on Windows. </para> <para> The work-around is to avoid installing PEAR packages into customized Windows folders. </para> </sect2> <sect2 id="faq.pearinhomedir"> <title> I've got an old installation of PEAR and don't have the permissions to install a new version - what now? </title> <titleabbrev> Installing PEAR in your home directory </titleabbrev> <para> If <command>$ which pear</command> gives you something like <filename>/usr/local/bin/pear</filename> and <command>$ pear -v</command> shows a very old version or if you don't want to use it for other reasons, you have to install PEAR in your home directory. </para> <para> Go to http://go-pear.org, save as <filename>gopear.php</filename> and do <command>$ php gopear.php</command> or try <command>$ lynx -source http://pear.php.net/go-pear | php -q</command>. </para> <para> Use <filename>/home/user/pear</filename> as prefix while installing PEAR, where user is your username. </para> <para> Once the installation is done, edit your PATH variable to include your planned new PEAR directory <emphasis>before</emphasis> the old one. </para> <para> For example put a <command>export PATH=/home/user/pear/bin:$PATH</command> at the end of your <filename>~/.bashrc</filename> or <filename>~/.profile</filename> under Linux. <command>$ echo $PATH</command> should give you now <filename>/home/user/pear/bin:[...]</filename> </para> <para> <command>$ which pear</command> should result in <filename>/home/user/pear/bin/pear</filename> and <command>$ pear -v</command> something like "PEAR Version: 1.4.8" (at the time of writing) or newer. Check the latest stable version at http://pear.php.net/package/PEAR under <emphasis>Current Release</emphasis>. </para> <para> Now all you need is to set your <emphasis>include_path</emphasis> correctly, most likely via <programlisting role="php"> <![CDATA[ <?php $path = ini_get('include_path'); ini_set('include_path', '/home/user/pear'.PATH_SEPARATOR.$path); ?> ]]> </programlisting> </para> </sect2> </sect1>
« previous php.pear.doc (#9058) next »