Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: UnionOfRAD/lithium
...
head fork: UnionOfRAD/lithium
Checking mergeability… Don't worry, you can still create the pull request.
  • 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
View
3  composer.json
@@ -18,5 +18,8 @@
"require": {
"php": ">=5.3.6",
"composer/installers": "dev-master"
+ },
+ "autoload": {
+ "psr-0": {"lithium\\": "/" }
}
}
View
21 core/Libraries.php
@@ -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.