/** Initialize automatically the various components of the application according to the configuration data. @param $aConfig The configuration data for this application. */ public function __construct($aConfig) { $this->aConfig = $aConfig; // Add path to autoload // - All path are separated by : like in PATH environment variable // - A // in the path means ROOT_PATH if (!empty($this->aConfig['app.autoload.path'])) { $aPath = explode(':', $this->aConfig['app.autoload.path']); foreach ($aPath as $s) { weeAutoload::addPath(str_replace('//', ROOT_PATH, $s)); } } // Timezone settings if (!empty($this->aConfig['app.timezone'])) { date_default_timezone_set($this->aConfig['app.timezone']); } // Define the default error page from the configuration if (!empty($this->aConfig['app.error.default'])) { weeException::setErrorPage(str_replace('//', ROOT_PATH, $this->aConfig['app.error.default'])); } // Force selected drivers to start $aStart = $this->cnfArray('start'); foreach ($aStart as $sName => $b) { if (!empty($b)) { $this->__get($sName); } } }
entities back to characters. @param $sText The text to decode. @return string The decoded text. */ function xmlspecialchars_decode($sText) { return htmlspecialchars_decode(str_replace(''', ''', $sText), ENT_QUOTES); } // Core components /** Interface for mappable objects. Mappable are objects that can be mapped to an array using the toArray method. */ interface Mappable { public function toArray(); } /** Interface for printable objects. Printable objects are objects that can be converted to string using the toString method. We have to use this instead of __toString since we can't throw any exception in __toString... */ interface Printable { public function toString(); } require WEE_PATH . 'weeAutoload' . CLASS_EXT; weeAutoload::addPath(WEE_PATH); require WEE_PATH . 'exceptions/weeException' . CLASS_EXT;
<?php weeAutoload::addPath(dirname(__FILE__) . '/classes.inc'); weeAutoload::loadClass('weeAutoload_test'); $this->isTrue(class_exists('weeAutoload_test', false), _WT('weeAutoload::loadClass failed to load the given class even though the current directory is in the autoload paths.'));