|
|
| version 1.1.1.2, 2012/05/29 12:34:36 | version 1.1.1.3, 2013/07/22 01:32:16 |
|---|---|
| Line 2 | Line 2 |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | Zend Engine | | | Zend Engine | |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | | | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | This source file is subject to version 2.00 of the Zend license, | | | This source file is subject to version 2.00 of the Zend license, | |
| | that is bundled with this package in the file LICENSE, and is | | | that is bundled with this package in the file LICENSE, and is | |
| Line 28 | Line 28 |
| ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC) | ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC) |
| { | { |
| object->ce = ce; | object->ce = ce; |
| object->properties = NULL; | object->properties = NULL; |
| object->properties_table = NULL; | object->properties_table = NULL; |
| object->guards = NULL; | object->guards = NULL; |
| Line 38 ZEND_API void zend_object_std_dtor(zend_object *object | Line 38 ZEND_API void zend_object_std_dtor(zend_object *object |
| { | { |
| if (object->guards) { | if (object->guards) { |
| zend_hash_destroy(object->guards); | zend_hash_destroy(object->guards); |
| FREE_HASHTABLE(object->guards); | FREE_HASHTABLE(object->guards); |
| } | } |
| if (object->properties) { | if (object->properties) { |
| zend_hash_destroy(object->properties); | zend_hash_destroy(object->properties); |
| Line 74 ZEND_API void zend_objects_destroy_object(zend_object | Line 74 ZEND_API void zend_objects_destroy_object(zend_object |
| if (object->ce != EG(scope)) { | if (object->ce != EG(scope)) { |
| zend_class_entry *ce = object->ce; | zend_class_entry *ce = object->ce; |
| zend_error(EG(in_execution) ? E_ERROR : E_WARNING, | zend_error(EG(in_execution) ? E_ERROR : E_WARNING, |
| "Call to private %s::__destruct() from context '%s'%s", | "Call to private %s::__destruct() from context '%s'%s", |
| ce->name, | ce->name, |
| EG(scope) ? EG(scope)->name : "", | EG(scope) ? EG(scope)->name : "", |
| EG(in_execution) ? "" : " during shutdown ignored"); | EG(in_execution) ? "" : " during shutdown ignored"); |
| return; | return; |
| } | } |
| } else { | } else { |
| /* Ensure that if we're calling a protected function, we're allowed to do so. | /* Ensure that if we're calling a protected function, we're allowed to do so. |
| */ | */ |
| if (!zend_check_protected(destructor->common.scope, EG(scope))) { | if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) { |
| zend_class_entry *ce = object->ce; | zend_class_entry *ce = object->ce; |
| zend_error(EG(in_execution) ? E_ERROR : E_WARNING, | zend_error(EG(in_execution) ? E_ERROR : E_WARNING, |
| "Call to protected %s::__destruct() from context '%s'%s", | "Call to protected %s::__destruct() from context '%s'%s", |
| ce->name, | ce->name, |
| EG(scope) ? EG(scope)->name : "", | EG(scope) ? EG(scope)->name : "", |
| EG(in_execution) ? "" : " during shutdown ignored"); | EG(in_execution) ? "" : " during shutdown ignored"); |
| return; | return; |
| } | } |
| Line 139 ZEND_API void zend_objects_free_object_storage(zend_ob | Line 139 ZEND_API void zend_objects_free_object_storage(zend_ob |
| } | } |
| ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC) | ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC) |
| { | { |
| zend_object_value retval; | zend_object_value retval; |
| *object = emalloc(sizeof(zend_object)); | *object = emalloc(sizeof(zend_object)); |
| Line 222 ZEND_API zend_object_value zend_objects_clone_obj(zval | Line 222 ZEND_API zend_object_value zend_objects_clone_obj(zval |
| zend_object *new_object; | zend_object *new_object; |
| zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); | zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); |
| /* assume that create isn't overwritten, so when clone depends on the | /* assume that create isn't overwritten, so when clone depends on the |
| * overwritten one then it must itself be overwritten */ | * overwritten one then it must itself be overwritten */ |
| old_object = zend_objects_get_address(zobject TSRMLS_CC); | old_object = zend_objects_get_address(zobject TSRMLS_CC); |
| new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC); | new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC); |