Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72586 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97032 invoked from network); 14 Feb 2014 09:54:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2014 09:54:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.169 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:37452] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/62-12906-BB7EDF25 for ; Fri, 14 Feb 2014 04:54:04 -0500 Received: by mail-ob0-f169.google.com with SMTP id wo20so13634762obc.14 for ; Fri, 14 Feb 2014 01:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JhB8XhYsEdCcNmBMtQ3ursZudrBXHLXF0DT1oIqWrNw=; b=WCxaS6lIWaXqDpTWRSgu5ynYZ5VuvxQj7U+Yn7XMVuYUVfDVPrrxt+2baqHCzaqa8w /Tg6XvJDdzx68cyY1naA9uQrOFiBn2tDXE/e9ejVBTbSQCyrZrOHGCwDMj3Q6cvbRisK JZDx0Gp6yL8EbzDNdnXyK0lXtU6i3QBUa6Os/T1SuNHTry0LWzahIBYxk8ZrADMgrru1 w+VQ63KVXq77hKRtS89ueF790O0B77SQVKl9NbJAUp62BFSjjTV0KteBL4Kl5rcZwhED Ke7fhkY5hJodHQJ9ToGEtKwlNaQReLUPma1OMES9zbn1Jmyxw1kpyJPo95VpR195XGXA qZtA== MIME-Version: 1.0 X-Received: by 10.60.51.6 with SMTP id g6mr5747109oeo.5.1392371640892; Fri, 14 Feb 2014 01:54:00 -0800 (PST) Received: by 10.182.54.112 with HTTP; Fri, 14 Feb 2014 01:54:00 -0800 (PST) In-Reply-To: <60CCD000-56E9-400D-A1AF-029E45B4338B@googlemail.com> References: <1392332641.3990.109.camel@guybrush> <60CCD000-56E9-400D-A1AF-029E45B4338B@googlemail.com> Date: Fri, 14 Feb 2014 10:54:00 +0100 Message-ID: To: Kevin Ingwersen Cc: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , internals Content-Type: multipart/alternative; boundary=001a11c306f00d006104f25ac9f4 Subject: Re: [PHP-DEV] When will the extension and embedding APIs ever be cleaned or documented? From: nikita.ppv@gmail.com (Nikita Popov) --001a11c306f00d006104f25ac9f4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Feb 14, 2014 at 1:17 AM, Kevin Ingwersen wrote: > Am Fr. Feb. 14 2014 00:04:01 schrieb Johannes Schl=FCter: > > Mind: "Compatibility is a feature." (Bjarne Stroustrup) The fact that 1= 0 > > years old extensions can be used with php git master with quite little > > work is not only a help for old users but also promise to new users tha= t > > their investment won't be lost easily. > > But what if there was something like a wrapper above the old api, to give > it a cleaner appearance, so people could choose to work with the newer, o= r > older, API? > > BTW, in the API "book", I dont find what I am looking for; storing a > forgein thing into the object. Like if I was to write a PHP module that > exports a PHP class, I would like to create a class instance to a C++ > class, and store that instance within the php object (struct?). Like: > > zval* this =3D getThis(); > MyClass* mc =3D (MyClass*)get_pointer_from_zvalthis); > > And, well, vice-versa. > This is covered in http://www.phpinternalsbook.com/classes_objects/custom_object_storage.htmla= nd http://www.phpinternalsbook.com/classes_objects/custom_object_storage.html#= overriding-create-objectin particular :) In the code sample there you'd replace "long additional_property" with "MyClass *my_class" (and add a delete call in the free_storage handler and a new call in create_object). Nikita --001a11c306f00d006104f25ac9f4--