Re: Lowercase or camelcase function names?

From: Date: Mon, 07 Nov 2011 00:16:24 +0000
Subject: Re: Lowercase or camelcase function names?
References: 1 2 3  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-8816@lists.php.net to get a copy of this message
Hi, On Mon, 2011-11-07 at 00:35 +0100, Hannes wrote: > Hello Johannes, > > you didn't answer my question... CamelCase or not?? ;) But anyway, thank > you for your quick reply. :D Wasn't sure what to answer there ;-) PHP in that area is inconsistent. In many places it follows the C library. The benefit is that it helps to lookup the details, but sometimes it's too close to the C-API instead of creating nice PHP APIs. In the end I can't answer what is better. > I have some code available[1] but since it is a very early stage of > development I didn't wanted to tell you already but you provoked me to > do it now... ;) Some small comments, without really deep into it: * pval isn't used anymore, I think it was even dropped with 5.3. zval is the exact same. * The PARSE_ARGS and ARG macros use an old dangerous, bad API. Look into using zend_parse_parameters (see README.PARAMETER_PARSING in php src) * The current code does ARG(0)->value.lval, this should be Z_LVAL_P(ARG(0)), while that call is, at least in scard_release_context, unsafe, zend_parse_parameters fixes that, though) * Our CODING_STYLE asks for {} for every if clause etc. even when it's just a single line, the opening { should be on the same line as the "if" (or "while", "do", ..) * I assume there are some leaks, make sure to build PHP with --enable-debug * The CREDITS file should be two lines, first line extension name, second line author names. This is afaik used by the Windows build. It would also be used to create phpcredits() if this extension was to be bundled with PHP (which I don't expect to happen) * build.shlooks weird, phpize && ./configure && make should do all the things needed, else config.m4 is wrong. * php_pcsc.h should be as sparse as possible, as for a static build it is included from main/builtin_functions.h which causes conflicts. * TODO: "Make the PCSC context a global var" - this sounds weird. Global variables often cause issues. This long list might look worse than it is, the only first 3 items "matter" :-) > The code is based on an extension by Johann Dantant called SCardSCR[2]. > My project is found on my personal website[3]. Johann allowed me to > relicense his code unter the terms of the PHP license, so I want > to use this license! Great. (I read GPL somewhere, that would not work, GPL and PHP License can't be mixed) > I really would like to use PHP's version control infrastructure in the > future. And I really would provide docs in XML format! Great :-) > I am happy that you support this idea. I have the code running here > since last year and now I am actively doing smart card development > again. I did this for about two years but since around one year I have > done other stuff. The code works nice on my notebook and I am very fast > in writing prototypes for smart card communication using PHP. nice. > Johannes dito.

« previous php.pecl.dev (#8816) next »