Zend_Validate-Messages.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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">Digits</entry>
  101. <entry>NOT_DIGITS</entry>
  102. <entry>'%value%' contains not only digit characters</entry>
  103. </row>
  104. <row>
  105. <entry>STRING_EMPTY</entry>
  106. <entry>'%value%' is an empty string</entry>
  107. </row>
  108. <row>
  109. <entry morerows="6" valign="middle">EmailAddress</entry>
  110. <entry>INVALID</entry>
  111. <entry>
  112. '%value%' is not a valid email address in the basic format
  113. local-part@hostname
  114. </entry>
  115. </row>
  116. <row>
  117. <entry>INVALID_HOSTNAME</entry>
  118. <entry>'%hostname%' is not a valid hostname for email address '%value%'</entry>
  119. </row>
  120. <row>
  121. <entry>INVALID_MX_RECORD</entry>
  122. <entry>
  123. '%hostname%' does not appear to have a valid MX record for the email address
  124. '%value%'
  125. </entry>
  126. </row>
  127. <row>
  128. <entry>DOT_ATOM</entry>
  129. <entry>'%localPart%' not matched against dot-atom format</entry>
  130. </row>
  131. <row>
  132. <entry>QUOTED_STRING</entry>
  133. <entry>'%localPart%' not matched against quoted-string format</entry>
  134. </row>
  135. <row>
  136. <entry>INVALID_LOCAL_PART</entry>
  137. <entry>
  138. '%localPart%' is not a valid local part for email address '%value%'
  139. </entry>
  140. </row>
  141. <row>
  142. <entry>LENGTH_EXCEEDED</entry>
  143. <entry>'%value%' exceeds the allowed length</entry>
  144. </row>
  145. <row>
  146. <entry morerows="1" valign="middle">File_Count</entry>
  147. <entry>TOO_MUCH</entry>
  148. <entry>
  149. Too much files, maximum '%max%' are allowed but '%count%' are given
  150. </entry>
  151. </row>
  152. <row>
  153. <entry>TOO_LESS</entry>
  154. <entry>
  155. Too less files, minimum '%min%' are expected but '%count%' are given
  156. </entry>
  157. </row>
  158. <row>
  159. <entry morerows="2" valign="middle">File_Crc32</entry>
  160. <entry>DOES_NOT_MATCH</entry>
  161. <entry>The file '%value%' does not match the given crc32 hashes</entry>
  162. </row>
  163. <row>
  164. <entry>NOT_DETECTED</entry>
  165. <entry>There was no crc32 hash detected for the given file</entry>
  166. </row>
  167. <row>
  168. <entry>NOT_FOUND</entry>
  169. <entry>The file '%value%' could not be found</entry>
  170. </row>
  171. <row>
  172. <entry morerows="1" valign="middle">File_ExcludeExtension</entry>
  173. <entry>FALSE_EXTENSION</entry>
  174. <entry>The file '%value%' has a false extension</entry>
  175. </row>
  176. <row>
  177. <entry>NOT_FOUND</entry>
  178. <entry>The file '%value%' was not found</entry>
  179. </row>
  180. <row>
  181. <entry morerows="2" valign="middle">File_ExcludeMimeType</entry>
  182. <entry>FALSE_TYPE</entry>
  183. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  184. </row>
  185. <row>
  186. <entry>NOT_DETECTED</entry>
  187. <entry>The mimetype of file '%value%' could not been detected</entry>
  188. </row>
  189. <row>
  190. <entry>NOT_READABLE</entry>
  191. <entry>The file '%value%' can not be read</entry>
  192. </row>
  193. <row>
  194. <entry morerows="2" valign="middle">File_Exists</entry>
  195. <entry>DOES_NOT_EXIST</entry>
  196. <entry>The file '%value%' does not exist</entry>
  197. </row>
  198. <row>
  199. <entry morerows="1" valign="middle">File_Extension</entry>
  200. <entry>FALSE_EXTENSION</entry>
  201. <entry>The file '%value%' has a false extension</entry>
  202. </row>
  203. <row>
  204. <entry>NOT_FOUND</entry>
  205. <entry>The file '%value%' was not found</entry>
  206. </row>
  207. <row>
  208. <entry morerows="2" valign="middle">File_FilesSize</entry>
  209. <entry>TOO_BIG</entry>
  210. <entry>
  211. All files in sum should have a maximum size of '%max%' but '%size%' were
  212. detected
  213. </entry>
  214. </row>
  215. <row>
  216. <entry>TOO_SMALL</entry>
  217. <entry>
  218. All files in sum should have a minimum size of '%min%' but '%size%' were
  219. detected
  220. </entry>
  221. </row>
  222. <row>
  223. <entry>NOT_READABLE</entry>
  224. <entry>One or more files can not be read</entry>
  225. </row>
  226. <row>
  227. <entry morerows="2" valign="middle">File_Hash</entry>
  228. <entry>DOES_NOT_MATCH</entry>
  229. <entry>The file '%value%' does not match the given hashes</entry>
  230. </row>
  231. <row>
  232. <entry>NOT_DETECTED</entry>
  233. <entry>There was no hash detected for the given file</entry>
  234. </row>
  235. <row>
  236. <entry>NOT_FOUND</entry>
  237. <entry>The file '%value%' could not be found</entry>
  238. </row>
  239. <row>
  240. <entry morerows="5" valign="middle">File_ImageSize</entry>
  241. <entry>WIDTH_TOO_BIG</entry>
  242. <entry>
  243. Maximum allowed width for image '%value%' should be '%maxwidth%' but
  244. '%width%' detected
  245. </entry>
  246. </row>
  247. <row>
  248. <entry>WIDTH_TOO_SMALL</entry>
  249. <entry>
  250. Minimum expected width for image '%value%' should be '%minwidth%' but
  251. '%width%' detected
  252. </entry>
  253. </row>
  254. <row>
  255. <entry>HEIGHT_TOO_BIG</entry>
  256. <entry>
  257. Maximum allowed height for image '%value%' should be '%maxheight%' but
  258. '%height%' detected
  259. </entry>
  260. </row>
  261. <row>
  262. <entry>HEIGHT_TOO_SMALL</entry>
  263. <entry>
  264. Minimum expected height for image '%value%' should be '%minheight%' but
  265. '%height%' detected
  266. </entry>
  267. </row>
  268. <row>
  269. <entry>NOT_DETECTED</entry>
  270. <entry>The size of image '%value%' could not be detected</entry>
  271. </row>
  272. <row>
  273. <entry>NOT_READABLE</entry>
  274. <entry>The image '%value%' can not be read</entry>
  275. </row>
  276. <row>
  277. <entry morerows="2" valign="middle">File_IsCompressed</entry>
  278. <entry>FALSE_TYPE</entry>
  279. <entry>The file '%value%' is not compressed, '%type%' detected</entry>
  280. </row>
  281. <row>
  282. <entry>NOT_DETECTED</entry>
  283. <entry>The mimetype of file '%value%' could not been detected</entry>
  284. </row>
  285. <row>
  286. <entry>NOT_READABLE</entry>
  287. <entry>The file '%value%' can not be read</entry>
  288. </row>
  289. <row>
  290. <entry morerows="2" valign="middle">File_IsImage</entry>
  291. <entry>FALSE_TYPE</entry>
  292. <entry>The file '%value%' is no image, '%type%' detected</entry>
  293. </row>
  294. <row>
  295. <entry>NOT_DETECTED</entry>
  296. <entry>The mimetype of file '%value%' could not been detected</entry>
  297. </row>
  298. <row>
  299. <entry>NOT_READABLE</entry>
  300. <entry>The file '%value%' can not be read</entry>
  301. </row>
  302. <row>
  303. <entry morerows="2" valign="middle">File_Md5</entry>
  304. <entry>DOES_NOT_MATCH</entry>
  305. <entry>The file '%value%' does not match the given md5 hashes</entry>
  306. </row>
  307. <row>
  308. <entry>NOT_DETECTED</entry>
  309. <entry>There was no md5 hash detected for the given file</entry>
  310. </row>
  311. <row>
  312. <entry>NOT_FOUND</entry>
  313. <entry>The file '%value%' could not be found</entry>
  314. </row>
  315. <row>
  316. <entry morerows="2" valign="middle">File_MimeType</entry>
  317. <entry>FALSE_TYPE</entry>
  318. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  319. </row>
  320. <row>
  321. <entry>NOT_DETECTED</entry>
  322. <entry>The mimetype of file '%value%' could not been detected</entry>
  323. </row>
  324. <row>
  325. <entry>NOT_READABLE</entry>
  326. <entry>The file '%value%' can not be read</entry>
  327. </row>
  328. <row>
  329. <entry>File_NotExists</entry>
  330. <entry>DOES_EXIST</entry>
  331. <entry>The file '%value%' does exist</entry>
  332. </row>
  333. <row>
  334. <entry morerows="2" valign="middle">File_Sha1</entry>
  335. <entry>DOES_NOT_MATCH</entry>
  336. <entry>The file '%value%' does not match the given sha1 hashes</entry>
  337. </row>
  338. <row>
  339. <entry>NOT_DETECTED</entry>
  340. <entry>There was no sha1 hash detected for the given file</entry>
  341. </row>
  342. <row>
  343. <entry>NOT_FOUND</entry>
  344. <entry>The file '%value%' could not be found</entry>
  345. </row>
  346. <row>
  347. <entry morerows="2" valign="middle">File_Size</entry>
  348. <entry>TOO_BIG</entry>
  349. <entry>
  350. Maximum allowed size for file '%value%' is '%max%' but '%size%' detected
  351. </entry>
  352. </row>
  353. <row>
  354. <entry>TOO_SMALL</entry>
  355. <entry>
  356. Minimum expected size for file '%value%' is '%min%' but '%size%' detected
  357. </entry>
  358. </row>
  359. <row>
  360. <entry>NOT_FOUND</entry>
  361. <entry>The file '%value%' could not be found</entry>
  362. </row>
  363. <row>
  364. <entry morerows="9" valign="middle">File_Upload</entry>
  365. <entry>INI_SIZE</entry>
  366. <entry>The file '%value%' exceeds the defined ini size</entry>
  367. </row>
  368. <row>
  369. <entry>FORM_SIZE</entry>
  370. <entry>The file '%value%' exceeds the defined form size</entry>
  371. </row>
  372. <row>
  373. <entry>PARTIAL</entry>
  374. <entry>The file '%value%' was only partially uploaded</entry>
  375. </row>
  376. <row>
  377. <entry>NO_FILE</entry>
  378. <entry>The file '%value%' was not uploaded</entry>
  379. </row>
  380. <row>
  381. <entry>NO_TMP_DIR</entry>
  382. <entry>No temporary directory was found for the file '%value%'</entry>
  383. </row>
  384. <row>
  385. <entry>CANT_WRITE</entry>
  386. <entry>The file '%value%' can't be written</entry>
  387. </row>
  388. <row>
  389. <entry>EXTENSION</entry>
  390. <entry>
  391. The extension returned an error while uploading the file '%value%'
  392. </entry>
  393. </row>
  394. <row>
  395. <entry>ATTACK</entry>
  396. <entry>The file '%value%' was illegal uploaded, possible attack</entry>
  397. </row>
  398. <row>
  399. <entry>FILE_NOT_FOUND</entry>
  400. <entry>The file '%value%' was not found</entry>
  401. </row>
  402. <row>
  403. <entry>UNKNOWN</entry>
  404. <entry>Unknown error while uploading the file '%value%'</entry>
  405. </row>
  406. <row>
  407. <entry morerows="2" valign="middle">File_WordCount</entry>
  408. <entry>TOO_MUCH</entry>
  409. <entry>
  410. Too much words, maximum '%max%' are allowed but '%count%' were counted
  411. </entry>
  412. </row>
  413. <row>
  414. <entry>TOO_LESS</entry>
  415. <entry>
  416. Too less words, minimum '%min%' are expected but '%count%' were counted
  417. </entry>
  418. </row>
  419. <row>
  420. <entry>NOT_FOUND</entry>
  421. <entry>The file '%value%' could not be found</entry>
  422. </row>
  423. <row>
  424. <entry>Float</entry>
  425. <entry>NOT_FLOAT</entry>
  426. <entry>'%value%' does not appear to be a float</entry>
  427. </row>
  428. <row>
  429. <entry>GreaterThan</entry>
  430. <entry>NOT_GREATER</entry>
  431. <entry>'%value%' is not greater than '%min%'</entry>
  432. </row>
  433. <row>
  434. <entry>Hex</entry>
  435. <entry>NOT_HEX</entry>
  436. <entry>'%value%' has not only hexadecimal digit characters</entry>
  437. </row>
  438. <row>
  439. <entry morerows="7" valign="middle">Hostname</entry>
  440. <entry>IP_ADDRESS_NOT_ALLOWED</entry>
  441. <entry>
  442. '%value%' appears to be an IP address, but IP addresses are not allowed
  443. </entry>
  444. </row>
  445. <row>
  446. <entry>UNKNOWN_TLD</entry>
  447. <entry>
  448. '%value%' appears to be a DNS hostname but cannot match TLD against known
  449. list
  450. </entry>
  451. </row>
  452. <row>
  453. <entry>INVALID_DASH</entry>
  454. <entry>
  455. '%value%' appears to be a DNS hostname but contains a dash (-) in an invalid
  456. position
  457. </entry>
  458. </row>
  459. <row>
  460. <entry>INVALID_HOSTNAME_SCHEMA</entry>
  461. <entry>
  462. '%value%' appears to be a DNS hostname but cannot match against hostname
  463. schema for TLD '%tld%'
  464. </entry>
  465. </row>
  466. <row>
  467. <entry>UNDECIPHERABLE_TLD</entry>
  468. <entry>
  469. '%value%' appears to be a DNS hostname but cannot extract TLD part
  470. </entry>
  471. </row>
  472. <row>
  473. <entry>INVALID_HOSTNAME</entry>
  474. <entry>
  475. '%value%' does not match the expected structure for a DNS hostname
  476. </entry>
  477. </row>
  478. <row>
  479. <entry>INVALID_LOCAL_NAME</entry>
  480. <entry>'%value%' does not appear to be a valid local network name</entry>
  481. </row>
  482. <row>
  483. <entry>LOCAL_NAME_NOT_ALLOWED</entry>
  484. <entry>
  485. '%value%' appears to be a local network name but local network names are not
  486. allowed
  487. </entry>
  488. </row>
  489. <row>
  490. <entry morerows="2" valign="middle">Iban</entry>
  491. <entry>NOTSUPPORTED</entry>
  492. <entry>'%value%' does not have IBAN</entry>
  493. </row>
  494. <row>
  495. <entry>FALSEFORMAT</entry>
  496. <entry>'%value%' has a false format</entry>
  497. </row>
  498. <row>
  499. <entry>CHECKFAILED</entry>
  500. <entry>'%value%' has failed the IBAN check</entry>
  501. </row>
  502. <row>
  503. <entry morerows="1" valign="middle">Identical</entry>
  504. <entry>NOT_SAME</entry>
  505. <entry>The token '%token%' does not match the given token '%value%'</entry>
  506. </row>
  507. <row>
  508. <entry>MISSING_TOKEN</entry>
  509. <entry>No token was provided to match against</entry>
  510. </row>
  511. <row>
  512. <entry>InArray</entry>
  513. <entry>NOT_IN_ARRAY</entry>
  514. <entry>'%value%' was not found in the haystack</entry>
  515. </row>
  516. <row>
  517. <entry>Int</entry>
  518. <entry>NOT_INT</entry>
  519. <entry>'%value%' does not appear to be an integer</entry>
  520. </row>
  521. <row>
  522. <entry>Ip</entry>
  523. <entry>NOT_IP_ADDRESS</entry>
  524. <entry>'%value%' does not appear to be a valid IP address</entry>
  525. </row>
  526. <row>
  527. <entry>LessThan</entry>
  528. <entry>NOT_LESS</entry>
  529. <entry>'%value%' is not less than '%max%'</entry>
  530. </row>
  531. <row>
  532. <entry>NotEmpty</entry>
  533. <entry>IS_EMPTY</entry>
  534. <entry>Value is required and can't be empty</entry>
  535. </row>
  536. <row>
  537. <entry>Regex</entry>
  538. <entry>NOT_MATCH</entry>
  539. <entry>'%value%' does not match against pattern '%pattern%'</entry>
  540. </row>
  541. <row>
  542. <entry morerows="1" valign="middle">StringLength</entry>
  543. <entry>TOO_SHORT</entry>
  544. <entry>'%value%' is less than %min% characters long</entry>
  545. </row>
  546. <row>
  547. <entry>TOO_LONG</entry>
  548. <entry>'%value%' is greater than %max% characters long</entry>
  549. </row>
  550. </tbody>
  551. </tgroup>
  552. </table>
  553. <para>
  554. Additionally you can retrieve all message templates of a validator with
  555. the method <code>getMessageTemplates()</code>. It returns you an array
  556. with the messages a validator could return in the case of a failed validation.
  557. </para>
  558. <programlisting language="php"><![CDATA[
  559. $validator = new Zend_Validate_Alnum();
  560. $messages = $validator->getMessageTemplates();
  561. ]]></programlisting>
  562. </sect1>
  563. <!--
  564. vim:se ts=4 sw=4 et:
  565. -->