Zend_Validate-Messages.xml 23 KB

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