| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* This file contains some core functions extending php, especially regarding constant handling. |
| 5 |
* |
| 6 |
* @author Andreas Motl <andreas.motl@ilo.de> |
| 7 |
* @package org.netfrag.glib |
| 8 |
* @name const |
| 9 |
* |
| 10 |
*/ |
| 11 |
|
| 12 |
/** |
| 13 |
* $Id: php_constants.php,v 1.1 2003/03/28 06:43:20 joko Exp $ |
| 14 |
* |
| 15 |
* $Log: php_constants.php,v $ |
| 16 |
* Revision 1.1 2003/03/28 06:43:20 joko |
| 17 |
* initial commit: php_constants.php |
| 18 |
* |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
|
| 23 |
/** |
| 24 |
* --- functions supporting handling constants |
| 25 |
* |
| 26 |
*/ |
| 27 |
|
| 28 |
|
| 29 |
/** |
| 30 |
* --- php constant extension functions living in the const:: namespace |
| 31 |
* |
| 32 |
* |
| 33 |
* @author Andreas Motl <andreas.motl@ilo.de> |
| 34 |
* @copyright (c) 2003 - All Rights reserved. |
| 35 |
* @license GNU LGPL (GNU Lesser General Public License) |
| 36 |
* |
| 37 |
* @link http://www.netfrag.org/~joko/ |
| 38 |
* @link http://www.gnu.org/licenses/lgpl.txt |
| 39 |
* |
| 40 |
* @package org.netfrag.glib |
| 41 |
* @name const |
| 42 |
* |
| 43 |
* |
| 44 |
*/ |
| 45 |
class constants { |
| 46 |
|
| 47 |
function set($name, $value) { |
| 48 |
define($name, $value); |
| 49 |
} |
| 50 |
|
| 51 |
function get($name) { |
| 52 |
return defined($name) ? constant($name) : null; |
| 53 |
} |
| 54 |
|
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
?> |