You are here: Re: [PHP] Re: PHP-CLI Debugging Question « PHP « IT news, forums, messages
Re: [PHP] Re: PHP-CLI Debugging Question

Posted by Davy Durham on 03/15/05 21:22

No, I was looking for php to print each line of the code as it executes it.

Jason Barnett wrote:

>Davy Durham wrote:
>
>
>>Hi.. I'm working on converting some CLI (not CGI) bash scripts to php
>>and was wondering if there's an equivalent to 'set -x' from bash in php
>>
>>set -x in bash basically causes the statements to be printed to stderr
>>as they are executed. Does php have something similar?
>>
>>Thanks,
>> Davy
>>
>>
>
>I'm no expert on set -x, but you can easily have stdout go to a file if
>that's what you're after. You'll probably want to use the output
>buffering functions to do this.
>
>http://php.net/manual/en/ref.outcontrol.php
>
><?php
>
>ob_start();
>/** Put all of your PHP code here */
>$stdout = ob_get_contents();
>ob_end_clean();
>file_put_contents('/path/to/file', $stdout);
>
>?>
>
>--
>Teach a man to fish...
>
>NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
>STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
>STFM | http://php.net/manual/en/index.php
>STFW | http://www.google.com/search?q=php
>LAZY |
>http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация