pear:rfc:pear2_standards

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pear:rfc:pear2_standards [2009/09/21 13:25] – update example based on namespaced class name ashnazgpear:rfc:pear2_standards [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 236: Line 236:
 The only exception to this rule is the Base Package Exception Interface, which is specifically required to be named "vendor\Package\Exception" rather than "vendor\Package\ExceptionInterface". The only exception to this rule is the Base Package Exception Interface, which is specifically required to be named "vendor\Package\Exception" rather than "vendor\Package\ExceptionInterface".
  
-==== Package Naming convention ==== +
-A package naming rule may potentially be added to these standards, if the [[pear/rfc/pear2_naming_standards]] RFC is adopted.+
  
 ==== Base Exception interface ==== ==== Base Exception interface ====
Line 289: Line 288:
  require_once 'PEAR2/Autoload.php';  require_once 'PEAR2/Autoload.php';
  try {  try {
-     $p = new PEAR2\PackageName\Foo();+     $p = new \PEAR2\PackageName\Foo();
      $p->run('bar');      $p->run('bar');
- } catch (PEAR2\PackageName\Exception $e) {+ } catch (\PEAR2\PackageName\Exception $e) {
      echo "Caught exception from PEAR2\\PackageName";      echo "Caught exception from PEAR2\\PackageName";
  }  }
Line 312: Line 311:
    ...    ...
    // retrieve data from info.txt    // retrieve data from info.txt
-   $info = file_get_contents(dirname(__FILE__) . '../../../data/pear2.php.net/PEAR2_PackageName/info.txt');+   $info = file_get_contents(dirname(__FILE__) . '/../../../data/pear2.php.net/PEAR2_PackageName/info.txt');
    ?>    ?>
  
pear/rfc/pear2_standards.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1