diff options
Diffstat (limited to 'zend/documentation/manual/core/en/migration.110.html')
| -rw-r--r-- | zend/documentation/manual/core/en/migration.110.html | 502 |
1 files changed, 502 insertions, 0 deletions
diff --git a/zend/documentation/manual/core/en/migration.110.html b/zend/documentation/manual/core/en/migration.110.html new file mode 100644 index 0000000..076c985 --- /dev/null +++ b/zend/documentation/manual/core/en/migration.110.html @@ -0,0 +1,502 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> + <title>Zend Framework 1.10 - Zend Framework Manual</title> + +</head> +<body> +<table width="100%"> + <tr valign="top"> + <td width="85%"> + <table width="100%"> + <tr> + <td width="25%" style="text-align: left;"> + <a href="migration.112.html">Zend Framework 1.12</a> + </td> + + <td width="50%" style="text-align: center;"> + <div class="up"><span class="up"><a href="migration.html">Zend Gdata Migration Notes</a></span><br /> + <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> + </td> + + <td width="25%" style="text-align: right;"> + <div class="next" style="text-align: right; float: right;"><a href="migration.19.html">Zend Framework 1.9</a></div> + </td> + </tr> + </table> +<hr /> +<div id="migration.110" class="section"><div class="info"><h1 class="title">Zend Framework 1.10</h1></div> + + + <p class="para"> + When upgrading from a previous release to Zend Framework 1.10 or higher you + should note the following migration notes. + </p> + + <div class="section" id="migration.110.zend.controller.front" name="migration.110.zend.controller.front"><div class="info"><h1 class="title">Zend_Controller_Front</h1></div> + + + <p class="para"> + A wrong behaviour was fixed, when there was no module route and no route + matched the given request. Previously, the router returned an unmodified + request object, so the front controller just displayed the default controller + and action. Since Zend Framework 1.10, the router will correctly as noted + in the router interface, throw an exception if no route matches. The error + plugin will then catch that exception and forward to the error controller. + You can then test for that specific error with the constant + <b><tt>Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE</tt></b>: + </p> + + <div class="programlisting php"><div class="phpcode"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * Before 1.10</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> errorAction<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$errors</span> = <span style="color: #0000ff;">$this</span>->_getParam<span style="color: #66cc66;">(</span><span style="color: #ff0000;">'error_handler'</span><span style="color: #66cc66;">)</span>;</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">(</span><span style="color: #0000ff;">$errors</span>-><span style="color: #006600;">type</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">case</span> Zend_Controller_Plugin_ErrorHandler::<span style="color: #006600;">EXCEPTION_NO_CONTROLLER</span>:</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">case</span> Zend_Controller_Plugin_ErrorHandler::<span style="color: #006600;">EXCEPTION_NO_ACTION</span>:</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">// ...</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * With 1.10</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> errorAction<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$errors</span> = <span style="color: #0000ff;">$this</span>->_getParam<span style="color: #66cc66;">(</span><span style="color: #ff0000;">'error_handler'</span><span style="color: #66cc66;">)</span>;</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">(</span><span style="color: #0000ff;">$errors</span>-><span style="color: #006600;">type</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">case</span> Zend_Controller_Plugin_ErrorHandler::<span style="color: #006600;">EXCEPTION_NO_ROUTE</span>:</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">case</span> Zend_Controller_Plugin_ErrorHandler::<span style="color: #006600;">EXCEPTION_NO_CONTROLLER</span>:</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">case</span> Zend_Controller_Plugin_ErrorHandler::<span style="color: #006600;">EXCEPTION_NO_ACTION</span>:</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #808080; font-style: italic;">// ...</span></div></li></ol></div></div></div> + + </div> + + <div class="section" id="migration.110.zend.feed.reader" name="migration.110.zend.feed.reader"><div class="info"><h1 class="title">Zend_Feed_Reader</h1></div> + + + <p class="para"> + With the introduction of Zend Framework 1.10, <span class="classname">Zend_Feed_Reader</span>'s + handling of retrieving Authors and Contributors was changed, introducing + a break in backwards compatibility. This change was an effort to harmonise + the treatment of such data across the RSS and Atom classes of the component + and enable the return of Author and Contributor data in more accessible, + usable and detailed form. It also rectifies an error in that it was assumed + any author element referred to a name. In RSS this is incorrect as an + author element is actually only required to provide an email address. + In addition, the original implementation applied its RSS limits to Atom + feeds significantly reducing the usefulness of the parser with that format. + </p> + + <p class="para"> + The change means that methods like <span class="methodname">getAuthors()</span> + and <span class="methodname">getContributors</span> no longer return a simple array + of strings parsed from the relevant RSS and Atom elements. Instead, the return + value is an <span class="classname">ArrayObject</span> subclass called + <span class="classname">Zend_Feed_Reader_Collection_Author</span> which simulates + an iterable multidimensional array of Authors. Each member of this object + will be a simple array with three potential keys (as the source data permits). + These include: name, email and uri. + </p> + + <p class="para"> + The original behaviour of such methods would have returned a simple + array of strings, each string attempting to present a single name, but + in reality this was unreliable since there is no rule governing the format + of RSS Author strings. + </p> + + <p class="para"> + The simplest method of simulating the original behaviour of these + methods is to use the <span class="classname">Zend_Feed_Reader_Collection_Author</span>'s + <span class="methodname">getValues()</span> which also returns a simple array of strings + representing the "most relevant data", for authors presumed to be their name. + Each value in the resulting array is derived from the "name" value + attached to each Author (if present). In most cases this simple change is + easy to apply as demonstrated below. + </p> + + <div class="programlisting php"><div class="phpcode"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * Before 1.10</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$feed</span> = Zend_Feed_Reader::<span style="color: #006600;">import</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'http://example.com/feed'</span><span style="color: #66cc66;">)</span>;</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$authors</span> = <span style="color: #0000ff;">$feed</span>-><span style="color: #006600;">getAuthors</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * With 1.10</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$feed</span> = Zend_Feed_Reader::<span style="color: #006600;">import</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'http://example.com/feed'</span><span style="color: #66cc66;">)</span>;</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$authors</span> = <span style="color: #0000ff;">$feed</span>-><span style="color: #006600;">getAuthors</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>-><span style="color: #006600;">getValues</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div></li></ol></div></div></div> + + </div> + + <div class="section" id="migration.110.zend.file.transfer" name="migration.110.zend.file.transfer"><div class="info"><h1 class="title">Zend_File_Transfer</h1></div> + + + <div class="section" id="migration.110.zend.file.transfer.files" name="migration.110.zend.file.transfer.files"><div class="info"><h1 class="title">Security change</h1></div> + + + <p class="para"> + For security reasons <span class="classname">Zend_File_Transfer</span> does no longer store + the original mimetype and filesize which is given from the requesting client into + its internal storage. Instead the real values will be detected at initiation. + </p> + + <p class="para"> + Additionally the original values within <var class="varname">$_FILES</var> will be + overridden within the real values at initiation. This makes also + <var class="varname">$_FILES</var> secure. + </p> + + <p class="para"> + When you are in need of the original values you can either store them before + initiating <span class="classname">Zend_File_Transfer</span> or use the + <span class="property">disableInfos</span> option at initiation. Note that this option is + useless when its given after initiation. + </p> + </div> + + <div class="section" id="migration.110.zend.file.transfer.count" name="migration.110.zend.file.transfer.count"><div class="info"><h1 class="title">Count validation</h1></div> + + + <p class="para"> + Before release 1.10 the <span class="classname">MimeType</span> validator used a wrong + naming. For consistency the following constants have been changed: + </p> + + <table class="doctable table"><div class="info"><caption><b>Changed Validation Messages</b></caption></div> + + + + <thead valign="middle"> + <tr valign="middle"> + <th>Old</th> + <th>New</th> + <th>Value</th> + </tr> + + </thead> + + + <tbody valign="middle" class="tbody"> + <tr valign="middle"> + <td align="left"><b><tt>TOO_MUCH</tt></b></td> + <td align="left"><b><tt>TOO_MANY</tt></b></td> + + <td align="left"> + Too many files, maximum '%max%' are allowed but '%count%' are given + </td> + </tr> + + + <tr valign="middle"> + <td align="left"><b><tt>TOO_LESS</tt></b></td> + <td align="left"><b><tt>TOO_FEW</tt></b></td> + + <td align="left"> + Too few files, minimum '%min%' are expected but '%count%' are given + </td> + </tr> + + </tbody> + + </table> + + + <p class="para"> + When you are translating these messages within your code then use the new constants. + As benefit you don't need to translate the original string anymore to get a correct + spelling. + </p> + </div> + </div> + + <div class="section" id="migration.110.zend.filter.html-entities" name="migration.110.zend.filter.html-entities"><div class="info"><h1 class="title">Zend_Filter_HtmlEntities</h1></div> + + + <p class="para"> + In order to default to a more secure character encoding, + <span class="classname">Zend_Filter_HtmlEntities</span> now defaults to <acronym class="acronym">UTF-8</acronym> + instead of <acronym class="acronym">ISO-8859-1</acronym>. + </p> + + <p class="para"> + Additionally, because the actual mechanism is dealing with character encodings and not + character sets, two new methods have been added, <span class="methodname">setEncoding()</span> + and <span class="methodname">getEncoding()</span>. The previous methods + <span class="methodname">setCharSet()</span> and <span class="methodname">setCharSet()</span> are now + deprecated and proxy to the new methods. Finally, instead of using the protected members + directly within the <span class="methodname">filter()</span> method, these members are + retrieved by their explicit accessors. If you were extending the filter in the past, + please check your code and unit tests to ensure everything still continues to work. + </p> + </div> + + <div class="section" id="migration.110.zend.filter.strip-tags" name="migration.110.zend.filter.strip-tags"><div class="info"><h1 class="title">Zend_Filter_StripTags</h1></div> + + + <p class="para"> + <span class="classname">Zend_Filter_StripTags</span> contains a flag, + <var class="varname">commentsAllowed</var>, that, in previous versions, allowed you to + optionally whitelist <acronym class="acronym">HTML</acronym> comments in <acronym class="acronym">HTML</acronym> text + filtered by the class. However, this opens code enabling the flag to + <acronym class="acronym">XSS</acronym> attacks, particularly in Internet Explorer (which allows + specifying conditional functionality via <acronym class="acronym">HTML</acronym> comments). Starting + in version 1.9.7 (and backported to versions 1.8.5 and 1.7.9), the + <var class="varname">commentsAllowed</var> flag no longer has any meaning, and all + <acronym class="acronym">HTML</acronym> comments, including those containing other + <acronym class="acronym">HTML</acronym> tags or nested commments, will be stripped from the final output + of the filter. + </p> + </div> + + <div class="section" id="migration.110.zend.translate" name="migration.110.zend.translate"><div class="info"><h1 class="title">Zend_Translate</h1></div> + + + <div class="section" id="migration.110.zend.translate.xliff" name="migration.110.zend.translate.xliff"><div class="info"><h1 class="title">Xliff adapter</h1></div> + + + <p class="para"> + In past the Xliff adapter used the source string as message Id. According to the + Xliff standard the trans-unit Id should be used. This behaviour was corrected with + Zend Framework 1.10. Now the trans-unit Id is used as message Id per default. + </p> + + <p class="para"> + But you can still get the incorrect and old behaviour by setting the + <span class="property">useId</span> option to <b><tt>FALSE</tt></b>. + </p> + + <div class="programlisting php"><div class="phpcode"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$trans</span> = <span style="color: #000000; font-weight: bold;">new</span> Zend_Translate<span style="color: #66cc66;">(</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #ff0000;">'xliff'</span>, <span style="color: #ff0000;">'/path/to/source'</span>, <span style="color: #0000ff;">$locale</span>, <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">'useId'</span> => <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">)</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">)</span>;</div></li></ol></div></div></div> + + </div> + </div> + + <div class="section" id="migration.110.zend.validate" name="migration.110.zend.validate"><div class="info"><h1 class="title">Zend_Validate</h1></div> + + + <div class="section" id="migration.110.zend.validate.selfwritten" name="migration.110.zend.validate.selfwritten"><div class="info"><h1 class="title">Self written validators</h1></div> + + + <p class="para"> + When setting returning a error from within a self written validator you have to + call the <span class="methodname">_error()</span> method. Before Zend Framework 1.10 you + were able to call this method without giving a parameter. It used then the first + found message template. + </p> + + <p class="para"> + This behaviour is problematic when you have validators with more than one different + message to be returned. Also when you extend an existing validator you can get + unexpected results. This could lead to the problem that your user get not the + message you expected. + </p> + + <div class="programlisting php"><div class="phpcode"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">My_Validator <span style="color: #000000; font-weight: bold;">extends</span> Zend_Validate_Abstract</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> isValid<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$value</span><span style="color: #66cc66;">)</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> ...</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$this</span>->_error<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>; <span style="color: #808080; font-style: italic;">// unexpected results between different OS</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> ...</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div></li></ol></div></div></div> + + + <p class="para"> + To prevent this problem the <span class="methodname">_error()</span> method is no longer + allowed to be called without giving a parameter. + </p> + + <div class="programlisting php"><div class="phpcode"><div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">My_Validator <span style="color: #000000; font-weight: bold;">extends</span> Zend_Validate_Abstract</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #000000; font-weight: bold;">public</span> isValid<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$value</span><span style="color: #66cc66;">)</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">{</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> ...</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #0000ff;">$this</span>->_error<span style="color: #66cc66;">(</span>self::<span style="color: #006600;">MY_ERROR</span><span style="color: #66cc66;">)</span>; <span style="color: #808080; font-style: italic;">// defined error, no unexpected results</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> ...</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #66cc66;">}</span></div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div></li></ol></div></div></div> + + </div> + + <div class="section" id="migration.110.zend.validate.datevalidator" name="migration.110.zend.validate.datevalidator"><div class="info"><h1 class="title">Simplification in date validator</h1></div> + + + <p class="para"> + Before Zend Framework 1.10 2 identical messages were thrown within the date + validator. These were <b><tt>NOT_YYYY_MM_DD</tt></b> and + <b><tt>FALSEFORMAT</tt></b>. As of Zend Framework 1.10 only the + <b><tt>FALSEFORMAT</tt></b> message will be returned when the given date + does not match the set format. + </p> + </div> + + <div class="section" id="migration.110.zend.validate.barcodevalidator" name="migration.110.zend.validate.barcodevalidator"><div class="info"><h1 class="title">Fixes in Alpha, Alnum and Barcode validator</h1></div> + + + <p class="para"> + Before Zend Framework 1.10 the messages within the 2 barcode adapters, the Alpha + and the Alnum validator were identical. This introduced problems when using custom + messages, translations or multiple instances of these validators. + </p> + + <p class="para"> + As with Zend Framework 1.10 the values of the constants were changed to + be unique. When you used the constants as proposed in the manual there is + no change for you. But when you used the content of the constants in your code + then you will have to change them. The following table shows you the changed values: + </p> + + <table class="doctable table"><div class="info"><caption><b>Available Validation Messages</b></caption></div> + + + + <thead valign="middle"> + <tr valign="middle"> + <th>Validator</th> + <th>Constant</th> + <th>Value</th> + </tr> + + </thead> + + + <tbody valign="middle" class="tbody"> + <tr valign="middle"> + <td align="left"><span class="classname">Alnum</span></td> + <td align="left"><b><tt>STRING_EMPTY</tt></b></td> + <td align="left">alnumStringEmpty</td> + </tr> + + + <tr valign="middle"> + <td align="left"><span class="classname">Alpha</span></td> + <td align="left"><b><tt>STRING_EMPTY</tt></b></td> + <td align="left">alphaStringEmpty</td> + </tr> + + + <tr valign="middle"> + <td align="left"><span class="classname">Barcode_Ean13</span></td> + <td align="left"><b><tt>INVALID</tt></b></td> + <td align="left">ean13Invalid</td> + </tr> + + + <tr valign="middle"> + <td align="left"><span class="classname">Barcode_Ean13</span></td> + <td align="left"><b><tt>INVALID_LENGTH</tt></b></td> + <td align="left">ean13InvalidLength</td> + </tr> + + + <tr valign="middle"> + <td align="left"><span class="classname">Barcode_UpcA</span></td> + <td align="left"><b><tt>INVALID</tt></b></td> + <td align="left">upcaInvalid</td> + </tr> + + + <tr valign="middle"> + <td align="left"><span class="classname">Barcode_UpcA</span></td> + <td align="left"><b><tt>INVALID_LENGTH</tt></b></td> + <td align="left">upcaInvalidLength</td> + </tr> + + + <tr valign="middle"> + <td align="left"><span class="classname">Digits</span></td> + <td align="left"><b><tt>STRING_EMPTY</tt></b></td> + <td align="left">digitsStringEmpty</td> + </tr> + + </tbody> + + </table> + + + </div> + </div> +</div> + <hr /> + + <table width="100%"> + <tr> + <td width="25%" style="text-align: left;"> + <a href="migration.112.html">Zend Framework 1.12</a> + </td> + + <td width="50%" style="text-align: center;"> + <div class="up"><span class="up"><a href="migration.html">Zend Gdata Migration Notes</a></span><br /> + <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> + </td> + + <td width="25%" style="text-align: right;"> + <div class="next" style="text-align: right; float: right;"><a href="migration.19.html">Zend Framework 1.9</a></div> + </td> + </tr> + </table> +</td> + <td style="font-size: smaller;" width="15%"> <style type="text/css"> +#leftbar { + float: left; + width: 186px; + padding: 5px; + font-size: smaller; +} +ul.toc { + margin: 0px 5px 5px 5px; + padding: 0px; +} +ul.toc li { + font-size: 85%; + margin: 1px 0 1px 1px; + padding: 1px 0 1px 11px; + list-style-type: none; + background-repeat: no-repeat; + background-position: center left; +} +ul.toc li.header { + font-size: 115%; + padding: 5px 0px 5px 11px; + border-bottom: 1px solid #cccccc; + margin-bottom: 5px; +} +ul.toc li.active { + font-weight: bold; +} +ul.toc li a { + text-decoration: none; +} +ul.toc li a:hover { + text-decoration: underline; +} +</style> + <ul class="toc"> + <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li> + <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li> + <li class="header up"><a href="migration.html">Zend Gdata Migration Notes</a></li> + <li><a href="migration.112.html">Zend Framework 1.12</a></li> + <li class="active"><a href="migration.110.html">Zend Framework 1.10</a></li> + <li><a href="migration.19.html">Zend Framework 1.9</a></li> + <li><a href="migration.18.html">Zend Framework 1.8</a></li> + <li><a href="migration.17.html">Zend Framework 1.7</a></li> + <li><a href="migration.16.html">Zend Framework 1.6</a></li> + <li><a href="migration.15.html">Zend Framework 1.5</a></li> + <li><a href="migration.10.html">Zend Framework 1.0</a></li> + <li><a href="migration.09.html">Zend Framework 0.9</a></li> + <li><a href="migration.08.html">Zend Framework 0.8</a></li> + <li><a href="migration.06.html">Zend Framework 0.6</a></li> + </ul> + </td> + </tr> +</table> +</body> +</html>
\ No newline at end of file |
