public function buildContent() { if (PsGlobals::inst()->exists()) { $PARAMS['exists'] = true; $PARAMS['props'] = PsGlobals::inst()->getProps(); } else { $PARAMS['exists'] = false; $PARAMS['path'] = ConfigIni::projectGlobalsFilePath(); } echo $this->getFoldedEntity()->fetchTpl($PARAMS); }
protected function executeImpl(ArrayAdapter $params) { $id = $params->str('id'); $type = $params->str('type'); $action = $params->str('action'); switch ($action) { case 'ccache': PSCache::inst()->clean(); break; case 'toggledev': PsGlobals::inst()->getProp('PS_PRODUCTION')->setValue(!PS_PRODUCTION); PsGlobals::inst()->save2file(); break; default: return 'Unknown action'; } return new AjaxSuccess(); }
/** * Включение/отключение профилирования */ public function setProfilingEnabled($isEnabled) { PsGlobals::inst()->getProp('PROFILING_ENABLED')->setValue($isEnabled); PsGlobals::inst()->save2file(); }
$i = 0; /** @var DirItem */ foreach ($scenarios as $sc) { ++$i; $scName = $sc->getNameNoExt(); dolog(''); dolog('STARTED SCENARIO: ' . $scName); $props = $sc->getFileAsProps(); $newGlobals = array_merge($PS_GLOBALS, $props); dolog('Set scenario global props: ' . print_r($props, true)); dolog('Full global props: ' . print_r($newGlobals, true)); PsGlobals::inst()->updateProps($props); dolog($i . ' scenario of ' . count($scenarios)); $RESULTS = doTest(); dolog('Test finished, restoring globals.'); PsGlobals::inst()->updateProps($PS_GLOBALS); $SC_RESULTS[$scName] = array('res' => $RESULTS, 'props' => $newGlobals); } } else { $RESULTS = doTest(); $SC_RESULTS = array('res' => $RESULTS); } $sm->stop(); dolog('RESULTS: ' . print_r($SC_RESULTS, true)); $params['time'] = str_replace('.', ',', round($sm->getTotalTime(), 2)); $params['total'] = $TOTAL; $params['host'] = $HOST; $params['rqcnt'] = $REQUESTS_CNT; $params['result'] = $SC_RESULTS; $params['usesc'] = $USE_SCENARIOS; /*
/** * Включение/отключение логирования */ public function setLoggingEnabled($isEnabled) { PsGlobals::inst()->getProp('LOGGING_ENABLED')->setValue($isEnabled); PsGlobals::inst()->save2file(); }
public function buildContent() { $PARAMS['props'] = PsGlobals::inst()->getProps(); echo $this->getFoldedEntity()->fetchTpl($PARAMS); }
foreach ($rootPages as $page) { $name = $page->getName(); if (in_array($name, $pages)) { dolog("+ {$name}"); } else { dolog("- {$name}"); $page->remove(); } } /* * УСТАНОВИМ КОНСТАНТЫ */ LOGBOX('Set consts'); $props = DirItem::inst(__DIR__, 'consts.txt')->getFileAsProps(); dolog(print_r($props, true)); PsGlobals::inst()->updateProps($props); /* * УДАЛИМ ТЕСТОВЫЕ ДИРЕКТОРИИ */ LOGBOX('Remove test dirs'); $dirs = DirManager::inst()->getDirContentFull(null, DirItemFilter::DIRS); $testDirNames = array('temp', 'orig', '4use', 'tests', 'testcase'); $testDirStartsWith = array('!'); /* @var $dir DirItem */ foreach ($dirs as $dir) { if (in_array($dir->getName(), $testDirNames) || starts_with($dir->getName(), $testDirStartsWith)) { $path = $dir->getAbsPath(); dolog('Removing: ' . $path); DirManager::inst($path)->clearDir(null, true); } }
protected function executeImpl(ArrayAdapter $params) { PsGlobals::inst()->updateProps($params->arr('globals')); return new AjaxSuccess(); }