static function main() { Zend_Registry::set('config', new Strass_Config_Php('strass', array())); Zend_Registry::set('acl', new Strass_Installer_FakeAcl()); Strass_Cache::setup(); try { $fc = Zend_Controller_Front::getInstance(); $fc->setRequest(new Strass_Controller_Request_Http()); $fc->setParam('useDefaultControllerAlways', true); $fc->setParam('noViewRenderer', true); $fc->setModuleControllerDirectoryName('Installer'); $fc->addControllerDirectory(Strass::getPrefix() . 'include/Strass/Installer/Controller', 'Strass'); $fc->setDefaultModule('Strass'); $fc->registerPlugin(new Strass_Controller_Plugin_Error()); $fc->dispatch(); Zend_Session::writeClose(); } catch (Exception $e) { // affichage complet des exceptions non intercepté par le controlleur. À améliorer. $msg = ":(\n\n"; $msg .= $e->getMessage() . "\n\n"; $msg .= " à " . $e->getFile() . ":" . $e->getLine() . "\n\n"; $msg .= str_replace('#', '<br/>#', $e->getTraceAsString()) . "\n"; Orror::kill(strip_tags($msg)); } }
function &addChild($instance) { if (is_string($instance)) { $args = func_get_args(); $name = array_shift($args); $instance = call_user_func_array(array($this, 'add' . $name), $args); return $instance; } if (!$instance instanceof Wtk_Form_Model_Instance) { Orror::kill($instance); } $instance->setPath($this->path . '/' . $instance->id); $this->value[$instance->id] = $instance; return $instance; }
function unparent() { if ($this instanceof Wtk_Form_Fieldset) { $dbg = debug_backtrace(); foreach ($dbg as $i => $stack) { $dbg[$i]['object'] = get_class($stack['object']); $dbg[$i]['args'] = array(); foreach ($stack['args'] as $arg) { $dbg[$i]['args'][] = is_object($arg) ? get_class($arg) : $arg; } } Orror::kill($dbg); } if ($this->parent instanceof Wtk_Container) { $parent = $this->parent; $this->parent = null; // éviter la boucle car removeChild va appeler cette // fonction. $parent->removeChild($this); } }
function retrieve($value) { preg_match("/#?([0-9a-fA-F]{1,2}){3}/", $value, $res); Orror::kill($value, $res); }
static function main() { self::bootstrapStage1(); /* On affiche la page de maintenance avant d'initialiser Wtk et * strass. Ainsi, seuls index.php et ce fichier sont requis pour * afficher la page de maintenance. Pas d'inclusion de Zend, Wtk, * etc. */ if (self::onMaintenance()) { return self::showMaintenance(); } self::bootstrapStage2(); if (!self::isInstalled()) { return Strass_Installer::main(); } try { self::run(); } catch (Exception $e) { self::saveSession(); try { try { $logger = Zend_Registry::get('logger'); } catch (Exception $_) { $logger = new Strass_Logger(); } $logger->critical($e->getMessage(), null, print_r($e, true)); } catch (Exception $_) { } // Affichage complet des exceptions non interceptées par le // controlleur. $msg = ":(\n\n"; $msg .= $e->getMessage() . "\n\n"; $msg .= " à " . $e->getFile() . ":" . $e->getLine() . "\n\n"; $msg .= str_replace('#', '<br/>#', $e->getTraceAsString()) . "\n"; header('HTTP/1.1 500 Internal Server Error'); error_log(strtok($e->getMessage(), "\n")); Orror::kill(strip_tags($msg)); return; } self::saveProfile(); }