summaryrefslogtreecommitdiff
path: root/zend/documentation/manual/core/en/migration.110.html
blob: 076c985c14a544732af200f78ceb5076261dded2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> errorAction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$errors</span> = <span style="color: #0000ff;">$this</span>-&gt;_getParam<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'error_handler'</span><span style="color: #66cc66;">&#41;</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;">&nbsp;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$errors</span>-&gt;<span style="color: #006600;">type</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">&nbsp; &nbsp; <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;">&nbsp;</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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> errorAction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$errors</span> = <span style="color: #0000ff;">$this</span>-&gt;_getParam<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'error_handler'</span><span style="color: #66cc66;">&#41;</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;">&nbsp;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$errors</span>-&gt;<span style="color: #006600;">type</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">&nbsp; &nbsp; <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>&#039;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>&#039;s
             <span class="methodname">getValues()</span> which also returns a simple array of strings
            representing the &quot;most relevant data&quot;, for authors presumed to be their name.
            Each value in the resulting array is derived from the &quot;name&quot; 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;">&#40;</span><span style="color: #ff0000;">'http://example.com/feed'</span><span style="color: #66cc66;">&#41;</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>-&gt;<span style="color: #006600;">getAuthors</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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;">&nbsp;</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;">&#40;</span><span style="color: #ff0000;">'http://example.com/feed'</span><span style="color: #66cc66;">&#41;</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>-&gt;<span style="color: #006600;">getAuthors</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-&gt;<span style="color: #006600;">getValues</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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 &#039;%max%&#039; are allowed but &#039;%count%&#039; 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 &#039;%min%&#039; are expected but &#039;%count%&#039; 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&#039;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;">&#40;</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;">&nbsp; &nbsp; <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;">&#40;</span><span style="color: #ff0000;">'useId'</span> =&gt; <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</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;">&#41;</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;">&#123;</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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> isValid<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$value</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</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;">&nbsp; &nbsp; &nbsp; &nbsp; ...</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$this</span>-&gt;_error<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp; &nbsp; &nbsp; ...</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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;">&#125;</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;">&#123;</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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> isValid<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$value</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</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;">&nbsp; &nbsp; &nbsp; &nbsp; ...</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$this</span>-&gt;_error<span style="color: #66cc66;">&#40;</span>self::<span style="color: #006600;">MY_ERROR</span><span style="color: #66cc66;">&#41;</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;">&nbsp; &nbsp; &nbsp; &nbsp; ...</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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</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;">&#125;</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>