Re: [PHP-DOC] Re: strlen and multi-byte characters

2013-06-17 Thread Sherif Ramadan
On Mon, Jun 17, 2013 at 1:18 PM, Adam Harvey  wrote:

> On 16 June 2013 15:37, Sherif Ramadan  wrote:
> > I have no clue how you're getting that result.
>
> What are your respective mbstring.func_overload settings, out of interest?
>
>
mbstring.func_overload is off. Doesn't seem to make a difference if I turn
it on either. I suppose there is some encoding that must be explicitly
specified for mbstring.func_overloading to get it right.


> Adam
>


[PHP-DOC] Contributions are ready for review

2013-06-17 Thread phpdoc
Hello PHP EN Documentation team,

There are contributions within the online editor queue for this language.
Please review, then commit or delete these patches.

Patches for review : 
---

New file: en/reference/sqlite3/sqlite3/createcollation.xml
By: b dewar on 2013-04-10 04:59:20
===
--- en/reference/sqlite3/sqlite3/createcollation.xml
+++ en/reference/sqlite3/sqlite3/createcollation.xml
@@ -0,0 +1,142 @@
+
+
+
+http://docbook.org/ns/docbook"; 
xmlns:xlink="http://www.w3.org/1999/xlink";>
+ 
+  SQLite3::createCollation
+  
+  Registers a PHP function for use as an SQL collating 
function
+ 
+ 
+ 
+  &reftitle.description;
+  
+   public 
boolSQLite3::createCollation
+   stringname
+   
callablecallback
+  
+  
+   Registers a PHP function or user-defined function for use as a collating
+   function within SQL statements.
+  
+ 
+ 
+ 
+  &reftitle.parameters;
+  
+   
+name
+
+ 
+  Name of the SQL collating function to be created or redefined
+ 
+
+   
+   
+callback
+
+ 
+  The name of a PHP function or user-defined function to apply as a
+  callback, defining the behavior of the collation.  It should accept
+  two strings and return as strcmp does, i.e. it 
should return -1, 1,
+  or 0 if the first string sorts before, sorts after, or is equal to the 
second.
+ 
+
+   
+  
+ 
+ 
+ 
+  &reftitle.returnvalues;
+  
+   &return.success;
+  
+ 
+ 
+ 
+  &reftitle.examples;
+  
+   
+SQLite3::createCollation example
+
+ Register the PHP function strnatcmp as a collating 
sequence in the SQLite3 database.
+
+
+
+
+&example.outputs;
+
+
+
+   
+  
+ 
+ 
+ 
+  &reftitle.seealso;
+  
+   The SQLite collation documentation: &url.sqlite.collation;
+  
+ 
+ 
+
+
+
 No newline at end of file


=> Put this change into your patches : 
https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=43558
=> Delete this change: 
https://edit.php.net/?project=php&action=deleteThisChange&idDB=43558

  
--

Modified: en/reference/sqlite3/versions.xml
By: b dewar on 2012-11-29 08:42:57
===
--- en/reference/sqlite3/versions.xml
+++ en/reference/sqlite3/versions.xml
@@ -1,16 +1,15 @@
 
-
+
 
 
-
- 
  
  
  
  
  
+ 
  
  
  
@@ -24,7 +23,6 @@
  
  
 
- 
  
  
  
@@ -33,7 +31,6 @@
  
  
 
- 
  
  
  


=> Put this change into your patches : 
https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=43559
=> Delete this change: 
https://edit.php.net/?project=php&action=deleteThisChange&idDB=43559

  
--

Modified: en/reference/var/functions/intval.xml
By: anonymous on 2013-03-27 02:18:53
===
--- en/reference/var/functions/intval.xml
+++ en/reference/var/functions/intval.xml
@@ -40,6 +40,31 @@
   
The base for the conversion
   
+  
+   
+If base is 0, the base used is determined
+by the format of var:
+
+ 
+  
+   if string includes a "0x" (or "0X") prefix, the base is taken
+   as 16 (hex); otherwise,
+  
+ 
+ 
+  
+   if string starts with "0", the base is taken as 8 (octal);
+   otherwise,
+  
+ 
+ 
+  
+   the base is taken as 10 (decimal).
+  
+ 
+
+   
+  
  
 



=> Put this change into your patches : 
https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=46078
=> Delete this change: 
https://edit.php.net/?project=php&action=deleteThisChange&idDB=46078

  
--

Modified: en/reference/pcre/pattern.syntax.xml
By: anonymous on 2013-03-29 01:31:14
===
--- en/reference/pcre/pattern.syntax.xml
+++ en/reference/pcre/pattern.syntax.xml
@@ -271,7 +271,7 @@
  
   
a character with the xx property, see 
-   unicode properties 
+   Unicode properties 
for more info
   
  
@@ -281,7 +281,17 @@
  
   
a character without the xx property, see 
-   unicode properties 
+   Unicode properties 
+   for more info
+  
+ 
+
+
+ X
+ 
+  
+   an Unicode grapheme, see 
+   Unicode properties 
for more info
   
  
@@ -611,7 +621,7 @@


 X
-an extended Unicode sequence
+any Unicode grapheme incl. an extended

Re: [PHP-DOC] Re: strlen and multi-byte characters

2013-06-17 Thread Adam Harvey
On 16 June 2013 15:37, Sherif Ramadan  wrote:
> I have no clue how you're getting that result.

What are your respective mbstring.func_overload settings, out of interest?

Adam


Re: [PHP-DOC] Introduction + Missing static modifiers

2013-06-17 Thread Jeff Welch
On Sun, Jun 16, 2013 at 6:51 PM, Jeff Welch  wrote:

> On Sun, Jun 16, 2013 at 10:57 AM, Jeff Welch wrote:
>
>> On Sun, Jun 16, 2013 at 4:36 AM, Sherif Ramadan 
>> wrote:
>>
>>>
>>> On Sun, Jun 16, 2013 at 3:40 AM, Jeff Welch wrote:
>>>
 Hi, all :)

 My name is Jeff Welch and I'm one of the maintainers of the PHPUnit
 project. While investigating a PHPUnit issue (
 https://github.com/sebastianbergmann/phpunit-mock-objects/issues/130)
 this past friday, I noticed that the PHP documentation is missing the
 static modifier for a number of methods. I've created a patch (
 https://gist.github.com/whatthejeff/5790970) that adds the missing
 modifier for the following methods:

  * `MessageFormatter::create`
  * `MessageFormatter::formatMessage`
  * `MessageFormatter::parseMessage`
  * `mysqli::poll`
  * `Phar::apiVersion`
  * `Phar::canCompress`
  * `Phar::canWrite`
  * `Phar::createDefaultStub`
  * `Phar::getSupportedCompression`
  * `Phar::getSupportedSignatures`
  * `Phar::interceptFileFuncs`
  * `Phar::isValidPharFilename`
  * `Phar::loadPhar`
  * `Phar::mapPhar`
  * `Phar::running`
  * `Phar::mount`
  * `Phar::mungServer`
  * `Phar::unlinkArchive`
  * `Phar::webPhar`
  * `SQLite3::version`
  * `SQLite3::escapeString`

 Anyway, it would be nice to get VCS access so I don't have to jump
 through too many hoops for future contributions.

 PS: I've heard a love for cats will get you far with this list, so I
 submit to you my cat-related open source contributions:

  * https://github.com/whatthejeff/nyancat-phpunit-resultprinter
  * https://github.com/phpspec/phpspec/pull/133
  * https://github.com/whatthejeff/nyancat-scoreboard


>>>
>>> Hey you cheated. There was a dinosaur in there!
>>>
>>> Looks OK, but I suspect that it would be even better to add the
>>> visibility modifiers as long as you're adding the access modifiers.
>>>
>>
>> I can agree to this.
>>
>>
>>> The documentation is currently wishy-washy about having those for all of
>>> the classes. Some have just the access and others have both visibility and
>>> access. If you'd be willing to help fix the rest that would be awesome
>>>
>>
>> I don't mind adding the missing visibility modifiers.
>>
>
> Alright, I've updated the patch (
> https://gist.github.com/whatthejeff/5790970) to include visibility
> modifiers. For the most part I only worked on core classes as I don't have
> time to go through all the available PECL classes. I can't guarantee that I
> caught them all, but I did my best :)
>

I realize this diff will be very time consuming to verify manually, so I've
added a script that parses the modifiers from my diff and verifies them
through reflection.

You can find the script here:
https://gist.github.com/whatthejeff/5790970#file-test-missing-modifiers-php
And the output here: https://gist.github.com/whatthejeff/5790970#file-output

 Hopefully this helps :)


>
>>
>>> and I'm sure the cats will give you bonus points for your VCS account.
>>>
>>> You also might want to take a look at https://edit.php.net
>>>
>>
>> Yeah, I looked into that, but it's also nice to use shell tools for
>> making mass changes. For instance, I found all the missing static modifiers
>> and patched the documentation using grep/awk/sed.
>>
>>
>>> If no one has any objections I'll go ahead and apply your patch later
>>> tonight. I admit I didn't look it over that thoroughly.
>>>
>>
>> I can tell you that I compiled all the sources and manually verified that
>> the changed pages look as expected. We use DocBook for PHPUnit's
>> documentation, so I have a decent amount of experience with this toolchain.
>>
>>
>>>
>>>
 Thanks,

 - Jeff

>>>
>>>
>>
>


Re: [PHP-DOC] Documentation for an extension

2013-06-17 Thread Sherif Ramadan
On Mon, Jun 17, 2013 at 11:22 AM, Jeroen Moors wrote:

> Hi,
>
> I'm new to the list, so I hope this is the right place to ask my question,
> if not, my excuses!
>
> Currently I'm working on a PHP extension for Ceph (
> https://github.com/ceph/phprados/).It's
> not yet ready to be adopted by PECL.
>
> I would like to create already some documentation on it's API, preferably
> in such a way that if one day it's moving upstream a could reuse the
> existing documentation.
>
> I've already did some research about which tools could be used, but it's
> still a bit unclear to me what's currently the best way to go.
>
> Any advice is welcome!
>

You could start here https://wiki.php.net/doc/scratchpad/pecldocs where
there is a guide for building pecl docs in the wiki. Currently pecl
extensions are documented along with the regular PHP documentation
available at php.net so you would need to get familiar wtih phd and the
toolchain used there. So these links may come in handy as well
https://wiki.php.net/doc/articles and https://wiki.php.net/doc/phd

Good luck.


>
> Thanks!
>
> Jeroen
>


[PHP-DOC] Documentation for an extension

2013-06-17 Thread Jeroen Moors
Hi,

I'm new to the list, so I hope this is the right place to ask my question,
if not, my excuses!

Currently I'm working on a PHP extension for Ceph (
https://github.com/ceph/phprados/).It's
not yet ready to be adopted by PECL.

I would like to create already some documentation on it's API, preferably
in such a way that if one day it's moving upstream a could reuse the
existing documentation.

I've already did some research about which tools could be used, but it's
still a bit unclear to me what's currently the best way to go.

Any advice is welcome!

Thanks!

Jeroen