Example #1
0
 /**
  * Unregister a collector
  * 
  * @param   string  $name
  */
 public function unregisterCollector($name)
 {
     $name = strtolower($name);
     $collectors = $this->app->config()->read('collectors');
     $collectors += $this->getCollectors();
     unset($collectors[$name]);
     $this->app->config()->write('collectors', $collectors);
 }
 public function initLanguage(Application $currentApp, $type)
 {
     if ($type === "default") {
         return $currentApp->config()->get(Enums\AppSettingKeys::DefaultLanguage);
     }
     if ($type === "browser") {
         return substr(strtok($_SERVER['HTTP_ACCEPT_LANGUAGE'], '?'), 0, 2);
     }
 }
Example #3
0
 public static function setConfig()
 {
     $config = array();
     // first defaults are loaded, then the custom configs
     require APP_DIR . DIRECTORY_SEPARATOR . 'config.default.php';
     if (file_exists(APP_DIR . DIRECTORY_SEPARATOR . 'config.php')) {
         require APP_DIR . DIRECTORY_SEPARATOR . 'config.php';
     }
     self::$config = new Zend_Config($config, array('allowModifications' => true));
     Zend_Registry::set('config', self::$config);
 }
 public static function run($configFile, $applicationEnv)
 {
     Loader::registerAutoload();
     self::$request = new Request();
     self::$response = new Response();
     include $configFile;
     self::$config = $config[$applicationEnv];
     StringHelper::setCryptKey(self::$config['crypt_key']);
     self::$db = new Db(self::$config['db']['params']);
     self::initView();
     self::startDispatch();
 }
Example #5
0
add_include_path($directoryPath . "constraints", false);
add_include_path($directoryPath . "login", false);
add_include_path($directoryPath . "logout", false);
add_include_path($directoryPath . "password_history", false);
add_include_path($directoryPath . "role_validity", false);
add_include_path($directoryPath . "roles", false);
add_include_path($directoryPath . "users", false);
add_include_path($directoryPath . "users_roles", false);
//Add lib for auth
add_include_path(__DIR__ . "/lib", false);
// Load the applications configuration file and define the home
require "app/config.php";
define("SOFTWARE_HOME", $config['home']);
// Add the script which contains the third party libraries
require "app/includes.php";
// Setup the global variables needed by the redirected packages
global $redirectedPackage;
global $packageSchema;
$selected = getenv('CFX_SELECTED_DATABASE') !== false ? getenv('CFX_SELECTED_DATABASE') : $selected;
// Setup the database driver and other boilerplate stuff
$dbDriver = $config['db'][$selected]['driver'];
$dbDriverClass = Application::camelize($dbDriver);
add_include_path(Application::getWyfHome("models/datastores/databases/{$dbDriver}"));
Db::$defaultDatabase = $selected;
SQLDBDataStore::$activeDriverClass = $dbDriverClass;
Application::$config = $config;
Application::$prefix = $config['prefix'];
Cache::init($config['cache']['method']);
define('CACHE_MODELS', $config['cache']['models']);
define('CACHE_PREFIX', "");
define('ENABLE_AUDIT_TRAILS', $config['audit_trails']);
Example #6
0
 /**
  * Write the file.
  * @param $path string | The path where the file is located.
  * @param $file string | The filename.
  * @param $content string | The file content.
  * @return string
  */
 public function write($path = '', $file = '', $content = '')
 {
     $the_path = Application::config()->public_folder() . '/' . $path;
     @mkdir($the_path, 0755, true);
     $this->write_to($the_path . '/' . $file, $content);
 }
Example #7
0
<?php

ob_start();
// -----
// Error displaying (comment the following to turn on error displaying)
error_reporting(0);
// Constants
define('ROOT_DIR', dirname(__FILE__));
// Imports
require_once 'lib/magic_quotes_fix.php';
require_once 'lib/autoload.php';
// Run the application
$application = new Application();
$application->config();
$response = $application->run(new Request());
$response->send();
// -----
ob_end_flush();
Example #8
0
 public function __construct()
 {
     $this->route = new Route();
     self::$config = new ConfigManager();
 }