Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32102 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34804 invoked by uid 1010); 7 Sep 2007 20:04:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34789 invoked from network); 7 Sep 2007 20:04:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2007 20:04:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=hartmut@mysql.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=hartmut@mysql.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mysql.com from 213.136.52.68 cause and error) X-PHP-List-Original-Sender: hartmut@mysql.com X-Host-Fingerprint: 213.136.52.68 mailgate-out2.mysql.com Linux 2.5 (sometimes 2.4) (4) Received: from [213.136.52.68] ([213.136.52.68:35533] helo=mailgate.mysql.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/82-18302-EDEA1E64 for ; Fri, 07 Sep 2007 16:04:47 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate.mysql.com (8.13.8/8.13.8) with ESMTP id l87K4h5i014658; Fri, 7 Sep 2007 22:04:43 +0200 Received: from mail.mysql.com ([10.222.1.99]) by localhost (mailgate.mysql.com [10.222.1.98]) (amavisd-new, port 10026) with LMTP id 07795-08; Fri, 7 Sep 2007 22:04:43 +0200 (CEST) Received: from [10.100.64.53] (10-100-64-53.mysql.internal [10.100.64.53]) (authenticated bits=0) by mail.mysql.com (8.13.3/8.13.3) with ESMTP id l87K4eR8020192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Sep 2007 22:04:41 +0200 Message-ID: <46E1AEDC.7060301@mysql.com> Date: Fri, 07 Sep 2007 22:04:44 +0200 Organization: MySQL AB User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061211 SeaMonkey/1.0.7 MIME-Version: 1.0 To: Marten Lehmann CC: internals@lists.php.net References: <46E19121.1010906@cnm.de> In-Reply-To: <46E19121.1010906@cnm.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at mailgate.mysql.com Subject: Re: [PHP-DEV] own php function From: hartmut@mysql.com (Hartmut Holzgraefe) Marten Lehmann wrote: > I would like to create an own php function which just prints a certain = > report as phpinfo() does. >=20 > The function shall not be included into the general php code, I just=20 > want to patch my own installation. Where would be a good place for the = > function? I don't want to create an extention which would have to be=20 > included into the configure script, I guess thats too much work. The=20 > function shall be able to access the Host-header of the webserver. I'd also recommend that you wrap your function into an extension of its own, it is not as hard as it seems ... (warning, shameless plug to follow as usual) =2E.. especially if you let pecl-gen take care of all the infrastructure work so that you can focus on the desired functionality. Assuming that your function does not take any parameter and does not return anything your pecl-gen input file would look like this: void myinfo(void) Once you've installed CodeGen_PECL from PEAR you can create a working extension from this using the following sequence of commands: pecl-gen myinfo.xml cd myinfo phpize configure make sudo make install After that you can load the extension in php.ini using extension=3Dmyinfo.so For more details on pecl-gen see: http://php-baustelle.de/CodeGen_PECL/manual.html --=20 Hartmut Holzgraefe, Principal Support Engineer . Discover new MySQL Monitoring & Advisory features at: http://www.mysql.com/products/enterprise/whats_new.html Hauptsitz: MySQL GmbH, Dachauer Str.37, 80335 M=FCnchen Gesch=E4ftsf=FChrer: Kaj Arn=F6 - HRB M=FCnchen 162140