Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71534 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96270 invoked from network); 24 Jan 2014 22:10:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2014 22:10:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.176 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:40369] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/3F-21270-3D4E2E25 for ; Fri, 24 Jan 2014 17:10:28 -0500 Received: by mail-lb0-f176.google.com with SMTP id w7so2953424lbi.21 for ; Fri, 24 Jan 2014 14:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=CPEZTn3kFa1uhkgo4F2X3znoagusd78JXnl6wttoLN4=; b=IVrmd56xq09FsoSCfL4v3zxsMyUrQQE+RFX1Oajp+omGzKp9lBScFXf4Rj1fsx7nzv POIhzTRAsxWzW6TdnrGcPlSzg4guSyu6PL0AJ14Ogbr3ldcP9+1RrriVTfy8TocwAIZH N/WmnSbCbwGIMmQ6XDJb92W/xaq2siLNKbLyQ9Azf+NPHK2cjaubmOFtPK4DOajG3k9v s8McH3Y5y9lBFlN+7edalB2JNzzZotEZFOAY3BPOwbFWZAxpHW/eVg/4ZwX9nVTHyaCl Mg3yw5Eywv2o11c1dnA87dqDwB+TLZTMjLrZOkINu9P6nRiP1aJZYma1CC4jGgZ4YqTX cH1Q== X-Received: by 10.112.144.69 with SMTP id sk5mr1689lbb.44.1390601424702; Fri, 24 Jan 2014 14:10:24 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.132.134 with HTTP; Fri, 24 Jan 2014 14:09:44 -0800 (PST) In-Reply-To: References: Date: Sat, 25 Jan 2014 07:09:44 +0900 X-Google-Sender-Auth: XbefSiSl7AAcU8ZDAg0SDq9HyMk Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b3432f4f1937604f0be9f32 Subject: Re: Module function API naming conventions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --047d7b3432f4f1937604f0be9f32 Content-Type: text/plain; charset=UTF-8 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 --047d7b3432f4f1937604f0be9f32--