[Pkg-owncloud-commits] [php-sabredav] 08/10: New autoloader

David Prévot taffit at moszumanska.debian.org
Sat Nov 30 15:44:15 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag version-1.0.15
in repository php-sabredav.

commit cda30b32576e096abda961d813a156215fa15d19
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Fri Apr 23 19:49:56 2010 +0900

    New autoloader
---
 ChangeLog                                      |  2 ++
 lib/Sabre.autoload.php                         | 19 +++----------------
 lib/{Sabre.autoload.php => Sabre/autoload.php} |  6 ++----
 3 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 17f8461..5d15a62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 1.0.15-stable (2010-05-??)
 	* Added: Issue 31: Hiding exception information by default. Can be turned
 	  on with the Sabre_DAV_Server::$debugExceptions property.
+	* Added: Moved autoload from lib/ to lib/Sabre/autoload.php. This is also
+	  the case in the upcoming 1.2.0, so it will improve future compatibility.
 
 1.0.14-stable (2010-04-15)
 	* Fixed: double namespace declaration in multistatus responses.
diff --git a/lib/Sabre.autoload.php b/lib/Sabre.autoload.php
index 8ec9c63..1c3815f 100644
--- a/lib/Sabre.autoload.php
+++ b/lib/Sabre.autoload.php
@@ -3,27 +3,14 @@
 /**
  * SabreDAV's PHP autoloader
  *
- * If you love the autoloader, and don't care as much about performance, this
- * file register a new autoload function using spl_autoload_register. 
+ * Warning: this file is deprecated. Please use Sabre/autoload.php instead.
  *
  * @package Sabre
  * @subpackage DAV
- * @version $Id$
  * @copyright Copyright (C) 2007-2010 Rooftop Solutions. All rights reserved.
  * @author Evert Pot (http://www.rooftopsolutions.nl/) 
+ * @deprecated
  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
  */
 
-function Sabre_DAV_autoload($className) {
-
-    if(strpos($className,'Sabre_')===0) {
-
-        include dirname(__FILE__) . '/' . str_replace('_','/',$className) . '.php';
-
-    }
-
-}
-
-spl_autoload_register('Sabre_DAV_autoload');
-
-?>
+include dirname(__FILE__) . '/Sabre/autoload.php';
diff --git a/lib/Sabre.autoload.php b/lib/Sabre/autoload.php
similarity index 84%
copy from lib/Sabre.autoload.php
copy to lib/Sabre/autoload.php
index 8ec9c63..13acfbd 100644
--- a/lib/Sabre.autoload.php
+++ b/lib/Sabre/autoload.php
@@ -8,13 +8,12 @@
  *
  * @package Sabre
  * @subpackage DAV
- * @version $Id$
  * @copyright Copyright (C) 2007-2010 Rooftop Solutions. All rights reserved.
  * @author Evert Pot (http://www.rooftopsolutions.nl/) 
  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
  */
 
-function Sabre_DAV_autoload($className) {
+function Sabre_autoload($className) {
 
     if(strpos($className,'Sabre_')===0) {
 
@@ -24,6 +23,5 @@ function Sabre_DAV_autoload($className) {
 
 }
 
-spl_autoload_register('Sabre_DAV_autoload');
+spl_autoload_register('Sabre_autoload');
 
-?>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list