From: Hartmut Holzgraefe Date: Sat, 26 Apr 2003 16:08:48 +0000 (+0000) Subject: constructor proto change X-Git-Tag: SPL_ALPHA~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bf4b3f293dcac55f8e5800583ab252a181d4c2d;p=php constructor proto change --- diff --git a/scripts/ext_skel_ng/php_resource.php b/scripts/ext_skel_ng/php_resource.php index 3f4984efaf..2ea631a489 100644 --- a/scripts/ext_skel_ng/php_resource.php +++ b/scripts/ext_skel_ng/php_resource.php @@ -1,14 +1,20 @@ name = $name; - $this->payload = $payload; - $this->alloc = $alloc; + + function __construct($attr, $destruct, $description) { + $this->name = $attr['name']; + if (!$this->is_name($this->name)) { + $this->error[] = "'$attr[name] is not a valid resource name"; + } + + + $this->payload = @$attr['payload']; + $this->alloc = @$attr['alloc']; $this->destruct = $destruct; $this->description = $description; - if(empty($this->payload)) { + if (empty($this->payload)) { $this->payload = "void"; } } @@ -59,7 +65,7 @@ void {$this->name}_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) return " #define {$upname}_FETCH(r, z) ZEND_FETCH_RESOURCE(r, {$this->payload} *, z, -1, ${$this->name}, le_{$this->nameĀ }); \ - if(!r) { RETURN_FALSE; } + if (!r) { RETURN_FALSE; } #define {$upname}_REGISTER(r) ZEND_REGISTER_RESOURCE(return_value, r, le_{$this->nameĀ }); ";