rfc:spl-namespace

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
Next revisionBoth sides next revision
rfc:spl-namespace [2008/07/21 15:19] baptiste750rfc:spl-namespace [2008/07/21 15:29] baptiste750
Line 23: Line 23:
 === Use with spl_autoload === === Use with spl_autoload ===
  
-After a ''spl_namespace($namespace, $path)'', all subsequent ''spl_autoload(...)'' that refer to $namespace will change-dir to $path.+After a ''spl_namespace($namespace, $path)'', all subsequent ''spl_autoload(...)'' that refer to $namespace will include the class file by **changing directory** to $path.
  
 <code php> <code php>
Line 31: Line 31:
 </code> </code>
  
-But ''spl_autoload'' will then not only require the file, it will also prefix all the user classes/interfaces inside, with the namespace provided (''Foo1::Foo2::'').+But ''spl_autoload'' will then not only require the file, it will also **prefix** all the user classes/interfaces inside, with the namespace provided (''Foo1::Foo2::'').
  
 So, taking the example above, if MyClass.php contains: So, taking the example above, if MyClass.php contains:
Line 56: Line 56:
 === Use with spl_autoload_register === === Use with spl_autoload_register ===
  
-The behaviour is the same, except that, just before executing the callback function, the parser changes directory to the physical path of the namespace.+The behaviour is the same, except that, just before executing the callback function, the parser **changes directory** to the physical path of the namespace.
  
 <code php> <code php>
Line 90: Line 90:
 ==== Drawbacks  ==== ==== Drawbacks  ====
  
-  * If an autoloader, for a given classname, includes a different file according to the value of a global variable, there's no longer unicity+  * If an autoloader, for a given classname, includes a different file depending on the value of a global variable, there's no longer unicity
  
   * ...   * ...
rfc/spl-namespace.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1