Zend_Validate-Messages.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.validate.messages">
  4. <title>Validation Messages</title>
  5. <para>
  6. Each validator which is based on <classname>Zend_Validate</classname> provides
  7. one or multiple messages in the case of a failed validation. You can use
  8. this information for setting own messages or when you have to translate
  9. the messages a validator can return. The following table lists all
  10. available messages which are returned by each validator.
  11. </para>
  12. <table id="zend.validate.messages.table">
  13. <title>Available Validation Messages</title>
  14. <tgroup cols="4">
  15. <thead>
  16. <row>
  17. <entry>Validator</entry>
  18. <entry>Constant</entry>
  19. <entry>Message</entry>
  20. </row>
  21. </thead>
  22. <tbody>
  23. <row>
  24. <entry morerows="1" valign="middle">Alnum</entry>
  25. <entry>NOT_ALNUM</entry>
  26. <entry>'%value%' has not only alphabetic and digit characters</entry>
  27. </row>
  28. <row>
  29. <entry>STRING_EMPTY</entry>
  30. <entry>'%value%' is an empty string</entry>
  31. </row>
  32. <row>
  33. <entry morerows="1" valign="middle">Alpha</entry>
  34. <entry>NOT_ALPHA</entry>
  35. <entry>'%value%' has not only alphabetic characters</entry>
  36. </row>
  37. <row>
  38. <entry>STRING_EMPTY</entry>
  39. <entry>'%value%' is an empty string</entry>
  40. </row>
  41. <row>
  42. <entry>Barcode</entry>
  43. <entry>---</entry>
  44. <entry>messages are thrown by a subclass</entry>
  45. </row>
  46. <row>
  47. <entry morerows="2" valign="middle">Barcode_Ean13</entry>
  48. <entry>INVALID</entry>
  49. <entry>'%value%' is an invalid EAN-13 barcode</entry>
  50. </row>
  51. <row>
  52. <entry>INVALID_LENGTH</entry>
  53. <entry>'%value%' should be 13 characters</entry>
  54. </row>
  55. <row>
  56. <entry>NOT_NUMERIC</entry>
  57. <entry>'%value%' should contain only numeric characters</entry>
  58. </row>
  59. <row>
  60. <entry morerows="1" valign="middle">Barcode_UpcA</entry>
  61. <entry>INVALID</entry>
  62. <entry>'%value%' is an invalid UPC-A barcode</entry>
  63. </row>
  64. <row>
  65. <entry>INVALID_LENGTH</entry>
  66. <entry>'%value%' should be 12 characters</entry>
  67. </row>
  68. <row>
  69. <entry morerows="1" valign="middle">Between</entry>
  70. <entry>NOT_BETWEEN</entry>
  71. <entry>'%value%' is not between '%min%' and '%max%', inclusively</entry>
  72. </row>
  73. <row>
  74. <entry>NOT_BETWEEN_STRICT</entry>
  75. <entry>'%value%' is not strictly between '%min%' and '%max%'</entry>
  76. </row>
  77. <row>
  78. <entry morerows="1" valign="middle">Ccnum</entry>
  79. <entry>LENGTH</entry>
  80. <entry>'%value%' must contain between 13 and 19 digits</entry>
  81. </row>
  82. <row>
  83. <entry>CHECKSUM</entry>
  84. <entry>Luhn algorithm (mod-10 checksum) failed on '%value%'</entry>
  85. </row>
  86. <row>
  87. <entry morerows="2" valign="middle">Date</entry>
  88. <entry>FALSEFORMAT</entry>
  89. <entry>'%value%' does not fit given date format</entry>
  90. </row>
  91. <row>
  92. <entry>INVALID</entry>
  93. <entry>'%value%' does not appear to be a valid date</entry>
  94. </row>
  95. <row>
  96. <entry>NOT_YYYY_MM_DD</entry>
  97. <entry>'%value%' is not of the format YYYY-MM-DD</entry>
  98. </row>
  99. <row>
  100. <entry morerows="1" valign="middle">Db_Abstract</entry>
  101. <entry>ERROR_NO_RECORD_FOUND</entry>
  102. <entry>No record matching %value% was found</entry>
  103. </row>
  104. <row>
  105. <entry>ERROR_RECORD_FOUND</entry>
  106. <entry>A record matching %value% was found</entry>
  107. </row>
  108. <row>
  109. <entry morerows="1" valign="middle">Digits</entry>
  110. <entry>NOT_DIGITS</entry>
  111. <entry>'%value%' contains not only digit characters</entry>
  112. </row>
  113. <row>
  114. <entry>STRING_EMPTY</entry>
  115. <entry>'%value%' is an empty string</entry>
  116. </row>
  117. <row>
  118. <entry morerows="6" valign="middle">EmailAddress</entry>
  119. <entry>INVALID</entry>
  120. <entry>
  121. '%value%' is not a valid email address in the basic format
  122. local-part@hostname
  123. </entry>
  124. </row>
  125. <row>
  126. <entry>INVALID_HOSTNAME</entry>
  127. <entry>'%hostname%' is not a valid hostname for email address '%value%'</entry>
  128. </row>
  129. <row>
  130. <entry>INVALID_MX_RECORD</entry>
  131. <entry>
  132. '%hostname%' does not appear to have a valid MX record for the email address
  133. '%value%'
  134. </entry>
  135. </row>
  136. <row>
  137. <entry>DOT_ATOM</entry>
  138. <entry>'%localPart%' not matched against dot-atom format</entry>
  139. </row>
  140. <row>
  141. <entry>QUOTED_STRING</entry>
  142. <entry>'%localPart%' not matched against quoted-string format</entry>
  143. </row>
  144. <row>
  145. <entry>INVALID_LOCAL_PART</entry>
  146. <entry>
  147. '%localPart%' is not a valid local part for email address '%value%'
  148. </entry>
  149. </row>
  150. <row>
  151. <entry>LENGTH_EXCEEDED</entry>
  152. <entry>'%value%' exceeds the allowed length</entry>
  153. </row>
  154. <row>
  155. <entry morerows="1" valign="middle">File_Count</entry>
  156. <entry>TOO_MUCH</entry>
  157. <entry>
  158. Too much files, maximum '%max%' are allowed but '%count%' are given
  159. </entry>
  160. </row>
  161. <row>
  162. <entry>TOO_LESS</entry>
  163. <entry>
  164. Too less files, minimum '%min%' are expected but '%count%' are given
  165. </entry>
  166. </row>
  167. <row>
  168. <entry morerows="2" valign="middle">File_Crc32</entry>
  169. <entry>DOES_NOT_MATCH</entry>
  170. <entry>The file '%value%' does not match the given crc32 hashes</entry>
  171. </row>
  172. <row>
  173. <entry>NOT_DETECTED</entry>
  174. <entry>There was no crc32 hash detected for the given file</entry>
  175. </row>
  176. <row>
  177. <entry>NOT_FOUND</entry>
  178. <entry>The file '%value%' could not be found</entry>
  179. </row>
  180. <row>
  181. <entry morerows="1" valign="middle">File_ExcludeExtension</entry>
  182. <entry>FALSE_EXTENSION</entry>
  183. <entry>The file '%value%' has a false extension</entry>
  184. </row>
  185. <row>
  186. <entry>NOT_FOUND</entry>
  187. <entry>The file '%value%' was not found</entry>
  188. </row>
  189. <row>
  190. <entry morerows="2" valign="middle">File_ExcludeMimeType</entry>
  191. <entry>FALSE_TYPE</entry>
  192. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  193. </row>
  194. <row>
  195. <entry>NOT_DETECTED</entry>
  196. <entry>The mimetype of file '%value%' could not been detected</entry>
  197. </row>
  198. <row>
  199. <entry>NOT_READABLE</entry>
  200. <entry>The file '%value%' can not be read</entry>
  201. </row>
  202. <row>
  203. <entry morerows="2" valign="middle">File_Exists</entry>
  204. <entry>DOES_NOT_EXIST</entry>
  205. <entry>The file '%value%' does not exist</entry>
  206. </row>
  207. <row>
  208. <entry morerows="1" valign="middle">File_Extension</entry>
  209. <entry>FALSE_EXTENSION</entry>
  210. <entry>The file '%value%' has a false extension</entry>
  211. </row>
  212. <row>
  213. <entry>NOT_FOUND</entry>
  214. <entry>The file '%value%' was not found</entry>
  215. </row>
  216. <row>
  217. <entry morerows="2" valign="middle">File_FilesSize</entry>
  218. <entry>TOO_BIG</entry>
  219. <entry>
  220. All files in sum should have a maximum size of '%max%' but '%size%' were
  221. detected
  222. </entry>
  223. </row>
  224. <row>
  225. <entry>TOO_SMALL</entry>
  226. <entry>
  227. All files in sum should have a minimum size of '%min%' but '%size%' were
  228. detected
  229. </entry>
  230. </row>
  231. <row>
  232. <entry>NOT_READABLE</entry>
  233. <entry>One or more files can not be read</entry>
  234. </row>
  235. <row>
  236. <entry morerows="2" valign="middle">File_Hash</entry>
  237. <entry>DOES_NOT_MATCH</entry>
  238. <entry>The file '%value%' does not match the given hashes</entry>
  239. </row>
  240. <row>
  241. <entry>NOT_DETECTED</entry>
  242. <entry>There was no hash detected for the given file</entry>
  243. </row>
  244. <row>
  245. <entry>NOT_FOUND</entry>
  246. <entry>The file '%value%' could not be found</entry>
  247. </row>
  248. <row>
  249. <entry morerows="5" valign="middle">File_ImageSize</entry>
  250. <entry>WIDTH_TOO_BIG</entry>
  251. <entry>
  252. Maximum allowed width for image '%value%' should be '%maxwidth%' but
  253. '%width%' detected
  254. </entry>
  255. </row>
  256. <row>
  257. <entry>WIDTH_TOO_SMALL</entry>
  258. <entry>
  259. Minimum expected width for image '%value%' should be '%minwidth%' but
  260. '%width%' detected
  261. </entry>
  262. </row>
  263. <row>
  264. <entry>HEIGHT_TOO_BIG</entry>
  265. <entry>
  266. Maximum allowed height for image '%value%' should be '%maxheight%' but
  267. '%height%' detected
  268. </entry>
  269. </row>
  270. <row>
  271. <entry>HEIGHT_TOO_SMALL</entry>
  272. <entry>
  273. Minimum expected height for image '%value%' should be '%minheight%' but
  274. '%height%' detected
  275. </entry>
  276. </row>
  277. <row>
  278. <entry>NOT_DETECTED</entry>
  279. <entry>The size of image '%value%' could not be detected</entry>
  280. </row>
  281. <row>
  282. <entry>NOT_READABLE</entry>
  283. <entry>The image '%value%' can not be read</entry>
  284. </row>
  285. <row>
  286. <entry morerows="2" valign="middle">File_IsCompressed</entry>
  287. <entry>FALSE_TYPE</entry>
  288. <entry>The file '%value%' is not compressed, '%type%' detected</entry>
  289. </row>
  290. <row>
  291. <entry>NOT_DETECTED</entry>
  292. <entry>The mimetype of file '%value%' could not been detected</entry>
  293. </row>
  294. <row>
  295. <entry>NOT_READABLE</entry>
  296. <entry>The file '%value%' can not be read</entry>
  297. </row>
  298. <row>
  299. <entry morerows="2" valign="middle">File_IsImage</entry>
  300. <entry>FALSE_TYPE</entry>
  301. <entry>The file '%value%' is no image, '%type%' detected</entry>
  302. </row>
  303. <row>
  304. <entry>NOT_DETECTED</entry>
  305. <entry>The mimetype of file '%value%' could not been detected</entry>
  306. </row>
  307. <row>
  308. <entry>NOT_READABLE</entry>
  309. <entry>The file '%value%' can not be read</entry>
  310. </row>
  311. <row>
  312. <entry morerows="2" valign="middle">File_Md5</entry>
  313. <entry>DOES_NOT_MATCH</entry>
  314. <entry>The file '%value%' does not match the given md5 hashes</entry>
  315. </row>
  316. <row>
  317. <entry>NOT_DETECTED</entry>
  318. <entry>There was no md5 hash detected for the given file</entry>
  319. </row>
  320. <row>
  321. <entry>NOT_FOUND</entry>
  322. <entry>The file '%value%' could not be found</entry>
  323. </row>
  324. <row>
  325. <entry morerows="2" valign="middle">File_MimeType</entry>
  326. <entry>FALSE_TYPE</entry>
  327. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  328. </row>
  329. <row>
  330. <entry>NOT_DETECTED</entry>
  331. <entry>The mimetype of file '%value%' could not been detected</entry>
  332. </row>
  333. <row>
  334. <entry>NOT_READABLE</entry>
  335. <entry>The file '%value%' can not be read</entry>
  336. </row>
  337. <row>
  338. <entry>File_NotExists</entry>
  339. <entry>DOES_EXIST</entry>
  340. <entry>The file '%value%' does exist</entry>
  341. </row>
  342. <row>
  343. <entry morerows="2" valign="middle">File_Sha1</entry>
  344. <entry>DOES_NOT_MATCH</entry>
  345. <entry>The file '%value%' does not match the given sha1 hashes</entry>
  346. </row>
  347. <row>
  348. <entry>NOT_DETECTED</entry>
  349. <entry>There was no sha1 hash detected for the given file</entry>
  350. </row>
  351. <row>
  352. <entry>NOT_FOUND</entry>
  353. <entry>The file '%value%' could not be found</entry>
  354. </row>
  355. <row>
  356. <entry morerows="2" valign="middle">File_Size</entry>
  357. <entry>TOO_BIG</entry>
  358. <entry>
  359. Maximum allowed size for file '%value%' is '%max%' but '%size%' detected
  360. </entry>
  361. </row>
  362. <row>
  363. <entry>TOO_SMALL</entry>
  364. <entry>
  365. Minimum expected size for file '%value%' is '%min%' but '%size%' detected
  366. </entry>
  367. </row>
  368. <row>
  369. <entry>NOT_FOUND</entry>
  370. <entry>The file '%value%' could not be found</entry>
  371. </row>
  372. <row>
  373. <entry morerows="9" valign="middle">File_Upload</entry>
  374. <entry>INI_SIZE</entry>
  375. <entry>The file '%value%' exceeds the defined ini size</entry>
  376. </row>
  377. <row>
  378. <entry>FORM_SIZE</entry>
  379. <entry>The file '%value%' exceeds the defined form size</entry>
  380. </row>
  381. <row>
  382. <entry>PARTIAL</entry>
  383. <entry>The file '%value%' was only partially uploaded</entry>
  384. </row>
  385. <row>
  386. <entry>NO_FILE</entry>
  387. <entry>The file '%value%' was not uploaded</entry>
  388. </row>
  389. <row>
  390. <entry>NO_TMP_DIR</entry>
  391. <entry>No temporary directory was found for the file '%value%'</entry>
  392. </row>
  393. <row>
  394. <entry>CANT_WRITE</entry>
  395. <entry>The file '%value%' can't be written</entry>
  396. </row>
  397. <row>
  398. <entry>EXTENSION</entry>
  399. <entry>
  400. The extension returned an error while uploading the file '%value%'
  401. </entry>
  402. </row>
  403. <row>
  404. <entry>ATTACK</entry>
  405. <entry>The file '%value%' was illegal uploaded, possible attack</entry>
  406. </row>
  407. <row>
  408. <entry>FILE_NOT_FOUND</entry>
  409. <entry>The file '%value%' was not found</entry>
  410. </row>
  411. <row>
  412. <entry>UNKNOWN</entry>
  413. <entry>Unknown error while uploading the file '%value%'</entry>
  414. </row>
  415. <row>
  416. <entry morerows="2" valign="middle">File_WordCount</entry>
  417. <entry>TOO_MUCH</entry>
  418. <entry>
  419. Too much words, maximum '%max%' are allowed but '%count%' were counted
  420. </entry>
  421. </row>
  422. <row>
  423. <entry>TOO_LESS</entry>
  424. <entry>
  425. Too less words, minimum '%min%' are expected but '%count%' were counted
  426. </entry>
  427. </row>
  428. <row>
  429. <entry>NOT_FOUND</entry>
  430. <entry>The file '%value%' could not be found</entry>
  431. </row>
  432. <row>
  433. <entry>Float</entry>
  434. <entry>NOT_FLOAT</entry>
  435. <entry>'%value%' does not appear to be a float</entry>
  436. </row>
  437. <row>
  438. <entry>GreaterThan</entry>
  439. <entry>NOT_GREATER</entry>
  440. <entry>'%value%' is not greater than '%min%'</entry>
  441. </row>
  442. <row>
  443. <entry>Hex</entry>
  444. <entry>NOT_HEX</entry>
  445. <entry>'%value%' has not only hexadecimal digit characters</entry>
  446. </row>
  447. <row>
  448. <entry morerows="7" valign="middle">Hostname</entry>
  449. <entry>IP_ADDRESS_NOT_ALLOWED</entry>
  450. <entry>
  451. '%value%' appears to be an IP address, but IP addresses are not allowed
  452. </entry>
  453. </row>
  454. <row>
  455. <entry>UNKNOWN_TLD</entry>
  456. <entry>
  457. '%value%' appears to be a DNS hostname but cannot match TLD against known
  458. list
  459. </entry>
  460. </row>
  461. <row>
  462. <entry>INVALID_DASH</entry>
  463. <entry>
  464. '%value%' appears to be a DNS hostname but contains a dash (-) in an invalid
  465. position
  466. </entry>
  467. </row>
  468. <row>
  469. <entry>INVALID_HOSTNAME_SCHEMA</entry>
  470. <entry>
  471. '%value%' appears to be a DNS hostname but cannot match against hostname
  472. schema for TLD '%tld%'
  473. </entry>
  474. </row>
  475. <row>
  476. <entry>UNDECIPHERABLE_TLD</entry>
  477. <entry>
  478. '%value%' appears to be a DNS hostname but cannot extract TLD part
  479. </entry>
  480. </row>
  481. <row>
  482. <entry>INVALID_HOSTNAME</entry>
  483. <entry>
  484. '%value%' does not match the expected structure for a DNS hostname
  485. </entry>
  486. </row>
  487. <row>
  488. <entry>INVALID_LOCAL_NAME</entry>
  489. <entry>'%value%' does not appear to be a valid local network name</entry>
  490. </row>
  491. <row>
  492. <entry>LOCAL_NAME_NOT_ALLOWED</entry>
  493. <entry>
  494. '%value%' appears to be a local network name but local network names are not
  495. allowed
  496. </entry>
  497. </row>
  498. <row>
  499. <entry morerows="2" valign="middle">Iban</entry>
  500. <entry>NOTSUPPORTED</entry>
  501. <entry>'%value%' does not have IBAN</entry>
  502. </row>
  503. <row>
  504. <entry>FALSEFORMAT</entry>
  505. <entry>'%value%' has a false format</entry>
  506. </row>
  507. <row>
  508. <entry>CHECKFAILED</entry>
  509. <entry>'%value%' has failed the IBAN check</entry>
  510. </row>
  511. <row>
  512. <entry morerows="1" valign="middle">Identical</entry>
  513. <entry>NOT_SAME</entry>
  514. <entry>The token '%token%' does not match the given token '%value%'</entry>
  515. </row>
  516. <row>
  517. <entry>MISSING_TOKEN</entry>
  518. <entry>No token was provided to match against</entry>
  519. </row>
  520. <row>
  521. <entry>InArray</entry>
  522. <entry>NOT_IN_ARRAY</entry>
  523. <entry>'%value%' was not found in the haystack</entry>
  524. </row>
  525. <row>
  526. <entry>Int</entry>
  527. <entry>NOT_INT</entry>
  528. <entry>'%value%' does not appear to be an integer</entry>
  529. </row>
  530. <row>
  531. <entry>Ip</entry>
  532. <entry>NOT_IP_ADDRESS</entry>
  533. <entry>'%value%' does not appear to be a valid IP address</entry>
  534. </row>
  535. <row>
  536. <entry>LessThan</entry>
  537. <entry>NOT_LESS</entry>
  538. <entry>'%value%' is not less than '%max%'</entry>
  539. </row>
  540. <row>
  541. <entry>NotEmpty</entry>
  542. <entry>IS_EMPTY</entry>
  543. <entry>Value is required and can't be empty</entry>
  544. </row>
  545. <row>
  546. <entry>Regex</entry>
  547. <entry>NOT_MATCH</entry>
  548. <entry>'%value%' does not match against pattern '%pattern%'</entry>
  549. </row>
  550. <row>
  551. <entry morerows="1" valign="middle">StringLength</entry>
  552. <entry>TOO_SHORT</entry>
  553. <entry>'%value%' is less than %min% characters long</entry>
  554. </row>
  555. <row>
  556. <entry>TOO_LONG</entry>
  557. <entry>'%value%' is greater than %max% characters long</entry>
  558. </row>
  559. </tbody>
  560. </tgroup>
  561. </table>
  562. <para>
  563. Additionally you can retrieve all message templates of a validator with
  564. the method <code>getMessageTemplates()</code>. It returns you an array
  565. with the messages a validator could return in the case of a failed validation.
  566. </para>
  567. <programlisting language="php"><![CDATA[
  568. $validator = new Zend_Validate_Alnum();
  569. $messages = $validator->getMessageTemplates();
  570. ]]></programlisting>
  571. </sect1>
  572. <!--
  573. vim:se ts=4 sw=4 et:
  574. -->