Provide better error reporting and error checking when updating a network
[www-register-wizard.git] / codeigniter / Compat.php
1 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');\r
2 /**\r
3  * CodeIgniter\r
4  *\r
5  * An open source application development framework for PHP 4.3.2 or newer\r
6  *\r
7  * @package             CodeIgniter\r
8  * @author              ExpressionEngine Dev Team\r
9  * @copyright   Copyright (c) 2008, EllisLab, Inc.\r
10  * @license             http://codeigniter.com/user_guide/license.html\r
11  * @link                http://codeigniter.com\r
12  * @since               Version 1.0\r
13  * @filesource\r
14  */\r
15 \r
16 // ------------------------------------------------------------------------\r
17 \r
18 /**\r
19  * Compatibility Functions\r
20  *\r
21  * Function overrides for older versions of PHP or PHP environments missing\r
22  * certain extensions / libraries\r
23  *\r
24  * @package             CodeIgniter\r
25  * @subpackage  codeigniter\r
26  * @category    Compatibility Functions\r
27  * @author              ExpressionEngine Development Team\r
28  * @link                http://codeigniter.com/user_guide/\r
29  */\r
30 \r
31 // ------------------------------------------------------------------------\r
32 \r
33 /*\r
34  * PHP versions prior to 5.0 don't support the E_STRICT constant\r
35  * so we need to explicitly define it otherwise the Exception class \r
36  * will generate errors when running under PHP 4\r
37  *\r
38  */\r
39 if ( ! defined('E_STRICT'))\r
40 {\r
41         define('E_STRICT', 2048);\r
42 }\r
43 \r
44 /**\r
45  * ctype_digit()\r
46  *\r
47  * Determines if a string is comprised only of digits\r
48  * http://us.php.net/manual/en/function.ctype_digit.php\r
49  *\r
50  * @access      public\r
51  * @param       string\r
52  * @return      bool\r
53  */\r
54 if ( ! function_exists('ctype_digit'))\r
55 {\r
56         function ctype_digit($str)\r
57         {\r
58                 if ( ! is_string($str) OR $str == '')\r
59                 {\r
60                         return FALSE;\r
61                 }\r
62                 \r
63                 return ! preg_match('/[^0-9]/', $str);\r
64         }       \r
65 }\r
66 \r
67 // --------------------------------------------------------------------\r
68 \r
69 /**\r
70  * ctype_alnum()\r
71  *\r
72  * Determines if a string is comprised of only alphanumeric characters\r
73  * http://us.php.net/manual/en/function.ctype-alnum.php\r
74  *\r
75  * @access      public\r
76  * @param       string\r
77  * @return      bool\r
78  */\r
79 if ( ! function_exists('ctype_alnum'))\r
80 {\r
81         function ctype_alnum($str)\r
82         {\r
83                 if ( ! is_string($str) OR $str == '')\r
84                 {\r
85                         return FALSE;\r
86                 }\r
87                 \r
88                 return ! preg_match('/[^0-9a-z]/i', $str);\r
89         }       \r
90 }\r
91 \r
92 /* End of file Compat.php */\r
93 /* Location: ./system/codeigniter/Compat.php */