public static function systemUnload() { $memcache = Zend_Registry::get('memcache'); $memcache->set(self::$_statusKey, self::$_states[5]); // By default all NSDR methods will return an empty/false value $methods = array('persist' => 'return false;', 'populate' => 'return "";', 'aggregateDisplay' => 'return "";', 'aggregateDisplayByLine' => 'return "";'); $nsdrDefinition = new NSDRDefinition(); $nsdrDefinitionIterator = $nsdrDefinition->getIterator(); foreach ($nsdrDefinitionIterator as $row) { foreach ($methods as $method => $value) { $keySuffix = '[' . $method . '()]'; $key = $row->namespace . $keySuffix; self::removeNamespace($key); } } $memcache->set(self::$_statusKey, self::$_states[4]); }
public static function systemStart() { $memcache = Zend_Registry::get('memcache'); $memcache->set(self::$_statusKey, self::$_states[1]); // By default all NSDR methods will return an empty/false value $methods = array('persist' => 'return false;', 'populate' => 'return "";', 'aggregateDisplay' => 'return "";', 'aggregateDisplayByLine' => 'return "";'); $nsdrDefinition = new NSDRDefinition(); $nsdrDefinitionIterator = $nsdrDefinition->getIterator(); foreach ($nsdrDefinitionIterator as $row) { $namespaceAlias = null; $ORMClass = null; if (strlen($row->aliasFor) > 0 && $row->isNamespaceExists($row->aliasFor)) { // Alias must check first, alias must be canonical // temporary implemented this way, it can be changed later $namespaceAlias = 'ALIAS:' . $row->aliasFor; // prefix with ALIAS } else { if (self::hasORMClass($row)) { $ORMClass = 'ORMCLASS:' . $row->ORMClass; // prefix with ORMCLASS } } foreach ($methods as $method => $value) { $keySuffix = '[' . $method . '()]'; $key = $row->namespace . $keySuffix; if ($namespaceAlias !== null) { $value = $namespaceAlias . $keySuffix; } else { if ($ORMClass !== null) { $value = $ORMClass; // override $value } } $memcache->set($key, $value); } } $memcache->set(self::$_statusKey, self::$_states[0]); }