예제 #1
0
 public static function tearDownAfterClass()
 {
     // restore previous configuration provider to not disturb other tests
     ConfigurationManager::registerProvider('ini', self::$originalProvider);
     // remove static configuration class loader used for test purposes only
     RootClassLoader::removeLoader(RootClassLoader::getLoaderByVendor(self::TEST_VENDOR));
 }
 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);
 }
 protected function tearDown()
 {
     // restore previous setup to not influence further tests
     ConfigurationManager::registerProvider('ini', $this->initialIniProvider);
 }
예제 #4
0
 /**
  * Initializes the configuration provider for file based statements.
  *
  * @author Christian Achatz
  * @version
  * Version 0.1, 02.02.2011<br />
  * Version 0.2, 04.02.2011 (Switched initialization to a more comfortable implementation)<br />
  */
 public function __construct()
 {
     $providers = ConfigurationManager::getRegisteredProviders();
     if (!in_array(self::$STATEMENT_FILE_EXTENSION, $providers)) {
         ConfigurationManager::registerProvider(self::$STATEMENT_FILE_EXTENSION, new StatementConfigurationProvider());
     }
 }
예제 #5
0
// 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');
// set up configuration provider to let the developer customize it later on
ConfigurationManager::registerProvider('ini', new IniConfigurationProvider());
// configure logger (outside namespace'd file! otherwise initialization will not work)
register_shutdown_function(function () {
    /* @var $logger Logger */
    $logger = Singleton::getInstance(Logger::class);
    $logger->flushLogBuffer();
});
// Set up default link scheme configuration. In case url rewriting is required, please
// specify another link scheme within your application bootstrap file.
LinkGenerator::setLinkScheme(new DefaultLinkScheme());
// Add the front controller filter that is a wrapper on the front controller's input
// filters concerning thr url rewriting configuration. In case rewriting is required,
// please specify another input filter within your application bootstrap file according
// to your url mapping requirements (e.g. use the ChainedUrlRewritingInputFilter included
// within the APF).
// As shipped, the APF does not define an output filter since "normal" url handling