forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
173 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
+----------------------------------------------------------------------+ | ||
| Copyright (c) The PHP Group | | ||
+----------------------------------------------------------------------+ | ||
| This source file is subject to version 3.01 of the PHP license, | | ||
| that is bundled with this package in the file LICENSE, and is | | ||
| available through the world-wide-web at the following url: | | ||
| http://www.php.net/license/3_01.txt | | ||
| If you did not receive a copy of the PHP license and are unable to | | ||
| obtain it through the world-wide-web, please send a note to | | ||
| [email protected] so we can mail you a copy immediately. | | ||
+----------------------------------------------------------------------+ | ||
| Authors: George Peter Banyard <[email protected]> | | ||
+----------------------------------------------------------------------+ | ||
*/ | ||
|
||
/* {{{ includes */ | ||
#include "php.h" | ||
#include "zend_exceptions.h" | ||
#include "io_exceptions.h" | ||
#include "io_exceptions_arginfo.h" | ||
|
||
/* Class entry pointers */ | ||
PHPAPI zend_class_entry *zend_ce_filesystem; | ||
PHPAPI zend_class_entry *zend_ce_network; | ||
PHPAPI zend_class_entry *zend_ce_filesystem_error; | ||
PHPAPI zend_class_entry *zend_ce_insufficient_permissions; | ||
PHPAPI zend_class_entry *zend_ce_temporary_failure; | ||
|
||
PHP_MINIT_FUNCTION(io_exceptions) { | ||
zend_class_entry ce; | ||
|
||
/* Register interfaces */ | ||
INIT_CLASS_ENTRY(ce, "FileSystem", class_FileSystem_methods); | ||
zend_ce_filesystem = zend_register_internal_interface(&ce); | ||
|
||
INIT_CLASS_ENTRY(ce, "Network", class_Network_methods); | ||
zend_ce_network = zend_register_internal_interface(&ce); | ||
|
||
/* Register exceptions */ | ||
INIT_CLASS_ENTRY(ce, "FileSystemError", class_FileSystemError_methods); | ||
zend_ce_filesystem_error = zend_register_internal_class_ex(&ce, zend_ce_exception); | ||
zend_class_implements(zend_ce_filesystem_error, 1, zend_ce_filesystem); | ||
|
||
INIT_CLASS_ENTRY(ce, "InsufficientPermissions", class_InsufficientPermissions_methods); | ||
zend_ce_insufficient_permissions = zend_register_internal_class_ex(&ce, zend_ce_exception); | ||
zend_class_implements(zend_ce_insufficient_permissions, 1, zend_ce_filesystem); | ||
|
||
INIT_CLASS_ENTRY(ce, "TemporaryFailure", class_TemporaryFailure_methods); | ||
zend_ce_temporary_failure = zend_register_internal_class_ex(&ce, zend_ce_exception); | ||
zend_class_implements(zend_ce_temporary_failure, 1, zend_ce_network); | ||
|
||
return SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
+----------------------------------------------------------------------+ | ||
| Copyright (c) The PHP Group | | ||
+----------------------------------------------------------------------+ | ||
| This source file is subject to version 3.01 of the PHP license, | | ||
| that is bundled with this package in the file LICENSE, and is | | ||
| available through the world-wide-web at the following url: | | ||
| http://www.php.net/license/3_01.txt | | ||
| If you did not receive a copy of the PHP license and are unable to | | ||
| obtain it through the world-wide-web, please send a note to | | ||
| [email protected] so we can mail you a copy immediately. | | ||
+----------------------------------------------------------------------+ | ||
| Authors: George Peter Banyard <[email protected]> | | ||
+----------------------------------------------------------------------+ | ||
*/ | ||
|
||
#ifndef PHP_IO_EXCEPTION | ||
#define PHP_IO_EXCEPTION | ||
|
||
PHP_MINIT_FUNCTION(io_exceptions); | ||
|
||
BEGIN_EXTERN_C() | ||
|
||
extern PHPAPI zend_class_entry *zend_ce_filesystem; | ||
extern PHPAPI zend_class_entry *zend_ce_network; | ||
extern PHPAPI zend_class_entry *zend_ce_filesystem_error; | ||
extern PHPAPI zend_class_entry *zend_ce_insufficient_permissions; | ||
extern PHPAPI zend_class_entry *zend_ce_temporary_failure; | ||
|
||
END_EXTERN_C() | ||
|
||
#endif /* PHP_IO_EXCEPTION */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
/** @generate-function-entries */ | ||
|
||
interface FileSystem extends IO {} | ||
|
||
interface Network extends IO {} | ||
|
||
/* Should use more specialized ones instead but for PoC will use this instead */ | ||
class FileSystemError extends Exception implements FileSystem {} | ||
|
||
class InsufficientPermissions extends Exception implements FileSystem {} | ||
|
||
class TemporaryFailure extends Exception implements Network {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* This is a generated file, edit the .stub.php file instead. | ||
* Stub hash: 68880a94d8393c0d367cee9e9c18c8ac6d16d9f2 */ | ||
|
||
|
||
|
||
|
||
static const zend_function_entry class_FileSystem_methods[] = { | ||
ZEND_FE_END | ||
}; | ||
|
||
|
||
static const zend_function_entry class_Network_methods[] = { | ||
ZEND_FE_END | ||
}; | ||
|
||
|
||
static const zend_function_entry class_FileSystemError_methods[] = { | ||
ZEND_FE_END | ||
}; | ||
|
||
|
||
static const zend_function_entry class_InsufficientPermissions_methods[] = { | ||
ZEND_FE_END | ||
}; | ||
|
||
|
||
static const zend_function_entry class_TemporaryFailure_methods[] = { | ||
ZEND_FE_END | ||
}; |