Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3732 invoked from network); 24 Jan 2014 22:35:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2014 22:35:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracle.com designates 156.151.31.81 as permitted sender) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 156.151.31.81 userp1040.oracle.com Received: from [156.151.31.81] ([156.151.31.81:29127] helo=userp1040.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/D0-21270-2AAE2E25 for ; Fri, 24 Jan 2014 17:35:16 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0OMZ9GP005413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Jan 2014 22:35:10 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0OMZ8aa003516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jan 2014 22:35:09 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0OMZ84O003512; Fri, 24 Jan 2014 22:35:08 GMT Received: from [130.35.70.190] (/130.35.70.190) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 24 Jan 2014 14:35:08 -0800 Message-ID: <52E2EA9B.8020206@oracle.com> Date: Fri, 24 Jan 2014 14:35:07 -0800 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Yasuo Ohgaki , "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsinet22.oracle.com [141.146.126.238] Subject: Re: [PHP-DEV] Re: Module function API naming conventions From: christopher.jones@oracle.com (Christopher Jones) On 01/24/2014 02:09 PM, Yasuo Ohgaki wrote: > Hi all, > > On Fri, Jan 24, 2014 at 7:41 AM, Yasuo Ohgaki wrote: > >> When I try to add dummy save handler functions for session module, >> I noticed that ps_update() etc has been defined in SOAP module. >> >> To avoid collisions, we might better to have following change in >> CODING_STANDARDS. >> >> [yohgaki@dev PHP-5.4]$ git diff >> diff --git a/CODING_STANDARDS b/CODING_STANDARDS >> index 7a0562e..4c67a30 100644 >> --- a/CODING_STANDARDS >> +++ b/CODING_STANDARDS >> @@ -82,7 +82,7 @@ Exceptions: >> library may need to control or free the memory, or when the memory in >> question needs to survive between multiple requests. >> >> -Naming Conventions >> +User Functions/Methods Naming Conventions >> ------------------ >> >> 1. Function names for user-level functions should be enclosed with in >> @@ -163,6 +163,19 @@ Naming Conventions >> 'foobar' >> 'foo_bar' >> >> +Internal Function Naming Conventions >> +---------------------- >> + >> +1. Exposed module API must have 'php_modulename_function()' to avoid >> + symbol collision. They should be in lowercase, with words >> + underscore delimited. >> + >> +2. Main module source file must be named modulename.c. >> + >> +3. Header file that are used by other sources than it's module must be >> + named 'php_modulename.h'. >> + >> + >> Syntax and indentation >> ---------------------- >> >> The rule should be applied to new modules, not existing one. >> Main source and header is named like this, since ext_skel creates >> files as above. >> >> Any comments? >> > > It seems no comments for this. This is mandatory. IMHO. > I'll commit this 5.4 and up today. > If there are corrections/additions, please update. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > Can you make it more explicit with an example to show what an "exposed module API" would look like? This doc will be read by people not familiar with PHP internals. Is there anything in ext/ext_skel or the manual that needs to be kept in sync with your changes? Chris -- christopher.jones@oracle.com http://twitter.com/ghrd Free PHP & Oracle book: http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html