php-general Digest 2 Aug 2010 21:43:31 -0000 Issue 6876

Topics (messages 307279 through 307287):

Re: Text  editor for Ubuntu with FTP
        307279 by: Gary

Re: "php -l" - does it find *anything*?
        307280 by: Gary
        307281 by: Peter Lind

Register now for Surge 2010
        307282 by: Jason Dixon

DirectoryIterator
        307283 by: João Cândido de Souza Neto
        307285 by: Nathan Nobbe
        307286 by: João Cândido de Souza Neto

DirectoryIterator Resources.
        307284 by: João Cândido de Souza Neto

generate animated gifs
        307287 by: Martín Marqués

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 ---
The answer is emacs. What was the question? *grin*


--- End Message ---
--- Begin Message ---
Okay, I'm resurrecting this because I just found something I consider to
be strange in the documentation. Under the -l option at
http://php.net/manual/en/features.commandline.options.php it says

"This option won't find fatal errors (like undefined functions). Use -f
if you would like to test for fatal errors too."

Okay, but.. umm... "-f"? Really? That doesn't make any sense, given what
-f is for (actually running the script). Documentation bug, or is my
brain failing to work today?


--- End Message ---
--- Begin Message ---
On 2 August 2010 12:05, Gary <[email protected]> wrote:
> Okay, I'm resurrecting this because I just found something I consider to
> be strange in the documentation. Under the -l option at
> http://php.net/manual/en/features.commandline.options.php it says
>
> "This option won't find fatal errors (like undefined functions). Use -f
> if you would like to test for fatal errors too."
>
> Okay, but.. umm... "-f"? Really? That doesn't make any sense, given what
> -f is for (actually running the script). Documentation bug, or is my
> brain failing to work today?

Sounds like a roundabout way of saying "You can only find run-time
errors (such as undefined functions) by actually running the script".
Could definitely need some clarification

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>

--- End Message ---
--- Begin Message ---
Registration for Surge Scalability Conference 2010 is open for all
attendees!  We have an awesome lineup of leaders from across the various
communities that support highly scalable architectures, as well as the
companies that implement them.  Here's a small sampling from our list of
speakers:

John Allspaw, Etsy
Theo Schlossnagle, OmniTI
Rasmus Lerdorf, creator of PHP
Tom Cook, Facebook
Benjamin Black, fast_ip
Artur Bergman, Wikia
Christopher Brown, Opscode
Bryan Cantrill, Joyent
Baron Schwartz, Percona
Paul Querna, Cloudkick

Surge 2010 focuses on real case studies from production environments;
the lessons learned from failure and how to re-engineer your way to a
successful, highly scalable Internet architecture.  The conference takes
place at the Tremont Grand Historic Venue on Sept 30 and Oct 1, 2010 in
Baltimore, MD.  Register now to enjoy the Early Bird discount and
guarantee your seat to this year's event!

http://omniti.com/surge/2010/register

Thanks,

-- 
Jason Dixon
OmniTI Computer Consulting, Inc.
[email protected]
443.325.1357 x.241

--- End Message ---
--- Begin Message ---
Is there a way of getting the symbolic link's target when using 
DirectoryIterator?

Thanks in advance.
-- 
João Cândido de Souza Neto 



--- End Message ---
--- Begin Message ---
2010/8/2 João Cândido de Souza Neto <[email protected]>

> Is there a way of getting the symbolic link's target when using
> DirectoryIterator?
>

as DirectoryIterator traverses the contents of a directory, the current()
method will return an SplFileInfo instance.

Using the SplFileInfo, you can determine if the entry is a link and if so,
dereference it

http://www.php.net/manual/en/splfileinfo.islink.php

(note: $oFile is internally being populated via $oIt->current())

<?php
$oIt = new DirectoryIterator('./');
foreach($oIt as $oFile)
  if($oFile->isLink())
  {
    echo 'link found' . PHP_EOL;
    echo 'link points to: ' . $oFile->getRealPath() . PHP_EOL;
  }
?>

-nathan

--- End Message ---
--- Begin Message ---
Thank you Nathan.

As soon as the PHP documentation does not mention the getRealPath() method, 
I couldn´t realize that this could be done.

-- 
João Cândido de Souza Neto

"Nathan Nobbe" <[email protected]> escreveu na mensagem 
news:[email protected]...
2010/8/2 João Cândido de Souza Neto <[email protected]>

> Is there a way of getting the symbolic link's target when using
> DirectoryIterator?
>

as DirectoryIterator traverses the contents of a directory, the current()
method will return an SplFileInfo instance.

Using the SplFileInfo, you can determine if the entry is a link and if so,
dereference it

http://www.php.net/manual/en/splfileinfo.islink.php

(note: $oFile is internally being populated via $oIt->current())

<?php
$oIt = new DirectoryIterator('./');
foreach($oIt as $oFile)
  if($oFile->isLink())
  {
    echo 'link found' . PHP_EOL;
    echo 'link points to: ' . $oFile->getRealPath() . PHP_EOL;
  }
?>

-nathan



--- End Message ---
--- Begin Message ---
Is there a way of getting the symbolic link's target when using
DirectoryIterator?

Thanks in advance.

-- 
João Cândido de Souza Neto 



--- End Message ---
--- Begin Message ---
Is there a way (I haven't found it yet) to create with a sequence of
gifs an animated gif using php-gd?

-- 
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

--- End Message ---

Reply via email to