|
| 1 | +/* |
| 2 | + +----------------------------------------------------------------------+ |
| 3 | + | Copyright (c) The PHP Group | |
| 4 | + +----------------------------------------------------------------------+ |
| 5 | + | This source file is subject to version 3.01 of the PHP license, | |
| 6 | + | that is bundled with this package in the file LICENSE, and is | |
| 7 | + | available through the world-wide-web at the following url: | |
| 8 | + | http://www.php.net/license/3_01.txt | |
| 9 | + | If you did not receive a copy of the PHP license and are unable to | |
| 10 | + | obtain it through the world-wide-web, please send a note to | |
| 11 | + | [email protected] so we can mail you a copy immediately. | |
| 12 | + +----------------------------------------------------------------------+ |
| 13 | + | Authors: George Peter Banyard <[email protected]> | |
| 14 | + +----------------------------------------------------------------------+ |
| 15 | + */ |
| 16 | + |
| 17 | +/* {{{ includes */ |
| 18 | +#include "php.h" |
| 19 | +#include "zend_exceptions.h" |
| 20 | +#include "io_exceptions.h" |
| 21 | +#include "io_exceptions_arginfo.h" |
| 22 | + |
| 23 | +/* Class entry pointers */ |
| 24 | +PHPAPI zend_class_entry *zend_ce_filesystem; |
| 25 | +PHPAPI zend_class_entry *zend_ce_network; |
| 26 | +PHPAPI zend_class_entry *zend_ce_filesystem_error; |
| 27 | +PHPAPI zend_class_entry *zend_ce_insufficient_permissions; |
| 28 | +PHPAPI zend_class_entry *zend_ce_temporary_failure; |
| 29 | + |
| 30 | +PHP_MINIT_FUNCTION(io_exceptions) { |
| 31 | + zend_class_entry ce; |
| 32 | + |
| 33 | + /* Register interfaces */ |
| 34 | + INIT_CLASS_ENTRY(ce, "FileSystem", class_FileSystem_methods); |
| 35 | + zend_ce_filesystem = zend_register_internal_interface(&ce); |
| 36 | + |
| 37 | + INIT_CLASS_ENTRY(ce, "Network", class_Network_methods); |
| 38 | + zend_ce_network = zend_register_internal_interface(&ce); |
| 39 | + |
| 40 | + /* Register exceptions */ |
| 41 | + INIT_CLASS_ENTRY(ce, "FileSystemError", class_FileSystemError_methods); |
| 42 | + zend_ce_filesystem_error = zend_register_internal_class_ex(&ce, zend_ce_exception); |
| 43 | + zend_class_implements(zend_ce_filesystem_error, 1, zend_ce_filesystem); |
| 44 | + |
| 45 | + INIT_CLASS_ENTRY(ce, "InsufficientPermissions", class_InsufficientPermissions_methods); |
| 46 | + zend_ce_insufficient_permissions = zend_register_internal_class_ex(&ce, zend_ce_exception); |
| 47 | + zend_class_implements(zend_ce_insufficient_permissions, 1, zend_ce_filesystem); |
| 48 | + |
| 49 | + INIT_CLASS_ENTRY(ce, "TemporaryFailure", class_TemporaryFailure_methods); |
| 50 | + zend_ce_temporary_failure = zend_register_internal_class_ex(&ce, zend_ce_exception); |
| 51 | + zend_class_implements(zend_ce_temporary_failure, 1, zend_ce_network); |
| 52 | + |
| 53 | + return SUCCESS; |
| 54 | +} |
0 commit comments