public function headerAction() { try { $t = new Kwf_Util_Model_Welcome(); $row = $t->getRow(1); } catch (Zend_Db_Statement_Exception $e) { //wenn tabelle nicht existiert fehler abfangen $row = null; } if ($row && $row->getParentRow('LoginImage')) { $this->view->image = Kwf_Media::getUrlByRow($row, 'LoginImage'); $this->view->imageSize = Kwf_Media::getDimensionsByRow($row, 'LoginImage'); } else { $this->view->image = false; } if (Kwf_Registry::get('config')->allowUntagged === true) { if (file_exists('.git') && Kwf_Util_Git::web()->getActiveBranch() != 'production') { $this->view->untagged = true; } if (file_exists(KWF_PATH . '/.git') && Kwf_Util_Git::kwf()->getActiveBranch() != 'production/' . Kwf_Registry::get('config')->application->id) { $this->view->untagged = true; } } $this->view->application = Zend_Registry::get('config')->application->toArray(); $this->_helper->viewRenderer->setRender('loginheader'); }
public function indexAction() { $options = array('types' => $this->_getParam('type'), 'output' => !$this->_getParam('silent'), 'refresh' => true); if ($this->_getParam('skip-other-servers')) { $options['skipOtherServers'] = true; } if (is_string($this->_getParam('exclude-type'))) { $options['excludeTypes'] = $this->_getParam('exclude-type'); } Kwf_Util_ClearCache::getInstance()->clearCache($options); if (!$this->_getParam('skip-check-build') && Kwf_Config::getValue('application.id') != 'kwf') { if (!file_exists('build')) { echo "ERROR: build folder doesn't exist.\n"; } else { if (file_exists('build/version.json')) { $v = json_decode(file_get_contents('build/version.json')); foreach ($v as $k => $i) { if ($k == 'web') { if (!file_exists('.git')) { continue; } $git = Kwf_Util_Git::web(); } else { $repoName = "{$k}-lib"; if (!file_exists($repoName)) { echo "ERROR: can't find {$k}\n"; continue; } if (!file_exists($repoName . '/.git')) { continue; } $git = new Kwf_Util_Git($repoName); } if (isset($i->rev)) { if ($git->revParse('HEAD') != $i->rev) { echo "ERROR: {$k}: build version doesn't match git revision.\n"; continue; } } echo "OK: build folder is up to date for {$k}\n"; } } } } exit; }
public function indexAction() { $this->view->applicationName = Kwf_Config::getValue('application.name'); $this->view->brandingKoala = Kwf_Config::getValue('application.branding.koala'); $this->view->brandingVividPlanet = Kwf_Config::getValue('application.branding.vividPlanet'); $this->view->pages = Kwf_Registry::get('acl')->has('kwf_component_pages'); $this->view->baseUrl = Kwf_Setup::getBaseUrl(); $this->view->favicon = Kwf_View_Ext::getFavicon(); try { $t = new Kwf_Util_Model_Welcome(); $row = $t->getRow(1); } catch (Zend_Db_Statement_Exception $e) { //wenn tabelle nicht existiert fehler abfangen $row = null; } if ($row && ($fileRow = $row->getParentRow('LoginImage'))) { $this->view->image = Kwf_Media::getUrlByRow($row, 'LoginImageLarge', 'login'); $this->view->imageSize = Kwf_Media_Image::calculateScaleDimensions($fileRow->getImageDimensions(), Kwf_Util_Model_Welcome::getImageDimensions('LoginImageLarge')); } else { $this->view->image = false; } if (Kwf_Registry::get('config')->allowUntagged === true) { if (file_exists('.git') && Kwf_Util_Git::web()->getActiveBranch() != 'production') { $this->view->untagged = true; } if (file_exists(KWF_PATH . '/.git') && Kwf_Util_Git::kwf()->getActiveBranch() != 'production/' . Kwf_Registry::get('config')->application->id) { $this->view->untagged = true; } } $this->view->contentScript = $this->getHelper('viewRenderer')->getViewScript('login'); $this->view->lostPasswordLink = $this->getFrontController()->getRouter()->assemble(array('controller' => 'login', 'action' => 'lost-password'), 'kwf_user'); $this->view->redirects = array(); $users = Zend_Registry::get('userModel'); foreach ($users->getAuthMethods() as $k => $auth) { if ($auth instanceof Kwf_User_Auth_Interface_Redirect && $auth->showInBackend()) { $url = $this->getFrontController()->getRouter()->assemble(array('controller' => 'backend-login', 'action' => 'redirect'), 'kwf_user'); $label = $auth->getLoginRedirectLabel(); $this->view->redirects[] = array('url' => $url, 'authMethod' => $k, 'redirect' => $_SERVER['REQUEST_URI'], 'name' => Kwf_Trl::getInstance()->trlStaticExecute($label['name']), 'icon' => isset($label['icon']) ? '/assets/' . $label['icon'] : false, 'formOptions' => Kwf_User_Auth_Helper::getRedirectFormOptionsHtml($auth->getLoginRedirectFormOptions())); } } parent::indexAction(); }
public static function getAuthorEnvVars() { return "GIT_AUTHOR_NAME=" . escapeshellarg(Kwf_Util_Git::getAuthorName()) . " GIT_AUTHOR_EMAIL=" . escapeshellarg(Kwf_Util_Git::getAuthorEMail()) . " GIT_COMMITTER_NAME=" . escapeshellarg(Kwf_Util_Git::getCommitterName()) . " GIT_COMMITTER_EMAIL=" . escapeshellarg(Kwf_Util_Git::getCommitterEMail()); }
public function indexAction() { self::initForTests(); if (!Kwf_Registry::get('config')->server->domain) { throw new Kwf_Exception_Client("Can't run tests; server.domain is not set. Please set in tests/config.local.ini"); } $arguments = array(); $arguments['colors'] = true; $arguments['filter'] = false; if ($this->_getParam('filter')) { $arguments['filter'] = $this->_getParam('filter'); } $arguments['groups'] = array(); if ($this->_getParam('group')) { $arguments['groups'] = explode(',', $this->_getParam('group')); } $arguments['excludeGroups'] = array(); if ($this->_getParam('exclude-group')) { $arguments['excludeGroups'] = explode(',', $this->_getParam('exclude-group')); } $arguments['verbose'] = false; if ($this->_getParam('verbose')) { $arguments['verbose'] = $this->_getParam('verbose'); } if ($this->_getParam('stop-on-failure')) { $arguments['stopOnFailure'] = $this->_getParam('stop-on-failure'); } if ($this->_getParam('log-xml')) { $arguments['xmlLogfile'] = $this->_getParam('log-xml'); } if ($this->_getParam('log-pmd')) { $arguments['pmdXML'] = $this->_getParam('log-pmd'); } if ($this->_getParam('log-metrics')) { $arguments['metricsXML'] = $this->_getParam('log-metrics'); } if ($this->_getParam('coverage-xml')) { $arguments['coverageClover'] = $this->_getParam('coverage-xml'); } if ($this->_getParam('retry-on-error')) { $arguments['retryOnError'] = $this->_getParam('retry-on-error'); } if ($this->_getParam('coverage')) { if (!extension_loaded('tokenizer') || !extension_loaded('xdebug')) { throw new Kwf_ClientException('tokenizer and xdebug extensions must be loaded'); } if (!is_string($this->_getParam('coverage'))) { $arguments['reportDirectory'] = './report'; } else { $arguments['reportDirectory'] = $this->_getParam('coverage'); } } Kwf_Registry::set('testDomain', Kwf_Registry::get('config')->server->domain); Kwf_Registry::set('testServerConfig', Kwf_Registry::get('config')); if ($this->_getParam('report')) { $resultLogger = new Kwf_Test_ResultLogger(true); $arguments['listeners'][] = $resultLogger; } if ($this->_getParam('testdox')) { $arguments['printer'] = new PHPUnit_Util_TestDox_ResultPrinter_Text(); $arguments['noProgress'] = true; } else { if ($this->_getParam('no-progress')) { $arguments['noProgress'] = true; } } if ($this->_getParam('disable-debug')) { Kwf_Debug::disable(); } //nur temporär deaktiviert, damit ich selenium-verbindungs-probleme besser debuggen kann // PHPUnit_Util_Filter::setFilter(false); $runner = new Kwf_Test_TestRunner(); $suite = new Kwf_Test_TestSuite(); Kwf_Model_Abstract::clearInstances(); $result = $runner->doRun($suite, $arguments); if ($this->_getParam('report')) { $resultLogger->printResult($result); $reportData = array('tests' => $result->count(), 'failures' => $result->failureCount() + $result->errorCount(), 'skipped' => $result->skippedCount(), 'not_implemented' => $result->notImplementedCount(), 'kwf_version' => Kwf_Util_Git::kwf()->getActiveBranch() . ' (' . Kwf_Util_Git::kwf()->revParse('HEAD') . ')'); if (Kwf_Registry::get('config')->application->id != 'kwf') { $reportData['web_version'] = Kwf_Util_Git::web()->getActiveBranch() . ' (' . Kwf_Util_Git::web()->revParse('HEAD') . ')'; } echo "===REPORT==="; echo serialize($reportData); echo "===/REPORT==="; } Kwf_Benchmark::shutDown(); if ($result->wasSuccessful()) { exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT); } else { if ($result->errorCount() > 0) { exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); } else { exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT); } } $this->_helper->viewRenderer->setNoRender(true); }