* throw Zend::exception('Some_Exception', 'exception message'); * * * @param string $class * @param string $message Defaults to empty string * @param int $code Defaults to 0 * @return Exception * @throws Zend_Exception when invalid exception class passed * * @deprecated Since 0.6.1 */ static public function exception($class, $message = '', $code = 0) { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.6.1"); $class = (string) $class; require_once 'Zend/Loader.php'; Zend_Loader::loadClass($class); $exception = new $class($message, $code); if (!$exception instanceof Exception) { throw new Zend_Exception('Invalid exception class used in Zend::exception()'); } return $exception; } /** * offsetSet stores $newval at key $index * * @param mixed $index index to set * @param $newval new value to store at offset $index * @return void * * @deprecated Since 0.9.0 -- Use Zend_Registry::set() instead. */ static public function register($index, $newval) { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::set() instead"); require_once 'Zend/Registry.php'; Zend_Registry::set($index, $newval); } /** * registry() retrieves the value stored at an index. * * If the $index argument is NULL or not specified, * this method returns the registry object (iterable). * * @see register() * @param string $index The name for the value. * @throws Zend_Registry_Exception * @return mixed The registered value for $index. * * @deprecated Since 0.9.0 -- Use Zend_Registry::get() instead. */ static public function registry($index = null) { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::get() instead"); require_once 'Zend/Registry.php'; Zend_Registry::get($index); } /** * Returns TRUE if the $index is a named value in the * registry, or FALSE if $index was not found in the registry. * * @param string $index * @return boolean * * @deprecated Since 0.9.0 -- Use Zend_Registry::isRegistered() instead. */ static public function isRegistered($index) { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::isRegistered() instead"); require_once 'Zend/Registry.php'; return Zend_Registry::isRegistered($index); } /** * Initialize the registry. Invoking this method more than once will generate an exception. * * @param mixed $registry - Either a name of the registry class (Zend_Registry, or a subclass) * or an instance of Zend_Registry (or subclass) * @return Zend_Registry * * @deprecated Since 0.9.0 -- Use Zend_Registry::setClassName() instead. */ static public function initRegistry($registry = 'Zend_Registry') { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::setClassName() instead"); require_once 'Zend/Registry.php'; Zend_Registry::setClassName($registry); return Zend_Registry::getInstance(); } /** * primarily for tearDown() in unit tests * * @deprecated Since 0.9.0 -- Use Zend_Registry::_unsetInstance() instead. */ static public function __unsetRegistry() { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::_unsetInstance() instead"); require_once 'Zend/Registry.php'; Zend_Registry::_unsetInstance(); } /** * Debug helper function. This is a wrapper for var_dump() that adds * the
tags, cleans up newlines and indents, and runs * htmlentities() before output. * * @param mixed $var The variable to dump. * @param string $label An optional label. * @return string * * @deprecated since 0.9.0 */ static public function dump($var, $label=null, $echo=true) { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Debug::dump() instead"); require_once 'Zend/Debug.php'; return Zend_Debug::dump($var, $label, $echo); } /** * Compare the specified ZF $version with the current Zend::VERSION of the ZF. * * @param string $version A version identifier for the ZF (e.g. "0.7.1") * @return boolean -1 if the $version is older, 0 if they are the same, and +1 if $version is newer * * @deprecated Since 0.9.0 -- Use Zend_Version::compareVersion() instead. */ static public function compareVersion($version) { trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Version::compareVersion() instead"); require_once 'Zend/Version.php'; return Zend_Version::compareVersion($version); } }