Commit: 84c55fc6a5ad7ced7a4a15ffdb318d61ebea4b8f

Author: Nate Abele | Date: 2010-08-24 23:21:57 -0400
Modifying bootstrap to enable `lithium_qa` to be loaded as a plugin. Changing namespace from `app` to `lithium_qa`.
diff --git a/config/bootstrap.php b/config/bootstrap.php index 4304715..c2be1bc 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -6,31 +6,22 @@ * @license http://opensource.org/licenses/bsd-license.php The BSD License */ -namespace lithium; - -use \lithium\core\Environment; -use \lithium\core\Libraries; +use lithium\core\Environment; +use lithium\core\Libraries; /** - * This is the path to the class libraries used by your application, and must contain a copy of the - * Lithium core. By default, this directory is named 'libraries', and resides in the same - * directory as your application. If you use the same libraries in multiple applications, you can - * set this to a shared path on your server. + * Define core paths, if we are operating as an independent app. */ -define('LITHIUM_LIBRARY_PATH', dirname(dirname(__DIR__)) . '/libraries'); - -/** - * This is the path to your application's directory. It contains all the sub-folders for your - * application's classes and files. You don't need to change this unless your webroot folder is - * stored outside of your app folder. - */ -define('LITHIUM_APP_PATH', dirname(__DIR__)); +if (!defined('LITHIUM_LIBRARY_PATH')) { + define('LITHIUM_APP_PATH', dirname(__DIR__)); + define('LITHIUM_LIBRARY_PATH', dirname(dirname(__DIR__)) . '/libraries'); +} /** * Locate and load Lithium core library files. Throws a fatal error if the core can't be found. * If your Lithium core directory is named something other than 'lithium', change the string below. */ -if (!include LITHIUM_LIBRARY_PATH . '/lithium/core/Libraries.php') { +if (!include_once LITHIUM_LIBRARY_PATH . '/lithium/core/Libraries.php') { $message = "Lithium core could not be found. Check the value of LITHIUM_LIBRARY_PATH in "; $message .= "config/bootstrap.php. It should point to the directory containing your "; $message .= "/libraries directory."; @@ -38,30 +29,20 @@ if (!include LITHIUM_LIBRARY_PATH . '/lithium/core/Libraries.php') { } /** - * Optimize default request cycle by loading common classes. If you're implementing custom - * request/response or dispatch classes, you can safely remove these. Actually, you can safely - * remove them anyway, they're just there to give slightly you better out-of-the-box performance. - */ -require LITHIUM_LIBRARY_PATH . '/lithium/core/Object.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/core/StaticObject.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/util/Collection.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/util/collection/Filters.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/util/Inflector.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/util/Set.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/util/String.php'; -require LITHIUM_LIBRARY_PATH . '/lithium/core/Environment.php'; - -/** * Add the Lithium core library. This sets default paths and initializes the autoloader. You * generally should not need to override any settings. */ -Libraries::add('lithium'); +if (!Libraries::get('lithium')) { + Libraries::add('lithium'); +} /** * Add the application. You can pass a `'path'` key here if this bootstrap file is outside of * your main application, but generally you should not need to change any settings. */ -Libraries::add('app', array('default' => true)); +if (!Libraries::get('lithium_qa')) { + Libraries::add('lithium_qa', array('default' => true)); +} /** * Add libraries from submodules. diff --git a/extensions/command/BranchUpgrade.php b/extensions/command/BranchUpgrade.php index ce53ca0..2e86ffd 100644 --- a/extensions/command/BranchUpgrade.php +++ b/extensions/command/BranchUpgrade.php @@ -7,7 +7,7 @@ * @license http://opensource.org/licenses/bsd-license.php The BSD License */ -namespace app\extensions\command; +namespace lithium_qa\extensions\command; /** * When pushing a new version, cleans up all local version-dependent feature branches which are diff --git a/extensions/command/Syntax.php b/extensions/command/Syntax.php index bcdcb62..d4bde0e 100644 --- a/extensions/command/Syntax.php +++ b/extensions/command/Syntax.php @@ -7,7 +7,7 @@ * @license http://opensource.org/licenses/bsd-license.php The BSD License */ -namespace app\extensions\command; +namespace lithium_qa\extensions\command; use lithium\util\String; use spriebsch\PHPca\Application;