Commits

Anonymous committed 3682fdd

misc updates

Comments (0)

Files changed (2)

 	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)) {
 		meth = class_getInstanceMethod(fake, sel);
 	}
 
-
 	memset(fe, 0, sizeof(*fe));
 	fe->num_args = method_getNumberOfArguments(meth) - 2;
 	fe->flags = modifiers;
 				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);
 
 	 * 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;
+	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++;
+			}
 		}
-		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
 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,
 		 * 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;
 			
 	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;
 					} *ptr;
 					
 					zend_hash_index_find(byref_hash, i, (void**)&ptr);
-
 					if (ptr) {
 						php_objc_wrap_id(ptr->val, *args[i + first_passed]);
 					} else {
 	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,

utils/make-bundle

   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";
   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";