From 71144c9e43d658afbd9eef0599f12a4e66cf53c1 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 26 Nov 2011 05:13:58 +0000 Subject: [PATCH] update docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319899 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/yaf/yaf-loader.xml | 72 +++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/reference/yaf/yaf-loader.xml b/reference/yaf/yaf-loader.xml index 4113c8a761..ea897956a8 100644 --- a/reference/yaf/yaf-loader.xml +++ b/reference/yaf/yaf-loader.xml @@ -12,8 +12,71 @@
&reftitle.intro; - + Yaf_Loader introduces a comprehensive autoloading + solution for Yaf. + + The first time an instance of Yaf_Application is retrieved, + Yaf_Loader will instance a singleton, and registers itself with + spl_autoload. You retrieve an instance using the Yaf_Loader::getInstance + + + + By default, Yaf_Loader assume all Class will store + in the global class + directory, which is defined in the php.ini(yaf.library). + + + + If you want Yaf_Loader search some Class in the + local class + directory(which is defined in application.ini, and by default, + it is APPLICATION_PATH . "/libraray"), you should register the class prefix using the + Yaf_Loader::registerLocalNameSpace + + + + +registerLocalNameSpace(array("Foo", "Bar")); + } +?> +]]> + + + then the autoload examples: + + + // APPLICATION_PATH/library/Foo/Bar/Test.php + +class GLO_Name => + // /global_dir/Glo/Name.php + +//as of PHP 5.3, you can use namespace +class \Foo\Bar\Dummy => + // APPLICATION_PATH/library/Foo/Bar/Dummy.php + +class \FooBar\Bar\Dummy => + // /global_dir/FooBar/Bar/Dummy.php +]]> + + + + + You may noticed that all the folder is Ucfisted, you can make them all + lowcase by set yaf.lowcase_path = On in php.ini +
@@ -71,7 +134,11 @@ _library - + + By default, this value is APPLICATION_PATH . "/library", you can change + this either in the application.ini(application.library) or call to + Yaf_Loader::setLibraryPath + @@ -92,6 +159,7 @@ + &reference.yaf.entities.yaf-loader;