public function install() { actions::invoke('database', array('initialize')); actions::invoke('database', array('import')); if (config::has('installer.class')) { $ic = config::get('installer.class'); $c = new $ic(); $c->install(); } }
function __construct($url) { if (config::has('lepton.services.thumbalizer.apikey')) { $this->apikey = config::get('lepton.services.thumbalizer.apikey'); } $this->cachedir = config::get('lepton.services.thumbalizer.cachedir', base::basePath() . 'cache'); if (!file_exists($this->cachedir)) { throw new ConfigurationException("Thumbalizer cache directory not found, define with lepton.services.thumbalizer.cachedir"); } }
/** * @description Saving/loading of database backed settings */ function dbprefs() { if (!config::has('lepton.db.default')) { $this->skip(); } $tf = $this->getTempFile(); $s = new DbPrefs('prefstest'); $this->assertNotNull($s); $s->foo = 'bar'; unset($s); $s = new DbPrefs('prefstest'); $this->assertNotNull($s); $this->assertEquals($s->foo, 'bar'); $s->destroy(); unset($s); // unlink('/tmp/jsonprefs.tmp'); }
if (php_sapi_name() == 'cli') { ModuleManager::load('lepton.base.application'); } function class_inherits($cn, $base) { if (!class_exists($cn)) { return false; } $rc = new ReflectionClass($cn); $pc = $rc->getParentClass(); if ($pc) { return $pc->name == $base; } return false; } if (config::has('lepton.db.tableprefix')) { define('LEPTON_DB_PREFIX', config::get('lepton.db.tableprefix')); } else { define('LEPTON_DB_PREFIX', ''); } class LeptonInstanceScopeWatcher { function __destruct() { Console::debugEx(LOG_BASIC, '(destructor)', "Memory allocated at shutdown: %0.3f KB (Total used: %0.3f KB, By code: %0.3f KB)", memory_get_usage() / 1024 / 1024, memory_get_usage(true) / 1024 / 1024, (memory_get_usage(true) - SYSTEM_INITIAL_MEMORY_USE) / 1024 / 1024); } } $__leptoninstancescope = new LeptonInstanceScopeWatcher(); using('s2s.requesthandler'); using('lepton.utils.rtoptimization'); RuntimeOptimization::enable();
public function hasValue($name) { return config::has('input.default.' . $name); }
public static function has($name) { return config::has($name); }