Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69813 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 650 invoked from network); 23 Oct 2013 18:20:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2013 18:20:12 -0000 Authentication-Results: pb1.pair.com header.from=ingwie2000@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ingwie2000@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.171 as permitted sender) X-PHP-List-Original-Sender: ingwie2000@googlemail.com X-Host-Fingerprint: 209.85.215.171 mail-ea0-f171.google.com Received: from [209.85.215.171] ([209.85.215.171:33328] helo=mail-ea0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/85-10840-B5318625 for ; Wed, 23 Oct 2013 14:20:11 -0400 Received: by mail-ea0-f171.google.com with SMTP id n15so640920ead.2 for ; Wed, 23 Oct 2013 11:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=WsMutCteNQjAUL/RDPSD1IFuurRukI48mvDl10qLeiQ=; b=ZgMdAlWvd+UGniVYxAPYdYBPFBY0BFxTHhaMlfK9bZFmPKkiROYmAaW1MSRN74WLGL fcR7Rm6mGjqBNZyEA0eE278QQJMWZC5AFgsxt0jEYpigqc7dylE9RvW8VrU+mmx7gDxu 8lNw6RR8q70BsW2Qpgrhk+9IBXCIBPY2jsMjZthfjIt9cGo1qSNHR9OSZR+xgOqnGM8v KPnvgv3CLRQQon3VyklkeKuomgKI3Rom8LzRJJO/CI8MpLEP+ojzNuUv05MFHtN3MICB eds8WqjEufOad2WZR0Ht7XSIaxqkpMdNxYuz+hNsv36jbC8hRDauZarUF0oTOxGrv3AM XMkg== X-Received: by 10.14.203.70 with SMTP id e46mr3201410eeo.33.1382552408352; Wed, 23 Oct 2013 11:20:08 -0700 (PDT) Received: from kevins-air.fritz.box (p549A5A13.dip0.t-ipconnect.de. [84.154.90.19]) by mx.google.com with ESMTPSA id r48sm73093793eev.14.2013.10.23.11.20.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Oct 2013 11:20:07 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <7AB4C690-44A7-4A93-9026-F5E735716E0F@googlemail.com> Date: Wed, 23 Oct 2013 20:20:06 +0200 To: internals@lists.php.net Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) X-Mailer: Apple Mail (2.1816) Subject: PHP and Objective-C From: ingwie2000@googlemail.com (Kevin Ingwersen) Hello there. I have absolutely no real clue where to post this but rather into some = sort of development mailing list. Recently, I started to work on some tool that will compile a lot of PHP = scripts into a single file, and may even go further and bundle a PHP = binary within to create a sort-of standalone PHP executable. The concept = is quite simple, but the including stuff isn't really. But, as I was = thinking about this idea, I came across the various ideas of trying to = use a GUI with PHP scripts. On windows, that has already been possible. = But not on Mac - at least I found no working solution. wxWidgets (as = extension, wxPHP) won't compile because it relies on the Carbon = framework - which has been discontinued since about at least three major = releases. And the extension can't be made to work with Cocoa, as this is = Objective-C - and not C/C++. And here is the keyword, Objective-C. I have learned, that Objective-C is, like C++, a layer ontop of C. = Furthermore, I saw that there was am "embed" SAPI, yet I couldn't find = any way to fully integrate PHP into a binary that had non-Zend code = inside; there is only a book. And due to my visual impairment, I am = unable to read said book. So I came up with a few questions: - How could one integrate PHP into a C/C++ programm? The reason I ask is because, I want to see how far I could integrate PHP = into an Objective-C program. - When integrating, how could I expose Objective-C functions to = PHP's "C-Scope"? The Zend 2 API is very poorly documented; basic things like = reading/writing to and from objects is documented so poorly, that I had = to read a ~100 page long slide share. But yet, I thought that the only = way to expose stuff like Objective-C functions, or even Classes, to PHP = would be to add a PHP-Extension-like structure, so that once the = Objective-C programm was initialized, it would use the Zend API to = expose things to PHP. My goal is to enable access to at least the GUI functions of Cocoa, = which can be reached thru Objective-C. Using this method, I wanted to = create a new kind of framework, and combine it with my previous project = of pulling PHP files into one. I think it already made a clue in your = head if you are able to understand my - sadly - weird english. Once I can expose Objective-C scope into PHP, I would be able to enable = GUI's with PHP. Since PHP is very easily understood, it could be a good = start for switchers - like me - to understand the other language and = API. Now, we can use my code-compiler idea and build all the PHP script = into one single, giant file - maybe even use Phar as this offers a great = solution for that. The last step is to combine the executable and = script, and we would get an actual and valid Mac OS X application - we = do not need the compiling part, but it'd be cool ;). I hope anybody can help me, poke me into the right direction to = anything. This is just one idea I have, and something I hope to realize. = I taught myself a good amount of c++ by trying to create a wrapper of a = C++ class for a PHP extension. So I would try the trick again to learn = more about objective-C. Kind regards, Kevin Ingwersen PS: I am from germany, my english may not be very understandable - so = please ask if you didn't understand something! :)=