[PHP-DOC] Re: "The ternary operator"

2011-06-10 Thread Richard Riley
"Ford, Mike"  writes:


> It is. It always has been. That must be Outlook interfering again...! :(
> This message is definitely leaving with the right sig delimiter as
> I've just checked it.
>
> Cheers!
>
> Mike

Worked that time! Possibly a gmane glitch.



[PHP-DOC] Re: "The ternary operator"

2011-06-10 Thread Richard Riley
"Ford, Mike"  writes:

> Having started my documentation career by doing some work on the main
> Operators page,
> I’d like to introduce a subject that has long bugged me: the term
> “the ternary operator” to
> describe ? :
>  
> Whilst it’s strictly true that, as far as PHP is concerned , ? : is *
> the* ternary operator, that’s
> not really a description of its function, in contrast to most other
> operators which are usually
> referred to by their functionality. It’s also a (very slight)
> potential pitfall should PHP ever be
> moved to introduce another ternary operator (and this *was* proposed
> recently, using ?? :
> or thereabouts to do an isset() test rather than an ==true one!).
>  
> I’d like to consider reworking the docs a bit to refer to ? : as the
> “conditional operator” (or
> perhaps “selection operator ” or “choice operator”), and would like
> to solicit opinions on
> such a move. I realise this is a fairly big departure from past
> practice, and might even be
> regarded in the same light as a BC break, so some reasoned discussion
> would be welcome. I
> also think consideration should be given to moving it out to its own
> , as to me it’s not
> really think it’s a true comparison operator – but this is secondary
> to the main topic of
> changing how its referred to.
>  
> What do you think?
>
> Cheers!

(Is it my client or your line length setting causing this wrapping? I
dot norally see this above).

I came across something similar years ago when reviewing tech docs for
our own language. As a result, I think you would be fighting something
too institutionalised tbh. And the rewards would be minor compared to
the hassle of the petty bickering and inconsistencies introduced with
legacy documenttion and similar constructs in other languages. The
possibilitey are endless and since there is nothing immediately wrong
or obvious with the current situation I would be tempted to concentrate
on other areas and leave it.

(as a side note, and not meaning to net nanny ;), your signature
delimiter should be "-- " and not "--" to enable auto cropping)






[PHP-DOC] Re: Building Docs

2011-06-05 Thread Richard Riley
Richard Riley  writes:

> Hannes Magnusson  writes:
>
>> On Sat, Jun 4, 2011 at 18:39, Richard Riley  wrote:
>>> Richard Riley  writes:
>>>
>>>>
>>>> Let me get back to you after using the rsync at php.net/mirroring : I
>>>> suspect after the faffing aruond with phd, this mirror rsync should just
>>>> work. Copying as we speak.
>>>>
>>>
>>> ok, I mirrored according to the instructions here:
>>>
>>> http://php.net/mirroring.php
>>>
>>> vhost file copied and modified to reflect my local system.
>>>
>>> http://i.imgur.com/4K4va.png
>>
>> What is in your /manual/en/ folder?
>> There should be ~10.000 files and 2 folder iirc
>>
>> -Hannes
>
> Where the rsync put it. The rsync on the mirroring page that includes
> manual/en..
>
> http://php.net/mirroring.php
>
> ,
> | rsync -avzC --timeout=600 --delete --delete-after \
> |   --include='distributions/*.exe' \
> |   rsync.php.net::phpweb /your/local/path 
> | Setting up an unofficial mirror, and want to only mirror one language of 
> the manual? Add:
> | 
> | --include='manual/en/' --include='manual/en/**'
> |   --exclude='manual/**' --exclude='distributions/manual/**'
> `
>
> Its there and its populated (webroot/manual/en).
>

Just a fyi in case this triggers a suggestion that will get this
working. ps has anyone here *recently* rsynced a local mirror and set up
a local vhost where the manual look ups work?

,
| [2150]shamrock@development:~/common-files/www/phpweb/manual/en$ ls -l *strstr*
| -rw-r--r-- 1 shamrock shamrock 6743 Jun  3 12:15 function.grapheme-strstr.php
| -rw-r--r-- 1 shamrock shamrock 4848 Jun  3 12:15 function.mb-strstr.php
| -rw-r--r-- 1 shamrock shamrock 7733 Jun  3 12:18 function.strstr.php
`

In find_manual_page :-

,
| $q = @sqlite_query($s, str_replace('LANG_HERE', $lang, $SQL));
| 
| // Successful query
| if ($q) {
| $r = sqlite_fetch_array($q, SQLITE_NUM);
| if (isset($r[0])) {
`

The fetch fails.

It now heads off to find_manual_page_slow which calls tryprefix: I added
some debug logging:-

e.g

,
| // Drop out spaces, and try that keyword (if different)
| $nosp = str_replace(" ", "", $keyword);
| if ($nosp != $keyword) {
| $try = "/manual/${lang}/${prefix}${nosp}.php";
| if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
|   echo $_SERVER['DOCUMENT_ROOT'] . $try . ": not found";
| }
`

resulting in the somewhat surprising:

,
| /var/www/phpweb/manual/en/manual/en/function.strstr.php.php: not found
| /var/www/phpweb/manual/en/book.manual/en/function.strstr.php.php: not found
| /var/www/phpweb/manual/en/ref.manual/en/function.strstr.php.php: not found
| /var/www/phpweb/manual/en/function.manual/en/function.strstr.php.php: not 
found
| /var/www/phpweb/manual/en/class.manual/en/function.strstr.php.php: not found
| /var/www/phpweb/manual/en/features.manual/en/function.strstr.php.php: not 
found
| 
/var/www/phpweb/manual/en/control-structures.manual/en/function.strstr.php.php: 
not found
| /var/www/phpweb/manual/en/language.manual/en/function.strstr.php.php: not 
found
| /var/www/phpweb/manual/en/about.manual/en/function.strstr.php.php: not found
| /var/www/phpweb/manual/en/faq.manual/en/function.strstr.php.php: not found
`

(Some better filtered tests could surely reduce server load here : the
doubling up of the manual/en part suggests to me a bug or something that
might need addressing).

I'll try again later when I have some more time.



[PHP-DOC] Re: Building Docs

2011-06-04 Thread Richard Riley
Hannes Magnusson  writes:

> On Sat, Jun 4, 2011 at 18:39, Richard Riley  wrote:
>> Richard Riley  writes:
>>
>>>
>>> Let me get back to you after using the rsync at php.net/mirroring : I
>>> suspect after the faffing aruond with phd, this mirror rsync should just
>>> work. Copying as we speak.
>>>
>>
>> ok, I mirrored according to the instructions here:
>>
>> http://php.net/mirroring.php
>>
>> vhost file copied and modified to reflect my local system.
>>
>> http://i.imgur.com/4K4va.png
>
> What is in your /manual/en/ folder?
> There should be ~10.000 files and 2 folder iirc
>
> -Hannes

Where the rsync put it. The rsync on the mirroring page that includes
manual/en..

http://php.net/mirroring.php

,
| rsync -avzC --timeout=600 --delete --delete-after \
|   --include='distributions/*.exe' \
|   rsync.php.net::phpweb /your/local/path 
| Setting up an unofficial mirror, and want to only mirror one language of the 
manual? Add:
| 
| --include='manual/en/' --include='manual/en/**'
|   --exclude='manual/**' --exclude='distributions/manual/**'
`


Its there and its populated (webroot/manual/en).





[PHP-DOC] Re: Building Docs

2011-06-04 Thread Richard Riley
Richard Riley  writes:

>
> Let me get back to you after using the rsync at php.net/mirroring : I
> suspect after the faffing aruond with phd, this mirror rsync should just
> work. Copying as we speak.
>

ok, I mirrored according to the instructions here:

http://php.net/mirroring.php

vhost file copied and modified to reflect my local system.

http://i.imgur.com/4K4va.png

No errors in the apache error log either.

I've spent enough time on this now so I'll have another crack another
day I'm no noob to Linux, rsync, vhosts etc but this has been, tbh,
frustrating as I'm out of ideas as to whats wrong and knowing its
probably my fault is gnawing at me ;) I've tried various "howtos" and
now the official mirroring docs and still no documentation is coming
up. The rsync on the php.net/mirroring page includes the en docs - these
are the docs served up on the web aren't they? sqlite is installed
btw.

Is there anything else obvious I might have overlooked?

thanks,

r.











[PHP-DOC] Re: Building Docs

2011-06-04 Thread Richard Riley
Hannes Magnusson  writes:

> On Sat, Jun 4, 2011 at 16:43, Richard Riley  wrote:
>> Hannes Magnusson  writes:
>>
>>> On Fri, Jun 3, 2011 at 17:11, Richard Riley  wrote:
>>>> Richard Riley  writes:
>>>>
>>>>> Alexey Shein  writes:
>>>>>
>>>>>> 2011/6/3 Richard Riley :
>>>>>>> Alexey Shein  writes:
>>>>>>>
>>>>>>>> 2011/6/3 Richard Riley :
>>>>>>>>>
>>>>>>>>> I am trying to set up a local php web for doc lookup. I followed the
>>>>>>>>> instructions here
>>>>>>>>>
>>>>>>>>> https://wiki.php.net/doc/phd
>>>>>>>>>
>>>>>>>>> but this line
>>>>>>>>>
>>>>>>>>> phd -d doc-base/.manual.xml -o output_dir -f php -P PHP
>>>>>>>>>
>>>>>>>>> falls over with
>>>>>>>>>
>>>>>>>>> [08:28:02 - E_USER_ERROR          ] 
>>>>>>>>> /usr/share/php/phpdotnet/phd/Options/Handler.php:165
>>>>>>>>>        Invalid Package (Tried: 'PHP' Supported: 'Generic')
>>>>>>>>>
>>>>>>>>
>>>>>>>> It seems that you installed only Generic phd package and not PHP one
>>>>>>>> (i.e. that used for rendering php docs).
>>>>>>>> This link can help https://doc.php.net/phd/docs/ (see PEAR install)
>>>>>>>> You can also try pear option --alldeps if dependencies still not
>>>>>>>> fetched automatically.
>>>>>>>
>>>>>>> Ah yes. Thanks. Another case of too many cooks spoiling the broth. The
>>>>>>> other instructions I followed didn't mention this
>>>>>>>
>>>>>>> pear install doc.php.net/phd_php
>>>>>>>
>>>>>>> Many thanks for your prompt help,
>>>>>>>
>>>>>>
>>>>>> You're welcome. You also may want to setup your local "mirror", see
>>>>>> https://wiki.php.net/doc/phd/view for instructions, and this will give
>>>>>> you some "fuzzy" searching like on php.net, but it kinda slow (2-3
>>>>>> sec) on my box, but YMMV.
>>>>>
>>>>> Yeah, I'm doing that now but its still not finding the docs (I put the
>>>>> symbolic link in my web mirror back to my phpdocs/manual/en
>>>>> too). There's a lot of conflicting and incomplete info out there in php
>>>>> doc land but I'll find my through ;)
>>>>
>>>> My local mirror is still not able to find functions or fuzzy search
>>>> despite building php docs locally and linking them.
>>>
>>> What is your test url? Are you attempting to go through the error handler?
>>> Have copied the virtualhost example from http://php.net/mirroring?
>>>
>>> -Hannes
>>
>> test url? This is a local vhost. Go through the error handler? Sorry, I
>> dont know what that means.
>>
>> php.net with a localhost /etc/hosts entry.
>
> http://localhost/strpos
> or
> http://localhost/manual-lookup.php?pattern=strpos
>
> or what exactly isn't working? And what is the error you are getting?
>
> -Hannes

?? As I said I configured a vhost with a hosts entry.

so its php.net/blah and as I said earlier the web itself is working but
its not finding the docs - hence my Q above about what needs linking and
where - the docs are wrong and inconsistent.

Let me get back to you after using the rsync at php.net/mirroring : I
suspect after the faffing aruond with phd, this mirror rsync should just
work. Copying as we speak.




[PHP-DOC] Re: Building Docs

2011-06-04 Thread Richard Riley
Hannes Magnusson  writes:

> On Fri, Jun 3, 2011 at 17:11, Richard Riley  wrote:
>> Richard Riley  writes:
>>
>>> Alexey Shein  writes:
>>>
>>>> 2011/6/3 Richard Riley :
>>>>> Alexey Shein  writes:
>>>>>
>>>>>> 2011/6/3 Richard Riley :
>>>>>>>
>>>>>>> I am trying to set up a local php web for doc lookup. I followed the
>>>>>>> instructions here
>>>>>>>
>>>>>>> https://wiki.php.net/doc/phd
>>>>>>>
>>>>>>> but this line
>>>>>>>
>>>>>>> phd -d doc-base/.manual.xml -o output_dir -f php -P PHP
>>>>>>>
>>>>>>> falls over with
>>>>>>>
>>>>>>> [08:28:02 - E_USER_ERROR          ] 
>>>>>>> /usr/share/php/phpdotnet/phd/Options/Handler.php:165
>>>>>>>        Invalid Package (Tried: 'PHP' Supported: 'Generic')
>>>>>>>
>>>>>>
>>>>>> It seems that you installed only Generic phd package and not PHP one
>>>>>> (i.e. that used for rendering php docs).
>>>>>> This link can help https://doc.php.net/phd/docs/ (see PEAR install)
>>>>>> You can also try pear option --alldeps if dependencies still not
>>>>>> fetched automatically.
>>>>>
>>>>> Ah yes. Thanks. Another case of too many cooks spoiling the broth. The
>>>>> other instructions I followed didn't mention this
>>>>>
>>>>> pear install doc.php.net/phd_php
>>>>>
>>>>> Many thanks for your prompt help,
>>>>>
>>>>
>>>> You're welcome. You also may want to setup your local "mirror", see
>>>> https://wiki.php.net/doc/phd/view for instructions, and this will give
>>>> you some "fuzzy" searching like on php.net, but it kinda slow (2-3
>>>> sec) on my box, but YMMV.
>>>
>>> Yeah, I'm doing that now but its still not finding the docs (I put the
>>> symbolic link in my web mirror back to my phpdocs/manual/en
>>> too). There's a lot of conflicting and incomplete info out there in php
>>> doc land but I'll find my through ;)
>>
>> My local mirror is still not able to find functions or fuzzy search
>> despite building php docs locally and linking them.
>
> What is your test url? Are you attempting to go through the error handler?
> Have copied the virtualhost example from http://php.net/mirroring?
>
> -Hannes

test url? This is a local vhost. Go through the error handler? Sorry, I
dont know what that means.

php.net with a localhost /etc/hosts entry.

And yes, I copied the vhost. Althought thats another resource - You
linked me to the wiki before. That link there seems much better - you
will notice it explicitly includes instructions for the en files for
example.

I hope to go back through and make a list of all the
incorrect/inconsistent scripts, and clashing howtos next week and will
let you know.



[PHP-DOC] Re: Building Docs

2011-06-03 Thread Richard Riley
Richard Riley  writes:

> Alexey Shein  writes:
>
>> 2011/6/3 Richard Riley :
>>> Alexey Shein  writes:
>>>
>>>> 2011/6/3 Richard Riley :
>>>>>
>>>>> I am trying to set up a local php web for doc lookup. I followed the
>>>>> instructions here
>>>>>
>>>>> https://wiki.php.net/doc/phd
>>>>>
>>>>> but this line
>>>>>
>>>>> phd -d doc-base/.manual.xml -o output_dir -f php -P PHP
>>>>>
>>>>> falls over with
>>>>>
>>>>> [08:28:02 - E_USER_ERROR          ] 
>>>>> /usr/share/php/phpdotnet/phd/Options/Handler.php:165
>>>>>        Invalid Package (Tried: 'PHP' Supported: 'Generic')
>>>>>
>>>>
>>>> It seems that you installed only Generic phd package and not PHP one
>>>> (i.e. that used for rendering php docs).
>>>> This link can help https://doc.php.net/phd/docs/ (see PEAR install)
>>>> You can also try pear option --alldeps if dependencies still not
>>>> fetched automatically.
>>>
>>> Ah yes. Thanks. Another case of too many cooks spoiling the broth. The
>>> other instructions I followed didn't mention this
>>>
>>> pear install doc.php.net/phd_php
>>>
>>> Many thanks for your prompt help,
>>>
>>
>> You're welcome. You also may want to setup your local "mirror", see
>> https://wiki.php.net/doc/phd/view for instructions, and this will give
>> you some "fuzzy" searching like on php.net, but it kinda slow (2-3
>> sec) on my box, but YMMV.
>
> Yeah, I'm doing that now but its still not finding the docs (I put the
> symbolic link in my web mirror back to my phpdocs/manual/en
> too). There's a lot of conflicting and incomplete info out there in php
> doc land but I'll find my through ;)

My local mirror is still not able to find functions or fuzzy search
despite building php docs locally and linking them.

I feel sure I have passed some point where I missed an important step
and am now blind to it.

http://doc.php.net/phd/docs/#render-phpdoc

According to here

https://wiki.php.net/doc/phd/view

then

,
| ln -s /path/to/phd/php /path/to/your/webroot/phpweb/manual/en
`

should bring it in. But there is no php directory created by the
rendering process under the phd root. So which is it requiered for the
search engine on the mirror?

Tope level is

,
| -rwxr-xr-x  1 shamrock shamrock  308 Jun  3 08:41 build.sh
| drwxr-xr-x 12 shamrock shamrock 4096 Jun  3 09:33 doc-base
| drwxr-xr-x 14 shamrock shamrock 4096 Jun  3 08:44 en
| drwxr-xr-x  8 shamrock shamrock 4096 Jun  3 13:55 output
`

Now, output contains the index.sqlite, linking my-php-vhost/manual/en to
here I still dont see any docs when I search.

Output contains no php directory but a php-web containing the docs.

The index.sqlite is populated.

A gentle prod in the right direction would be appreciated..










[PHP-DOC] Re: [PHP-DEV] Local PHP docs with search facility

2011-06-03 Thread Richard Riley
Hannes Magnusson  writes:

> On Fri, Jun 3, 2011 at 12:39, Richard Riley  wrote:
>> Hannes Magnusson  writes:
>>
>>> On Fri, Jun 3, 2011 at 06:41, Richard Riley  wrote:
>>>> Hannes Magnusson  writes:
>>>>
>>>>> On Thu, Jun 2, 2011 at 21:03, Richard Riley  
>>>>> wrote:
>>>>>>
>>>>>> Could some kind soul advise me on how to install php docs localy and
>>>>>> have the excellent patterns search work based on an sqllite database?
>>>>>
>>>>> https://wiki.php.net/doc/phd/view
>>>>>
>>>>
>>>> Just as a side note on this informative thread (and to anyone else that
>>>> comes across it in google), the instructions there dont actually install
>>>> any of the manual so no look ups / function searches work at all. I'll
>>>> look into it in more detail later. I'll head over to
>>>
>>> Sure it will. You just need to read the page, which has a very clear
>>> requirement.
>>>
>>> If you can't follow it then http://php.net/mirroring could be a
>>> simpler approach for you.
>>>
>>> -Hannes
>>
>> I'm not sure it will at all, since they dont show you how to install the
>> phd_php part or inform you that you need to. For a beginner thats a
>> hurdle enough. You are probably too familiar with it to notice
>> this. Result:
>>
>> ,
>> | phd -d doc-base/.manual.xml -o output_dir -f php -P PHP
>> `
>>
>> falls over.
>>
>> Fortunately that was correctly documented elsewhere and was pointed out
>> to me in the php.docs list you recommended.
>>
>> https://doc.php.net/phd/docs/ : installation via pear.
>>
>> Also, I *think*, the instructions there are in addition to mirroring
>> since the mirroring line doesnt include the manual subdir : so both sets
>> are required and you symbolically link to your phpdoc configuration (or
>> so it seems from the instructions).
>>
>> IMO, and with the benefit of being totally new to this and trying to use
>> the docs, It's not clear from the pages if this phpdoc config is in
>> addition to or superceded by the mirroring rsync line.
>
> I'd appreciate if you could update the wiki with your experience to
> help people coming after you
>
> -Hannes

I would love to but dont think its a good idea until I am more familiar
- blinded in the headlights,  a lot might be me doing the headless chicken
routine. I will come back to it at a later date however when I have it
working locally and I fully understand the components and the
processes. 

thanks

r.



[PHP-DOC] Re: Building Docs

2011-06-03 Thread Richard Riley
Alexey Shein  writes:

> 2011/6/3 Richard Riley :
>> Alexey Shein  writes:
>>
>>> 2011/6/3 Richard Riley :
>>>>
>>>> I am trying to set up a local php web for doc lookup. I followed the
>>>> instructions here
>>>>
>>>> https://wiki.php.net/doc/phd
>>>>
>>>> but this line
>>>>
>>>> phd -d doc-base/.manual.xml -o output_dir -f php -P PHP
>>>>
>>>> falls over with
>>>>
>>>> [08:28:02 - E_USER_ERROR          ] 
>>>> /usr/share/php/phpdotnet/phd/Options/Handler.php:165
>>>>        Invalid Package (Tried: 'PHP' Supported: 'Generic')
>>>>
>>>
>>> It seems that you installed only Generic phd package and not PHP one
>>> (i.e. that used for rendering php docs).
>>> This link can help https://doc.php.net/phd/docs/ (see PEAR install)
>>> You can also try pear option --alldeps if dependencies still not
>>> fetched automatically.
>>
>> Ah yes. Thanks. Another case of too many cooks spoiling the broth. The
>> other instructions I followed didn't mention this
>>
>> pear install doc.php.net/phd_php
>>
>> Many thanks for your prompt help,
>>
>
> You're welcome. You also may want to setup your local "mirror", see
> https://wiki.php.net/doc/phd/view for instructions, and this will give
> you some "fuzzy" searching like on php.net, but it kinda slow (2-3
> sec) on my box, but YMMV.

Yeah, I'm doing that now but its still not finding the docs (I put the
symbolic link in my web mirror back to my phpdocs/manual/en
too). There's a lot of conflicting and incomplete info out there in php
doc land but I'll find my through ;)




[PHP-DOC] Re: Building Docs

2011-06-03 Thread Richard Riley
Alexey Shein  writes:

> 2011/6/3 Richard Riley :
>>
>> I am trying to set up a local php web for doc lookup. I followed the
>> instructions here
>>
>> https://wiki.php.net/doc/phd
>>
>> but this line
>>
>> phd -d doc-base/.manual.xml -o output_dir -f php -P PHP
>>
>> falls over with
>>
>> [08:28:02 - E_USER_ERROR          ] 
>> /usr/share/php/phpdotnet/phd/Options/Handler.php:165
>>        Invalid Package (Tried: 'PHP' Supported: 'Generic')
>>
>
> It seems that you installed only Generic phd package and not PHP one
> (i.e. that used for rendering php docs).
> This link can help https://doc.php.net/phd/docs/ (see PEAR install)
> You can also try pear option --alldeps if dependencies still not
> fetched automatically.

Ah yes. Thanks. Another case of too many cooks spoiling the broth. The
other instructions I followed didn't mention this

pear install doc.php.net/phd_php

Many thanks for your prompt help,

regards

r.




[PHP-DOC] Building Docs

2011-06-03 Thread Richard Riley

I am trying to set up a local php web for doc lookup. I followed the
instructions here

https://wiki.php.net/doc/phd

but this line

phd -d doc-base/.manual.xml -o output_dir -f php -P PHP

falls over with

[08:28:02 - E_USER_ERROR  ] 
/usr/share/php/phpdotnet/phd/Options/Handler.php:165
Invalid Package (Tried: 'PHP' Supported: 'Generic')

I realise its probably very simple but digging around I am going in
circles with pear/phar/phd/ etc. Can someone point out what I need to
read/ do to proceed please.

regards
#r.#