2017 © Pedro Peláez
 

library autoloadr

PHP Autoload facilities

image

lalalab/autoloadr

PHP Autoload facilities

  • Monday, May 29, 2017
  • by rault-a
  • Repository
  • 2 Watchers
  • 0 Stars
  • 214 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

Autoladr

PSR-4 reminder :

  • The term "class" refers to classes, interfaces, traits, and other similar structures.
  • A fully qualified class name has the following form:, (*1)

    \<NamespaceName>(\<SubNamespaceNames>)*\<ClassName>, (*2)

  • When loading a file that corresponds to a fully qualified class name :, (*3)

    1. A contiguous series of one or more leading namespace and sub-namespace names, not including the leading namespace separator, in the fully qualified class name (a "namespace prefix") corresponds to at least one "base directory".
    2. The contiguous sub-namespace names after the "namespace prefix" correspond to a subdirectory within a "base directory", in which the namespace separators represent directory separators. The subdirectory name MUST match the case of the sub-namespace names.
    3. The terminating class name corresponds to a file name ending in .php. The file name MUST match the case of the terminating class name.
    4. Autoloader implementations MUST NOT throw exceptions, MUST NOT raise errors of any level, and SHOULD NOT return a value.

Universal Autoloadr :

Work as a common "ClassLoader" (PSR-0) as well
2.: The subdirectory name can be lowercase. It still MUST match the namespace names.
4.: No exeption, but use Loggr for debuging, (*4)

  • underscore in class_names: `, (*5)

    • \namespace\package\Class_Name matches /prefixe/path/to/namespace/package/Class/Name.php
    • \Mustache_Engine matches /prefixe/path/to/vendor/mustache/src/Mustache/Engine.php
  • underscore in namespace:, (*6)

    • \namespace\my_package\Class_Name matches /prefixe/path/to/namespace/my_package/Class/Name.php
  • Lower/Upper case :, (*7)

    • \Ahoy\Core\Request matches /path/to/project/ahoy/core/Request.php
      or /path/to/project/Ahoy/Core/Request.php

Exemple

    $Loadr = new \Autoloadr\Universal();

    $Loadr->add_prefix(_ROOT_DIR_ . '/vendor/knot/src');
    $Loadr->add_prefix(_ROOT_DIR_ . '/vendor/scoutr/src');
    $Loadr->add_prefix(_ROOT_DIR_ . '/vendor/mustache/src');

    $Loadr->register();

    $K = new Knot\Knot();
    $S = new Scoutr\Scout();
    $M = new Mustache_Engine();

The Versions

29/05 2017

dev-master

9999999-dev

PHP Autoload facilities

  Sources   Download

The Requires

 

by Alex Robert
by Adrien Rault

php autoload psr4 autoload-map

29/05 2017

1.0.3-stable

1.0.3.0

PHP Autoload facilities

  Sources   Download

The Requires

 

by Alex Robert
by Adrien Rault

php autoload psr4 autoload-map

29/07 2016

1.0.2-stable

1.0.2.0

PHP Autoload facilities

  Sources   Download

The Requires

  • php >=5.4

 

by Alex Robert

php autoload psr4 autoload-map

29/07 2016

1.0.1-stable

1.0.1.0

PHP Autoload facilities

  Sources   Download

The Requires

  • php >=5.4

 

by Alex Robert

php autoload psr4 autoload-map

29/07 2016

1.0.0

1.0.0.0

PHP Autoload facilities

  Sources   Download

The Requires

  • php >=5.4

 

by Alex Robert

php autoload psr4 autoload-map

15/07 2016

dev-develop

dev-develop

PHP Autoload facilities

  Sources   Download

The Requires

  • php >=5.4

 

by Alex Robert

php autoload psr4 autoload-map