validators.php
Go to the documentation of this file.00001 <?php 00002 /* SVN FILE: $Id: validators_8php-source.html 675 2008-12-26 00:27:14Z gwoo $ */ 00003 /** 00004 * Tort Validators 00005 * 00006 * Used to validate data in Models. 00007 * 00008 * PHP versions 4 and 5 00009 * 00010 * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> 00011 * Copyright 2005-2008, Cake Software Foundation, Inc. 00012 * 1785 E. Sahara Avenue, Suite 490-204 00013 * Las Vegas, Nevada 89104 00014 * 00015 * Licensed under The MIT License 00016 * Redistributions of files must retain the above copyright notice. 00017 * 00018 * @filesource 00019 * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. 00020 * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project 00021 * @package cake 00022 * @subpackage cake.cake.libs 00023 * @since CakePHP(tm) v 0.2.9 00024 * @version $Revision: 675 $ 00025 * @modifiedby $LastChangedBy: gwoo $ 00026 * @lastmodified $Date: 2008-12-25 16:27:14 -0800 (Thu, 25 Dec 2008) $ 00027 * @license http://www.opensource.org/licenses/mit-license.php The MIT License 00028 */ 00029 /** 00030 * Not empty. 00031 */ 00032 define('VALID_NOT_EMPTY', '/.+/'); 00033 /** 00034 * Numbers [0-9] only. 00035 */ 00036 define('VALID_NUMBER', '/^[-+]?\\b[0-9]*\\.?[0-9]+\\b$/'); 00037 /** 00038 * A valid email address. 00039 */ 00040 define('VALID_EMAIL', '/\\A(?:^([a-z0-9][a-z0-9_\\-\\.\\+]*)@([a-z0-9][a-z0-9\\.\\-]{0,63}\\.(com|org|net|biz|info|name|net|pro|aero|coop|museum|[a-z]{2,4}))$)\\z/i'); 00041 /** 00042 * A valid year (1000-2999). 00043 */ 00044 define('VALID_YEAR', '/^[12][0-9]{3}$/'); 00045 ?>