/** * Test CC paths */ public function testPaths() { // check return $this->assertTrue(is_array(\ClanCats::paths())); // add a path ClanCats::paths(array('phpunittest' => CCROOT . 'phpunit/')); // check define $this->assertEquals(CCROOT . 'phpunit/', PHPUNITTESTPATH); // check array $this->assertTrue(in_array('phpunittest', array_keys(\ClanCats::paths()))); }
/** * print information about this application * * @param array $params */ public function action_info($params) { $app = \ClanCats::runtime(); // print the app name $this->line(\CCForge_Php::make('comment', $app::$name . PHP_EOL . "*" . PHP_EOL . "Running on ClanCatsFramework " . \ClanCats::VERSION . PHP_EOL . "© 2010 - " . date('Y') . " ClanCats GmbH" . PHP_EOL), 'cyan'); // list printer $list = function ($array) { foreach ($array as $key => $value) { $this->line($key . ': ' . CCCli::color($value, 'green')); } }; // print info $list(array('Runtime Class' => $app, 'CCF Version' => \ClanCats::version(), 'CCF Environment' => \ClanCats::environment(), 'Development env' => var_export(\ClanCats::in_development(), true), 'File extention' => EXT, 'Core namespace' => CCCORE_NAMESPACE)); // paths $this->line(PHP_EOL . "Paths", 'cyan'); $list(\ClanCats::paths()); // paths $this->line(PHP_EOL . "Directories", 'cyan'); $list(\ClanCats::directories()); // autoloader $this->line(PHP_EOL . "Autoloader - namespaces", 'cyan'); $list(\CCFinder::$namespaces); }
* error reporting *--------------------------------------------------------------- * * Because we got now our nice own error handlers we don't wont * that PHP itself prints any errors directly to the user. */ error_reporting(-1); /* *--------------------------------------------------------------- * pass the paths and directories *--------------------------------------------------------------- * * CCF wants to know wich paths and directories are registerd * so we pass the initinal param to the CCF object. */ ClanCats::paths($paths, false); ClanCats::directories($directories, false); unset($paths, $directories); /* *--------------------------------------------------------------- * environment setup *--------------------------------------------------------------- * * In CCF 1.0 we used a $_SERVER environment variable to set the * current CCF environment. This works great if you are abel to * change the server conf. But often people dont have access to * the configurations. * So after doing multiple projects came to the * conclusion that the framework itself should detect the * environent using the hostname or other params. */