summaryrefslogtreecommitdiff
path: root/vendor/OAuth/Common/AutoLoader.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-04 21:33:05 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-04 21:33:05 -0500
commit135b921db75da5995eab7e36393ecd4d2b0bc66f (patch)
tree46efc60fcf1f9d5c57ab1fb9418c2acfbda0698a /vendor/OAuth/Common/AutoLoader.php
parent850645dd6b22f5b495d1680e0b49540e0ebf9bd3 (diff)
Switch to composer
Diffstat (limited to 'vendor/OAuth/Common/AutoLoader.php')
-rwxr-xr-xvendor/OAuth/Common/AutoLoader.php81
1 files changed, 0 insertions, 81 deletions
diff --git a/vendor/OAuth/Common/AutoLoader.php b/vendor/OAuth/Common/AutoLoader.php
deleted file mode 100755
index 9fe7951c..00000000
--- a/vendor/OAuth/Common/AutoLoader.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-
-namespace OAuth\Common;
-
-/**
- * PSR-0 Autoloader
- *
- * @author ieter Hordijk <info@pieterhordijk.com>
- */
-class AutoLoader
-{
- /**
- * @var string The namespace prefix for this instance.
- */
- protected $namespace = '';
-
- /**
- * @var string The filesystem prefix to use for this instance
- */
- protected $path = '';
-
- /**
- * Build the instance of the autoloader
- *
- * @param string $namespace The prefixed namespace this instance will load
- * @param string $path The filesystem path to the root of the namespace
- */
- public function __construct($namespace, $path)
- {
- $this->namespace = ltrim($namespace, '\\');
- $this->path = rtrim($path, '/\\') . DIRECTORY_SEPARATOR;
- }
-
- /**
- * Try to load a class
- *
- * @param string $class The class name to load
- *
- * @return boolean If the loading was successful
- */
- public function load($class)
- {
- $class = ltrim($class, '\\');
-
- if (strpos($class, $this->namespace) === 0) {
- $nsparts = explode('\\', $class);
- $class = array_pop($nsparts);
- $nsparts[] = '';
- $path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
- $path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
-
- if (file_exists($path)) {
- require $path;
-
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Register the autoloader to PHP
- *
- * @return boolean The status of the registration
- */
- public function register()
- {
- return spl_autoload_register(array($this, 'load'));
- }
-
- /**
- * Unregister the autoloader to PHP
- *
- * @return boolean The status of the unregistration
- */
- public function unregister()
- {
- return spl_autoload_unregister(array($this, 'load'));
- }
-}