public static function setUpBeforeClass()
 {
     // setup static configuration resource path for test purposes
     RootClassLoader::addLoader(new StandardClassLoader(self::TEST_VENDOR, __DIR__ . '/' . self::CONFIG_ROOT_FOLDER));
     // setup configuration provider for this test
     $provider = new PhpConfigurationProvider();
     $provider->setOmitContext(true);
     $provider->setOmitConfigSubFolder(true);
     ConfigurationManager::registerProvider('php', $provider);
 }
 public static function setUpBeforeClass()
 {
     // setup static configuration resource path for test purposes
     RootClassLoader::addLoader(new StandardClassLoader(self::TEST_VENDOR, __DIR__ . '/test-config'));
     // setup configuration provider for this test (remember previous one)
     self::$originalProvider = ConfigurationManager::retrieveProvider('ini');
     $provider = new IniConfigurationProvider();
     $provider->setOmitContext(true);
     $provider->setOmitConfigSubFolder(true);
     ConfigurationManager::registerProvider('ini', $provider);
 }
 public static function setUpBeforeClass()
 {
     // setup static configuration resource path for test purposes
     RootClassLoader::addLoader(new StandardClassLoader(self::TEST_VENDOR, __DIR__ . '/' . self::CONFIG_ROOT_FOLDER));
     // setup configuration provider for this test
     /* @var $provider IniConfigurationProvider */
     $provider = ConfigurationManager::retrieveProvider('ini');
     // store for further re-store
     self::$originalIniProvider = $provider;
     $provider->setOmitContext(true);
     $provider->setOmitConfigSubFolder(true);
     ConfigurationManager::registerProvider('ini', $provider);
 }
 public function setUp()
 {
     // register config-only class loader
     $this->configRootPath = dirname(__FILE__) . '/config';
     RootClassLoader::addLoader(new StandardClassLoader(self::VENDOR_NAME, null, $this->configRootPath));
 }
Exemple #5
0
 protected function setUp()
 {
     RootClassLoader::addLoader(new StandardClassLoader(self::VENDOR, self::SOURCE_PATH));
 }
Exemple #6
0
// In case of symlink usage or multi-project installation, you can define it manually.         //
/////////////////////////////////////////////////////////////////////////////////////////////////
if (!isset($apfClassLoaderRootPath)) {
    $apfClassLoaderRootPath = str_replace('/core', '', str_replace('\\', '/', dirname(__FILE__)));
}
// Manual definition of the configuration root path allows separation of APF source and configuration
// files. By default, configuration files reside under the same root folder.
if (!isset($apfClassLoaderConfigurationRootPath)) {
    $apfClassLoaderConfigurationRootPath = $apfClassLoaderRootPath;
}
// include the class loader
include_once dirname(__FILE__) . '/loader/ClassLoader.php';
include_once dirname(__FILE__) . '/loader/StandardClassLoader.php';
include_once dirname(__FILE__) . '/loader/RootClassLoader.php';
// register class loader before including/configuring further elements
\APF\core\loader\RootClassLoader::addLoader(new \APF\core\loader\StandardClassLoader('APF', $apfClassLoaderRootPath, $apfClassLoaderConfigurationRootPath));
spl_autoload_register(['\\APF\\core\\loader\\RootClassLoader', 'load']);
// register the APF error handler to be able to easily configure the error handling mechanism
GlobalExceptionHandler::registerExceptionHandler(new DefaultExceptionHandler());
GlobalExceptionHandler::enable();
// let PHP raise and display all errors to be able to handle them suitable by the APF error handler.
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('html_errors', 'off');
// register the APF error handler to be able to easily configure the error handling mechanism
GlobalErrorHandler::registerErrorHandler(new DefaultErrorHandler());
GlobalErrorHandler::enable();
// Define base parameters of the framework's core and tools layer
Registry::register('APF\\core', 'Environment', 'DEFAULT');
Registry::register('APF\\core', 'InternalLogTarget', 'apf');
Registry::register('APF\\core', 'Charset', 'UTF-8');