/** * 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); }
/** * the index function is just "function <controller_name>Index() {}" */ public function action_index() { $this->theme->topic = "Willkommen"; $this->view = $this->theme->view('welcome', array('runtime_name' => ClanCats::runtime('name'), 'environment' => ClanCats::environment())); }
/** * Test CC runtime */ public function testRuntime() { $this->assertTrue(!is_null(\ClanCats::runtime())); }
<?php /* *--------------------------------------------------------------- * Mail configuration *--------------------------------------------------------------- */ return array('transporter' => array('main' => array('driver' => 'sendmail', 'path' => '/usr/sbin/sendmail')), 'disabled' => false, 'layout' => null, 'catch_all' => array('enabled' => false, 'addresses' => array(), 'transporter' => null), 'bcc' => array(), 'from' => array('*****@*****.**', ClanCats::runtime('name')));
/** * start the ccf lifecycle * * this method sets the current environment, loads the configuration * and wakes the application * * @param string $environment * @return void */ public static function wake($environment) { if (!is_null(static::$environment)) { throw new CCException("ClanCats::wake - you cannot wake the application twice."); } // set environment static::$environment = $environment; // load the main configuration static::$config = CCConfig::create('main'); // setup the application error tables CCError_Inspector::info_callback('ClanCatsFramework', function () { return array('Runtime Class' => \ClanCats::runtime(), 'CCF Version' => \ClanCats::version(), 'CCF Environment' => \ClanCats::environment(), 'Development env' => var_export(\ClanCats::in_development(), true), 'File extention' => EXT, 'Core namespace' => CCCORE_NAMESPACE); }); CCError_Inspector::info_callback('CCF Paths', array('ClanCats', 'paths')); CCError_Inspector::info_callback('CCF Directories', array('ClanCats', 'directories')); CCError_Inspector::info_callback('Namespaces', function () { return \CCFinder::$namespaces; }); }
<?php /* *--------------------------------------------------------------- * Mail configuration *--------------------------------------------------------------- */ return array('transporter' => array('main' => array('driver' => 'array'), 'alias' => 'main'), 'disabled' => false, 'layout' => 'CCUnit::mail', 'catch_all' => array('enabled' => false, 'addresses' => array(), 'transporter' => null), 'bcc' => array(), 'from' => array('*****@*****.**', ClanCats::runtime('name')));
<?php /** * CCFTheme default configuration */ return array('default' => array('topic' => 'no title', 'title' => '%s | ' . ClanCats::runtime('name'), 'description' => 'Change your default description under theme.config -> defatul.description.', 'sidebar' => false));