本文整理汇总了PHP中Shineisp_Registry::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Shineisp_Registry::set方法的具体用法?PHP Shineisp_Registry::set怎么用?PHP Shineisp_Registry::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shineisp_Registry
的用法示例。
在下文中一共展示了Shineisp_Registry::set方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// Get all settings
Shineisp_Registry::set('Settings', Settings::getAll());
// Statuses are used everywhere in system, so we need to make just one query
Shineisp_Registry::set('Status', Statuses::getAll());
}
示例2: preStmtExecute
public function preStmtExecute(Doctrine_Event $event)
{
// Check if the administrator has enabled the query logging feature
if (Settings::findbyParam('debug_queries')) {
$breadcrumps = array();
$query = $event->getQuery();
$params = $event->getParams();
$callers = array_reverse(debug_backtrace(), true);
$callers = array_slice($callers, 4, count($callers) - 10);
foreach ($callers as $caller) {
$class = !empty($caller['class']) ? $caller['class'] : null;
$breadcrumps[] = $class . "->" . $caller['function'];
}
$strBreadcrump = "System: " . implode(" / ", $breadcrumps);
//the below makes some naive assumptions about the queries being logged
while (sizeof($params) > 0) {
$param = array_shift($params);
if (!is_numeric($param)) {
$param = sprintf("'%s'", $param);
}
$query = substr_replace($query, $param, strpos($query, '?'), 1);
}
Shineisp_Commons_Utilities::log($query, "queries.log");
Shineisp_Commons_Utilities::log($strBreadcrump, "debug.log", Zend_Log::DEBUG);
// Increase query counter
$queryCount = Shineisp_Registry::isRegistered('querycount') ? Shineisp_Registry::get('querycount') : 0;
$queryCount = $queryCount + 1;
Shineisp_Registry::set('querycount', $queryCount);
}
}
示例3: id
/**
* Get the Status ID
*
* @param string $status
* @param string $section
*/
public static function id($status, $section = "generic")
{
$statuses = Shineisp_Registry::get('Status');
if (empty($statuses)) {
Shineisp_Registry::set('Status', self::getAll());
}
if (!empty($status)) {
$status = strtolower($status);
}
$section = strtolower($section);
return intval(Shineisp_Registry::get('Status')->{$section}->{$status}->status_id) ? intval(Shineisp_Registry::get('Status')->{$section}->{$status}->status_id) : null;
return null;
}
示例4: init
public function init()
{
// Get authenticated user
$auth = Zend_Auth::getInstance()->getIdentity();
// Store logged ISP. I'm inside admin, se we use only the logged user
if (isset($auth['isp_id'])) {
$isp_id = intval($auth['isp_id']);
$ISP = new Isp();
Shineisp_Registry::set('ISP', $ISP->find($isp_id));
}
// Load all the status in the registry
$statusreg = Shineisp_Registry::get('Status');
if (empty($statusreg)) {
$status = Statuses::getAll();
Shineisp_Registry::set('Status', $status);
}
parent::init();
}
示例5: init
public function init()
{
try {
// Store logged ISP. I'm in the public area, se we use only the URL
$ISP = Isp::findByUrl($_SERVER['HTTP_HOST']);
if (!empty($ISP)) {
Shineisp_Registry::set('ISP', $ISP);
}
// Load all the status in the registry
$statusreg = Shineisp_Registry::get('Status');
if (empty($statusreg)) {
$status = Statuses::getAll();
Shineisp_Registry::set('Status', $status);
}
} catch (Exception $e) {
Shineisp_Commons_Utilities::log(__METHOD__ . " " . $e->getMessage());
}
parent::init();
}
示例6: setDefaultLanguage
/**
* Set the language object variable
* @param $locale
*/
public static function setDefaultLanguage($path, $locale)
{
$zl = new Zend_Locale();
if (!empty($locale)) {
$zl->setLocale($locale);
Shineisp_Registry::set('Zend_Locale', $zl);
}
}
示例7: loadConfig
/**
* Load of the configuration file
* @return SimpleXMLElement
*/
public static function loadConfig()
{
$confFile = APPLICATION_PATH . "/configs/config.xml";
try {
if (file_exists($confFile) && is_readable($confFile)) {
$config = Shineisp_Commons_Utilities::readfile($confFile);
if (!empty($config)) {
$config = new Zend_Config_Xml($confFile);
if (simplexml_load_file($confFile)) {
Shineisp_Registry::set('config', $config);
return simplexml_load_file($confFile);
} else {
throw new Exception("XML Config file is not readable or not well-formed");
}
}
}
} catch (Exception $e) {
echo $e->getMessage();
echo "<xmp>";
echo $e->getTraceAsString();
echo "</xmp>";
exit;
}
}