cvs: php-objc / extension.m /utils make-bundle

From: Date: Wed, 23 Jul 2008 23:14:04 +0000
Subject: cvs: php-objc / extension.m /utils make-bundle
Groups: php.objc 
Request: Send a blank email to php-objc+get-29@lists.php.net to get a copy of this message
wez Wed Jul 23 23:14:04 2008 UTC Modified files: /php-objc extension.m /php-objc/utils make-bundle Log: misc updates http://cvs.php.net/viewvc.cgi/php-objc/extension.m?r1=1.4&r2=1.5&diff_format=u Index: php-objc/extension.m diff -u php-objc/extension.m:1.4 php-objc/extension.m:1.5 --- php-objc/extension.m:1.4 Sun Jul 6 15:54:49 2008 +++ php-objc/extension.m Wed Jul 23 23:14:04 2008 @@ -402,7 +402,7 @@ char methname[1024]; char *cur; Class fake = NULL; - + /* skip over dangerous methods like release, retain */ if (sel == @selector(release) || sel == @selector(retain) || sel == @selector(destroy)) { @@ -417,7 +417,6 @@ meth = class_getInstanceMethod(fake, sel); } - memset(fe, 0, sizeof(*fe)); fe->num_args = method_getNumberOfArguments(meth) - 2; fe->flags = modifiers; @@ -450,7 +449,7 @@ next = strchr(cur, ':'); } - arg_info[narg].name_len = spprintf( + arg_info[narg+1].name_len = spprintf( &(fe->arg_info[narg+1].name), 0, "%.*s%d", next - cur, cur, narg); @@ -868,24 +867,27 @@ * relatively expensive bit of walking here to register our static * methods. */ metac = (Class)objc_getMetaClass(class_getName(c.class_id)); - mlist = class_copyMethodList(metac, &mcount); - for (i = 0; i < mcount; i++) { - if (method_getName(mlist[i]) == @selector(alloc)) { - continue; - } - c.ftable = realloc(c.ftable, - (nstatic+1) * sizeof(zend_function_entry)); - if (populate_func_entry(&c.ftable[nstatic], - method_getName(mlist[i]), - method_getTypeEncoding(mlist[i]), - ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, - &dup_elim, - mlist[i] - TSRMLS_CC)) { - nstatic++; + while (metac) { + mlist = class_copyMethodList(metac, &mcount); + for (i = 0; i < mcount; i++) { + if (method_getName(mlist[i]) == @selector(alloc)) { + continue; + } + c.ftable = realloc(c.ftable, + (nstatic+1) * sizeof(zend_function_entry)); + if (populate_func_entry(&c.ftable[nstatic], + method_getName(mlist[i]), + method_getTypeEncoding(mlist[i]), + ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, + &dup_elim, + mlist[i] + TSRMLS_CC)) { + nstatic++; + } } + free(mlist); + metac = class_getSuperclass(metac); } - free(mlist); zend_hash_destroy(&dup_elim); /* now create a fake alloc entry, to guarantee that the scope @@ -1413,7 +1415,6 @@ static PHP_FUNCTION(objc_method_handler) { if (!getThis()) { - printf("no this in objc_method_handler\n"); php_objc_method_call_inner( ((zend_internal_function*)EG(function_state_ptr)->function) ->function_name, 0, @@ -1523,6 +1524,7 @@ * as we want the actual number of args */ f.num_args = method_getNumberOfArguments(meth) - 2; f.arg_info = calloc(f.num_args, sizeof(zend_arg_info)); + for (i = 0; i < f.num_args; i++) { f.arg_info[i].allow_null = 1; @@ -1600,7 +1602,6 @@ nobj = ecalloc(1, sizeof(*nobj)); cls = php_objc_import_class(class_getName( object_getClass(idval)) TSRMLS_CC); - nobj->cls = cls; nobj->zo.ce = cls->ce; nobj->instance = idval; @@ -2184,7 +2185,6 @@ } *ptr; zend_hash_index_find(byref_hash, i, (void**)&ptr); - if (ptr) { php_objc_wrap_id(ptr->val, *args[i + first_passed]); } else { @@ -2298,13 +2298,18 @@ return FAILURE; } +static zval **php_objc_get_prop_ptr_ptr(zval *object, zval *member TSRMLS_DC) +{ + return std_object_handlers.get_property_ptr_ptr(object, member TSRMLS_CC); +} + static zend_object_handlers php_objc_handlers = { ZEND_OBJECTS_STORE_HANDLERS, php_objc_prop_read, php_objc_prop_write, php_objc_dim_read, php_objc_dim_write, - NULL, + php_objc_get_prop_ptr_ptr, NULL, /* get */ NULL, /* set */ php_objc_prop_exists, http://cvs.php.net/viewvc.cgi/php-objc/utils/make-bundle?r1=1.2&r2=1.3&diff_format=u Index: php-objc/utils/make-bundle diff -u php-objc/utils/make-bundle:1.2 php-objc/utils/make-bundle:1.3 --- php-objc/utils/make-bundle:1.2 Sun Nov 4 23:54:47 2007 +++ php-objc/utils/make-bundle Wed Jul 23 23:14:04 2008 @@ -88,7 +88,7 @@ echo " -nib MainMenu Main nib file for the app\n"; echo " -version 1.0.0 Application version, must include major.minor.patch\n"; echo " otherwise the bundle will not function\n"; - echo " -url 'http://example.com' Your URL, should be unique to you.\n"; + echo " -url 'example.com' Your URL, should be unique to you.\n"; echo " -icon icon.icns Name of icon to use for the bundle.\n"; echo " You must also use -resources to import it into the bundle\n"; echo " -php-config php-config Path to php-config script. The PHP install described by\n"; @@ -216,6 +216,16 @@ if (get_arg('symlink')) { # echo "$dest link-to $source\n"; $source = realpath($source); + if (is_dir($source)) { + $d = $dest . "/" . basename($source); + mkdir($d); + foreach (glob("$source/*") as $s) { + echo "ln -sf '$s' '$d'\n"; + system("ln -sf '$s' '$d'"); + } + return; + } + echo "ln -sf '$source' '$dest'\n"; system("ln -sf '$source' '$dest'"); } else { # echo "$source copy-to $dest\n";

« previous php.objc (#29) next »