compared with
Current by Alexander Veremyev
on Nov 06, 2008 10:50.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (10)

View Page History
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

{zone-data:component-name}
*Finally*, users could potentially visit something like [http://framework.zend.com/exceptions/0xFFFFFFFF] (easily indexable by search engines) to see a more in-depth description of the exception, as well as possible solutions and even user comments. Exceptions that are commonly encountered can be addressed once, on the website, in an easy to access way. {{Zend_Exception}}'s constructor, which all exceptions extend, can then be easily modified to provide a direct link to this page.

Error codes can be divided in a predetermined way, so that each component has its own hex value and no overlap occurs. The solution that we've agreed upon is that each component is assigned its own unique range for the first 12 bits half (e.g., {{Zend_Acl}} = 0x00020000, {{Zend_Auth}} = 0x00030000, {{Zend_Etc}} = 0xFFFF0000), for a maximum of 65,536 possible exception ranges. Each component then has 65,536 exceptions it can create and use. For example, {{Zend_Controller}}'s first type of exception may be 0x00030000, followed by 0x00030001, 0x00030002, and so on.
{zone-data}

const UNKNOWN_LOCALE = 0x00000003;

/** @var boolean Translate exception messages? */
protected $_translateMessages = false;

/** @var string Locale */
protected $_locale = 'en';

/**
* Sets whether or not to translate exception messages.
*
* @param boolean $flag Translate exception messages?
*/
public static function translateMessages($flag = true)
{
self::$_translateMessages = $flag;
}

/**
* Sets a new standard locale for all exception objects.
*

/**
* Returns an exception message. If TRANSLATE_MESSAGES is true, this will return the
* value of {@link getTranslatedMessage} instead.
*
* @return string
*/
public function getMessage()
{
if (self::$_translatedMessages) {
return $this->getTranslatedMessage();
} else {
return parent::getMessage();
}
}

/**
* Returns a translated exception message.
*
* @param string|Zend_Locale $locale Locale
* @return string
*/
public function getTranslatedMessage($locale = null)
{
$message = $this->getMessage(); parent::getMessage();

try {
{zone-data}

{zone-template-instance}
{zone-template-instance}]]></ac:plain-text-body></ac:macro>