Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: UnionOfRAD/lithium
...
head fork: UnionOfRAD/lithium
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 24 additions and 0 deletions.
  1. +3 −0  composer.json
  2. +21 −0 core/Libraries.php
3  composer.json
View
@@ -18,5 +18,8 @@
"require": {
"php": ">=5.3.6",
"composer/installers": "dev-master"
+ },
+ "autoload": {
+ "psr-0": {"lithium\\": "/" }
}
}
21 core/Libraries.php
View
@@ -72,6 +72,13 @@ class Libraries {
protected static $_configurations = array();
/**
+ * A Composer-compatible SPL autoloader implementation.
+ *
+ * @var object
+ */
+ protected static $_loader = null;
+
+ /**
* Contains a cascading list of search path templates, indexed by base object type.
*
* Used by `Libraries::locate()` to perform service location. This allows new types of
@@ -337,6 +344,20 @@ protected static function _configure($config) {
}
/**
+ * Configures dependency libraries using Composer's generated autoloader to introspect
+ * dependencies.
+ *
+ * @param string $file A Composer-generated autoload file, which returns a PSR-0-compatible
+ * autloader instance.
+ */
+ public static function loadConfig($file) {
+ if (static::$_loader) {
+ throw new ConfigException("Class loader already configured.");
+ }
+ static::$_loader = require $file;
+ }
+
+ /**
* Allows library information to be retrieved in various ways, including:
*
* By name:

No commit comments for this range

Something went wrong with that request. Please try again.