php-general Digest 30 Sep 2010 21:14:46 -0000 Issue 6967

Topics (messages 308365 through 308376):

Re: Which PHP 5.3 documentation generators have you found?
        308365 by: Richard Quadling
        308372 by: Erik L. Arneson
        308374 by: Adam Richardson
        308376 by: David Harkness

version_compare
        308366 by: Brian Smither
        308368 by: shiplu
        308369 by: Paul M Foster
        308370 by: Jim Lucas
        308371 by: Brian Smither
        308373 by: Jim Lucas

Re: Database Administration
        308367 by: Tom Barrett

filter_var (was: Re: [PHP] version_compare)
        308375 by: Brian Smither

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
On 29 September 2010 20:07, Adam Richardson <[email protected]> wrote:
> On Wed, Sep 29, 2010 at 2:54 PM, [email protected] <
> [email protected]> wrote:
>
>> Does phpDocumenter not do the trick? I must admit, I've not tried anything
>> specific to 5.3 (i can imagine the namespace thing would be a major part if
>> the documentation) but its served me well with other php5 code.
>>
>>
>>
> In the past I've been really pleased using phpDocumentor, however I'm afraid
> the namespaces in 5.3 cause it to choke :(
>
> Adam
>
> --
> Nephtali:  PHP web framework that functions beautifully
> http://nephtaliproject.com
>

Gently side-stepping the namespace issue, I've used phpDocumentor with
the ExtJS extension to make really nice documentation
(http://zymengine.com/dev/news/30-phpdoc-extjs-converter-template).

There are a few issues (http://code.google.com/p/zym/issues/list).
I've resolved some and supplied patches.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On Wed, 29 Sep 2010, Adam Richardson wrote:
> Hi all,
>
> Anybody know of a documentation generator which plays nicely with PHP
> 5.3?

I've always been a fan of phpDocumentor.

-- 
Erik Arneson <[email protected]>
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
      Office : +1.541.291.9776    Skype : callto://pymander
            http://www.leisurenouveau.com/


--- End Message ---
--- Begin Message ---
On Thu, Sep 30, 2010 at 2:30 PM, Erik L. Arneson <[email protected]> wrote:

> On Wed, 29 Sep 2010, Adam Richardson wrote:
> > Hi all,
> >
> > Anybody know of a documentation generator which plays nicely with PHP
> > 5.3?
>
> I've always been a fan of phpDocumentor.
>
>
I agree, it's worked very well in the past.  However, it looks like it's
been a while since a new release:
http://www.phpdoc.org/news.php?id=57

My code makes extensive use of namespaces and other new features found
within PHP 5.3, and these don't appear to be supported within phpDocumentor.

Any other options?

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
While we don't use any 5.3 specific features such as namespaces yet, we set
up our continuous integration system to use Doxygen. It runs significantly
faster than phpDocumentor, though we put zero effort into tuning either
system.

--- End Message ---
--- Begin Message ---
I found this code...
if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
 $text=filter_var($text, FILTER_SANITIZE_URL);
}

...to be questionable.

Under what conditions would version_compare() return true, yet the filter_var() 
be undefined? Because that's what is happening.

Thank you.




--- End Message ---
--- Begin Message ---
On Thu, Sep 30, 2010 at 9:43 PM, Brian Smither <[email protected]> wrote:
>
> I found this code...
> if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
It means condition (PHP_VERSION >= 5.2.0)

>  $text=filter_var($text, FILTER_SANITIZE_URL);
> }
>
> ...to be questionable.
>
> Under what conditions would version_compare() return true, yet the 
> filter_var() be undefined? Because that's what is happening.
>
> Thank you.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Shiplu Mokadd.im
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

--- End Message ---
--- Begin Message ---
On Thu, Sep 30, 2010 at 09:43:22AM -0600, Brian Smither wrote:

> 
> I found this code...
> if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
>  $text=filter_var($text, FILTER_SANITIZE_URL);
> }
> 
> ...to be questionable.
> 
> Under what conditions would version_compare() return true, yet the 
> filter_var() be undefined? Because that's what is happening.

If your PHP was compiled without support for the filter functions? I
assume when you say that filter_var() is "undefined" you mean that the
software returns a message that the function itself cannot be found?

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
Brian Smither wrote:
> I found this code...
> if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
>  $text=filter_var($text, FILTER_SANITIZE_URL);
> }
> 
> ...to be questionable.
> 
> Under what conditions would version_compare() return true, yet the 
> filter_var() be undefined? Because that's what is happening.
> 
> Thank you.
> 
> 
> 
> 

Personally, I would change that to be

if ( function_exists('filter_var') ) {
        $text = filter_var($text, FILTER_SANITIZE_URL);
}

Jim

--- End Message ---
--- Begin Message ---
>Personally, I would change that to be
>if ( function_exists('filter_var') ) {

So would I:
*But it's not my code.
*I wish to learn and understand the cause of the problem - not walk around it.

>It means condition (PHP_VERSION >= 5.2.0)

I understand that. There was a second, more relevant, part to my question.

I have found the version of PHP used as reported in the HTTP header responses.

filter_var() is undefined in PHP/5.2.4_p20070914-pl2-gentoo




--- End Message ---
--- Begin Message ---
Brian Smither wrote:
>> Personally, I would change that to be
>> if ( function_exists('filter_var') ) {
> 
> So would I:
> *But it's not my code.
> *I wish to learn and understand the cause of the problem - not walk around it.
> 
>> It means condition (PHP_VERSION >= 5.2.0)
> 
> I understand that. There was a second, more relevant, part to my question.
> 
> I have found the version of PHP used as reported in the HTTP header responses.
> 
> filter_var() is undefined in PHP/5.2.4_p20070914-pl2-gentoo
> 

As Paul pointed out, maybe your version of PHP was built without the filter_var
function compiled in.

--- End Message ---
--- Begin Message ---
Thanks for the replies, they have been most enlightening. :)

--- End Message ---
--- Begin Message ---
>As Paul pointed out, maybe your version of PHP was built without the
>filter_var function compiled in.

This is what I have learned about PHP with filter_var() as an illustrative 
point:

Many people who provide elaborations on PHP make too many assumptions or are 
blatently and woefully incomplete. Statements such as "PHP 5.2.0 or higher is 
required for this to work" is misleading. The PHP online manual pages for 
respective functions make no distinction that any particular function or 
capability is an optional include for a build - considered an "extension" as 
opposed to, what?, "native code"?

I have also learned that when coding my own scripts, I must not only read the 
manual page for that function, but also any metadata for it and its group, such 
as the Introduction page, Installing/Configuring, etc. And where, when I 
finally find it, if I can reason out that I should be looking for it, it may 
say "The filter extension is enabled by default as of PHP 5.2.0", that I need 
to be reasonably cautious because some idiot may build PHP 5.2.0+ without this 
extension.

Are the array_*() functions also an optional extension?



--- End Message ---

Reply via email to