Commit 5db31475 by Scott Vivian

Add autoloader

Loosely follows PSR-0.
Requires classes of the form Q2A_<Namespace>_<Class>, e.g. Q2A_Util_String
Maps to file qa-include/Q2A/<Namespace>/<Class>.php, e.g. qa-include/Q2A/Util/String.php
parent 20d6cf6f
......@@ -28,6 +28,17 @@
define('QA_VERSION', '1.7.0-alpha1'); // also used as suffix for .js and .css requests
define('QA_BUILD_DATE', '2014-03-20');
// Autoloader for Q2A classes
function qa_autoload($class)
{
if (strpos($class, 'Q2A_') === 0)
require QA_INCLUDE_DIR . strtr($class, '_', '/') . '.php';
}
spl_autoload_register('qa_autoload');
// Execution section of this file - remainder contains function definitions
qa_initialize_php();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment