Exemplo n.º 1
0
 /**
  * Checks if 
  * @param $method
  * @param array $params
  * @return mixed|null
  */
 public function __call($method, $params = array())
 {
     unset($method, $params);
     $config = b8\Config::getInstance();
     $state = (bool) $config->get('phpci.authentication_settings.state', false);
     return false !== $state;
 }
Exemplo n.º 2
0
    $message .= ' for Windows) before using console';
    file_put_contents('php://stderr', $message);
    exit(1);
}
// Load Composer autoloader:
require_once dirname(__FILE__) . '/vendor/autoload.php';
\PHPCI\ErrorHandler::register();
if (defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
    $loggerConfig = LoggerConfig::newFromFile(__DIR__ . "/loggerconfig.php");
}
// Load configuration if present:
$conf = array();
$conf['b8']['app']['namespace'] = 'PHPCI';
$conf['b8']['app']['default_controller'] = 'Home';
$conf['b8']['view']['path'] = dirname(__FILE__) . '/PHPCI/View/';
$config = new b8\Config($conf);
if (file_exists($configFile)) {
    $config->loadYaml($configFile);
}
/**
 * Allow to modify PHPCI configuration without modify versioned code.
 * Dameons should be killed to apply changes in the file.
 *
 * @ticket 781
 */
$localVarsFile = dirname(__FILE__) . '/local_vars.php';
if (is_readable($localVarsFile)) {
    require_once $localVarsFile;
}
require_once dirname(__FILE__) . '/vars.php';
\PHPCI\Helper\Lang::init($config);
Exemplo n.º 3
0
if (!file_exists($configFile)) {
    $configEnv = getenv('phpci_config_file');
    if (!empty($configEnv)) {
        $configFile = $configEnv;
    }
}
// If we don't have a config file at all, fail at this point and tell the user to install:
if (!file_exists($configFile) && (!defined('PHPCI_IS_CONSOLE') || !PHPCI_IS_CONSOLE)) {
    die('PHPCI has not yet been installed - Please use the command ./console phpci:install to install it.');
}
// If composer has not been run, fail at this point and tell the user to install:
if (!file_exists(dirname(__FILE__) . '/vendor/autoload.php') && defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
    file_put_contents('php://stderr', 'Please install PHPCI with "composer install" before using console');
    exit(1);
}
// Load Composer autoloader:
require_once dirname(__FILE__) . '/vendor/autoload.php';
if (defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
    $loggerConfig = LoggerConfig::newFromFile(__DIR__ . "/loggerconfig.php");
    Handler::register($loggerConfig->getFor('_'));
}
// Load configuration if present:
$conf = array();
$conf['b8']['app']['namespace'] = 'PHPCI';
$conf['b8']['app']['default_controller'] = 'Home';
$conf['b8']['view']['path'] = dirname(__FILE__) . '/PHPCI/View/';
$config = new b8\Config($conf);
if (file_exists($configFile)) {
    $config->loadYaml($configFile);
}
require_once dirname(__FILE__) . '/vars.php';
Exemplo n.º 4
0
* @copyright    Copyright 2013, Block 8 Limited.
* @license      https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link         http://www.phptesting.org/
*/
// Let PHP take a guess as to the default timezone, if the user hasn't set one:
date_default_timezone_set(@date_default_timezone_get());
// Set up a basic autoloader for PHPCI:
$autoload = function ($class) {
    $file = str_replace(array('\\', '_'), '/', $class);
    $file .= '.php';
    if (substr($file, 0, 1) == '/') {
        $file = substr($file, 1);
    }
    if (is_file(dirname(__DIR__) . '/' . $file)) {
        include dirname(__DIR__) . '/' . $file;
        return;
    }
};
spl_autoload_register($autoload, true, true);
// Load Composer autoloader:
require_once dirname(__DIR__) . '/vendor/autoload.php';
// Load configuration if present:
$conf = array();
$conf['b8']['app']['namespace'] = 'PHPCI';
$conf['b8']['app']['default_controller'] = 'Home';
$conf['b8']['view']['path'] = dirname(__DIR__) . '/PHPCI/View/';
if (file_exists(dirname(__DIR__) . '/PHPCI/config.yml')) {
    $config = new b8\Config($conf);
    $config->loadYaml(dirname(__DIR__) . '/PHPCI/config.yml');
}
require_once dirname(__DIR__) . '/vars.php';