Skip to content

Commit

Permalink
switched to The BSD 3-Clause License
Browse files Browse the repository at this point in the history
  • Loading branch information
zenovich committed Jan 2, 2012
1 parent ee43586 commit 70c9aa4
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 60 deletions.
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright (c) 2008-2012, Dmitry Zenovich
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of contributors of "runkit" may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

8 changes: 4 additions & 4 deletions php_runkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down
12 changes: 6 additions & 6 deletions runkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down Expand Up @@ -139,7 +139,7 @@ zend_module_entry runkit_module_entry = {
PHP_RSHUTDOWN(runkit),
PHP_MINFO(runkit),
#if ZEND_MODULE_API_NO >= 20010901
PHP_RUNKIT_VERSION,
PHP_RUNKIT_VERSION,
#endif
STANDARD_MODULE_PROPERTIES
};
Expand Down Expand Up @@ -174,7 +174,7 @@ static void php_runkit_globals_ctor(zend_runkit_globals *runkit_global TSRMLS_DC
#define php_runkit_feature_constant(feature, enabled) \
_php_runkit_feature_constant("RUNKIT_FEATURE_" #feature, sizeof("RUNKIT_FEATURE_" #feature), (enabled), \
CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
static void _php_runkit_feature_constant(const char *name, size_t name_len, zend_bool enabled,
static void _php_runkit_feature_constant(const char *name, size_t name_len, zend_bool enabled,
int flags, int module_number TSRMLS_DC)
{
zend_constant c;
Expand Down
8 changes: 4 additions & 4 deletions runkit_classes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down
8 changes: 4 additions & 4 deletions runkit_constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down
10 changes: 5 additions & 5 deletions runkit_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down Expand Up @@ -441,7 +441,7 @@ PHP_FUNCTION(runkit_function_copy)
PHP_RUNKIT_DECL_STRING_PARAM(dfunc)
zend_function *fe;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
PHP_RUNKIT_STRING_SPEC "/" PHP_RUNKIT_STRING_SPEC "/",
PHP_RUNKIT_STRING_PARAM(sfunc),
PHP_RUNKIT_STRING_PARAM(dfunc)) == FAILURE) {
Expand Down
26 changes: 13 additions & 13 deletions runkit_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down Expand Up @@ -43,9 +43,9 @@ static int php_runkit_import_functions(HashTable *function_table, long flags TSR
new_key = fe->common.function_name;
new_key_len = strlen(new_key) + 1;

if (((type = zend_hash_get_current_key_ex(function_table, &key, &key_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) &&
if (((type = zend_hash_get_current_key_ex(function_table, &key, &key_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) &&
fe && fe->type == ZEND_USER_FUNCTION) {

if (type == HASH_KEY_IS_STRING) {
new_key = key;
new_key_len = key_len;
Expand Down Expand Up @@ -112,7 +112,7 @@ static int php_runkit_import_class_methods(zend_class_entry *dce, zend_class_ent
zend_function *dfe;
int fn_len = strlen(fe->common.function_name);
zend_class_entry *fe_scope = php_runkit_locate_scope(ce, fe, fe->common.function_name, fn_len);

if (fe_scope != ce) {
/* This is an inhereted function, let's skip it */
zend_hash_move_forward_ex(&ce->function_table, &pos);
Expand Down Expand Up @@ -354,7 +354,7 @@ static int php_runkit_import_classes(HashTable *class_table, long flags TSRMLS_D
return FAILURE;
}

if (((type = zend_hash_get_current_key_ex(EG(class_table), &key, &key_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) &&
if (((type = zend_hash_get_current_key_ex(EG(class_table), &key, &key_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) &&
ce && ce->type == ZEND_USER_CLASS) {
zend_class_entry *dce;

Expand All @@ -366,7 +366,7 @@ static int php_runkit_import_classes(HashTable *class_table, long flags TSRMLS_D
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot redeclare class %s", ce->name);
continue;
}

if (flags & PHP_RUNKIT_IMPORT_CLASS_METHODS) {
php_runkit_import_class_methods(dce, ce, (flags & PHP_RUNKIT_IMPORT_OVERRIDE) TSRMLS_CC);
}
Expand Down Expand Up @@ -465,7 +465,7 @@ static zend_op_array *php_runkit_compile_filename(int type, zval *filename TSRML
/* }}} */

/* {{{ array runkit_import(string filename[, long flags])
Import functions and class definitions from a file
Import functions and class definitions from a file
Similar to include(), but doesn't execute root op_array, and allows pre-existing functions/methods to be overridden */
PHP_FUNCTION(runkit_import)
{
Expand All @@ -491,18 +491,18 @@ PHP_FUNCTION(runkit_import)
class_table = (HashTable *) emalloc(sizeof(HashTable));
zend_hash_init_ex(class_table, 10, NULL, ZEND_CLASS_DTOR, 0, 0);
function_table = (HashTable *) emalloc(sizeof(HashTable));
zend_hash_init_ex(function_table, 100, NULL, ZEND_FUNCTION_DTOR, 0, 0);
zend_hash_init_ex(function_table, 100, NULL, ZEND_FUNCTION_DTOR, 0, 0);

current_class_table = CG(class_table);
CG(class_table) = class_table;
current_function_table = CG(function_table);
CG(function_table) = function_table;

new_op_array = local_compile_filename(ZEND_INCLUDE, filename TSRMLS_CC);

CG(class_table) = current_class_table;
CG(function_table) = current_function_table;

if (!new_op_array) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Import Failure");
RETURN_FALSE;
Expand Down
16 changes: 8 additions & 8 deletions runkit_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down Expand Up @@ -161,7 +161,7 @@ int php_runkit_fetch_interface(char *classname, int classname_len, zend_class_en

/* {{{ php_runkit_fetch_class_method
*/
static int php_runkit_fetch_class_method(char *classname, int classname_len, char *fname, int fname_len, zend_class_entry **pce, zend_function **pfe
static int php_runkit_fetch_class_method(char *classname, int classname_len, char *fname, int fname_len, zend_class_entry **pce, zend_function **pfe
TSRMLS_DC)
{
HashTable *ftable = EG(function_table);
Expand Down Expand Up @@ -434,7 +434,7 @@ static void php_runkit_method_add_or_update(INTERNAL_FUNCTION_PARAMETERS, int ad
}
#endif

zend_hash_apply_with_arguments(RUNKIT_53_TSRMLS_PARAM(EG(class_table)), (apply_func_args_t)php_runkit_update_children_methods, 5, ancestor_class, ce, &func, methodname,
zend_hash_apply_with_arguments(RUNKIT_53_TSRMLS_PARAM(EG(class_table)), (apply_func_args_t)php_runkit_update_children_methods, 5, ancestor_class, ce, &func, methodname,
methodname_len);

if (zend_hash_add_or_update(&ce->function_table, methodname_lower, methodname_len + 1, &func, sizeof(zend_function), NULL, add_or_update) == FAILURE) {
Expand Down Expand Up @@ -493,7 +493,7 @@ static int php_runkit_method_copy(char *dclass, int dclass_len, char *dfunc, int
}

dfe = *sfe;
php_runkit_function_copy_ctor(&dfe, estrndup(dfunc, dfunc_len));
php_runkit_function_copy_ctor(&dfe, estrndup(dfunc, dfunc_len));

#ifdef ZEND_ENGINE_2
dfe.common.scope = dce;
Expand Down Expand Up @@ -624,7 +624,7 @@ PHP_FUNCTION(runkit_method_rename)
}

ancestor_class = php_runkit_locate_scope(ce, fe, methodname, methodname_len);
zend_hash_apply_with_arguments(RUNKIT_53_TSRMLS_PARAM(EG(class_table)), (apply_func_args_t)php_runkit_clean_children_methods, 4, ancestor_class, ce, methodname,
zend_hash_apply_with_arguments(RUNKIT_53_TSRMLS_PARAM(EG(class_table)), (apply_func_args_t)php_runkit_clean_children_methods, 4, ancestor_class, ce, methodname,
methodname_len);

func = *fe;
Expand Down
8 changes: 4 additions & 4 deletions runkit_props.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2006 The PHP Group, (c) 2008-2012 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| This source file is subject to the new BSD 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_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the 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. |
+----------------------------------------------------------------------+
Expand Down
Loading

0 comments on commit 70c9aa4

Please sign in to comment.