php-windows Digest 28 Dec 2009 09:59:56 -0000 Issue 3741

Topics (messages 29771 through 29783):

Re: PHP console (php.exe -a)
        29771 by: Sascha Meyer
        29772 by: Shahar Evron
        29773 by: Libor Jelinek
        29774 by: Ferenc Kovacs
        29775 by: Gunawan Wibisono
        29776 by: Libor Jelinek
        29777 by: Rasmus Lerdorf
        29778 by: Libor Jelinek
        29779 by: Rasmus Lerdorf
        29780 by: Carsten Wiedmann
        29781 by: Shahar Evron
        29782 by: Sascha Meyer
        29783 by: Ferenc Kovacs

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi Libor,

Libor wrote:
> Hi all,
> I don't know if I am stupid or what but I can't find out how to send 
> typed code to execute.

I never worked with php as an interactive console application but as far as I 
can see on the php.net homepage [1], the -a switch is used to call a script 
which then takes direct user input from the console via STDIN stream instead of 
working with predefined variable values.

Regards, Sascha

[1] http://de.php.net/manual/en/features.commandline.php
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

--- End Message ---
--- Begin Message ---
Hi,

Did it just print out back the stuff you typed in?

When working with -a don't forget to add the opening '<?php' tag, just
like you would in a regular script.

BTW on *nix if you build PHP with gettext support there's real
interactive mode support (a command prompt, history, completion, and no
need to type the '<?php' stuff) but I'm not sure if that is available on
Windows.

Shahar.

On 27/12/09 17:05 PM, Libor wrote:
> Hi all,
> I don't know if I am stupid or what but I can't find out how to send
> typed code to execute.
>
> > php.exe -a
> Interactive mode enabled
>
> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>
> (I am running PHP 5.3.0 on Win XP.)
>
> Thanks
> Libor
>
-- 
Shahar Evron <shaha...@zend.com>

Product Manager
Zend Technologies


--- End Message ---
--- Begin Message ---
Hello Sascha,
yes, running "php -a" should await input from STDIN but it should
means keyboard. And I don't know how to end STDIN input from keyboard
(how to tell to php.exe "execute what I typed").

I am typing typing but I don't know how to force php to execute what I
typed on keyboard :-(

Thanks!
Libor


2009/12/27 Sascha Meyer <harlequ...@gmx.de>:
> Hi Libor,
>
> Libor wrote:
>> Hi all,
>> I don't know if I am stupid or what but I can't find out how to send
>> typed code to execute.
>
> I never worked with php as an interactive console application but as far as I 
> can see on the php.net homepage [1], the -a switch is used to call a script 
> which then takes direct user input from the console via STDIN stream instead 
> of working with predefined variable values.
>
> Regards, Sascha
>
> [1] http://de.php.net/manual/en/features.commandline.php
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>

--- End Message ---
--- Begin Message ---
php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.

Tyrael

2009/12/27 Libor <ljeli...@virtage.com>:
> Hi all,
> I don't know if I am stupid or what but I can't find out how to send typed
> code to execute.
>
>> php.exe -a
> Interactive mode enabled
>
> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>
> (I am running PHP 5.3.0 on Win XP.)
>
> Thanks
> Libor
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
i work in dekstop to
*using php !!

and one problem my office offers is something must done using
windows.. than i use PHP-GTK


it might not related to your question.. if you need to input number or
something that posible using window .. u should try use PHP-GTK..
confuse? u not the only



On 12/27/09, Ferenc Kovacs <tyr...@gmail.com> wrote:
> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>
> Tyrael
>
> 2009/12/27 Libor <ljeli...@virtage.com>:
>> Hi all,
>> I don't know if I am stupid or what but I can't find out how to send typed
>> code to execute.
>>
>>> php.exe -a
>> Interactive mode enabled
>>
>> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>>
>> (I am running PHP 5.3.0 on Win XP.)
>>
>> Thanks
>> Libor
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
akan ada dimana mulut terkunci dan suara tak ada lagi..
saat itu gunakanlah HP untuk melakukan SMS!!
-> ini aliran bedul.. bukan aliran aneh.
tertawa sebelum tertawa didepan RSJ..

--- End Message ---
--- Begin Message ---
Please look at these articles what I mean... PHP should contains live
interactive console (like Perl or Python have also) to test short
snippets of code.

http://blog.thinkphp.de/archives/44-More-PHP-power-on-the-command-line.html
http://www.webmasterworld.com/forum88/11023.htm

But I don't know how to send typed snippet for execution.

It should works like this:

% php -a
interactive mode enabled

php > $foo = 1;
php > $bar = 4;
php > echo $foo + $bar;
5

--
Libor

2009/12/27 Ferenc Kovacs <tyr...@gmail.com>:
> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>
> Tyrael
>
> 2009/12/27 Libor <ljeli...@virtage.com>:
>> Hi all,
>> I don't know if I am stupid or what but I can't find out how to send typed
>> code to execute.
>>
>>> php.exe -a
>> Interactive mode enabled
>>
>> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>>
>> (I am running PHP 5.3.0 on Win XP.)
>>
>> Thanks
>> Libor
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

--- End Message ---
--- Begin Message ---
If PHP isn't linked against libedit/libreadline then you won't get the
nice interactive command-line.  I have no idea if the Windows build is
built against either of those libraries or whether those libraries even
work on Windows, but if you are not getting the nice command line
editing, that is likely the cause.

-Rasmus

Libor Jelinek wrote:
> Please look at these articles what I mean... PHP should contains live
> interactive console (like Perl or Python have also) to test short
> snippets of code.
> 
> http://blog.thinkphp.de/archives/44-More-PHP-power-on-the-command-line.html
> http://www.webmasterworld.com/forum88/11023.htm
> 
> But I don't know how to send typed snippet for execution.
> 
> It should works like this:
> 
> % php -a
> interactive mode enabled
> 
> php > $foo = 1;
> php > $bar = 4;
> php > echo $foo + $bar;
> 5
> 
> --
> Libor
> 
> 2009/12/27 Ferenc Kovacs <tyr...@gmail.com>:
>> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>>
>> Tyrael
>>
>> 2009/12/27 Libor <ljeli...@virtage.com>:
>>> Hi all,
>>> I don't know if I am stupid or what but I can't find out how to send typed
>>> code to execute.
>>>
>>>> php.exe -a
>>> Interactive mode enabled
>>>
>>> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>>>
>>> (I am running PHP 5.3.0 on Win XP.)
>>>
>>> Thanks
>>> Libor
>>>
>>> --
>>> PHP Windows Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
> 


--- End Message ---
--- Begin Message ---
Hello Rasmus,
I know what you are talking about. "Nice" means auto-completion for
variables, builtin functions, etc. after pressing <Tab> key. But basic
support (without auto-completion) should be still available in
Windows.

Is there anybody with Linux to try run "php -a" and tell us how to
send typed code to execution?

Thanks
Libor

2009/12/27 Rasmus Lerdorf <ras...@lerdorf.com>:
> If PHP isn't linked against libedit/libreadline then you won't get the
> nice interactive command-line.  I have no idea if the Windows build is
> built against either of those libraries or whether those libraries even
> work on Windows, but if you are not getting the nice command line
> editing, that is likely the cause.
>
> -Rasmus
>
> Libor Jelinek wrote:
>> Please look at these articles what I mean... PHP should contains live
>> interactive console (like Perl or Python have also) to test short
>> snippets of code.
>>
>> http://blog.thinkphp.de/archives/44-More-PHP-power-on-the-command-line.html
>> http://www.webmasterworld.com/forum88/11023.htm
>>
>> But I don't know how to send typed snippet for execution.
>>
>> It should works like this:
>>
>> % php -a
>> interactive mode enabled
>>
>> php > $foo = 1;
>> php > $bar = 4;
>> php > echo $foo + $bar;
>> 5
>>
>> --
>> Libor
>>
>> 2009/12/27 Ferenc Kovacs <tyr...@gmail.com>:
>>> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>>>
>>> Tyrael
>>>
>>> 2009/12/27 Libor <ljeli...@virtage.com>:
>>>> Hi all,
>>>> I don't know if I am stupid or what but I can't find out how to send typed
>>>> code to execute.
>>>>
>>>>> php.exe -a
>>>> Interactive mode enabled
>>>>
>>>> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>>>>
>>>> (I am running PHP 5.3.0 on Win XP.)
>>>>
>>>> Thanks
>>>> Libor
>>>>
>>>> --
>>>> PHP Windows Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>
>
>

--- End Message ---
--- Begin Message ---
Libor Jelinek wrote:
> Hello Rasmus,
> I know what you are talking about. "Nice" means auto-completion for
> variables, builtin functions, etc. after pressing <Tab> key. But basic
> support (without auto-completion) should be still available in
> Windows.
> 
> Is there anybody with Linux to try run "php -a" and tell us how to
> send typed code to execution?

You just type it in and hit Enter.  There is no trick.  And without
libreadline there really is no point.  You might as well just use -r

-Rasmus

--- End Message ---
--- Begin Message ---
Am 27.12.2009 17:30, schrieb Rasmus Lerdorf:
>> Is there anybody with Linux to try run "php -a" and tell us how to
>> send typed code to execution?
> 
> You just type it in and hit Enter.  There is no trick.  And without
> libreadline there really is no point.

Maybe you have another PHP-CLI then me on *nix (5.2.11)? Without libreadline
it's working a similar way on *nix, of course I have to type the starting
"<?php" myself:
| # php -a
| Interactive mode enabled
|
| <?php
| $a=5;
| $a++;
| echo $a.PHP_EOL;
| 6
At this point I can enter more code. Or exit PHP with:
| ^C
|
| #

But on Windows that's buggy:
| # php -a
| Interactive mode enabled
|
| <?php
| $a=5;
| $a++;
| echo $a.PHP_EOL;
|
Nothing happens on Windows at this point. The cursor is in the next line
waiting for input. But, if I now enter "^C", I can see the result:
| 6
|
| #
So on Windows the whole code/input is executed at once and not step by step.
And because PHP is also terminated with "^C", I can't enter additional code.

Regards,
Carsten



--- End Message ---
--- Begin Message ---
On 27/12/09 17:44 PM, Shahar Evron wrote:
> Hi,
>
> Did it just print out back the stuff you typed in?
>
> When working with -a don't forget to add the opening '<?php' tag, just
> like you would in a regular script.
>
> BTW on *nix if you build PHP with gettext support there's real
> interactive mode support (a command prompt, history, completion, and no
> need to type the '<?php' stuff) but I'm not sure if that is available on
> Windows.
>   
Hehe stupid me, I meant readline, not gettext

Shahar.

-- 
Shahar Evron <shaha...@zend.com>

Product Manager
Zend Technologies



--- End Message ---
--- Begin Message ---
Hi Carsten,

Carsten wrote:
> But on Windows that's buggy:
> | # php -a
> | Interactive mode enabled
> |
> | <?php
> | $a=5;
> | $a++;
> | echo $a.PHP_EOL;
> |
> Nothing happens on Windows at this point. The cursor is in the next line
> waiting for input. But, if I now enter "^C", I can see the result:
> | 6
> |
> | #
> So on Windows the whole code/input is executed at once and not step by
> step.
> And because PHP is also terminated with "^C", I can't enter additional
> code.

just tried with PHP 5.3 on XP and Windows 7 and both directly output code when 
the echo command is called, not when the script is terminated. 
Which PHP version did you use that shows the buggy behaviour?

Best regards,

Sascha
-- 
Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.! 
http://portal.gmx.net/de/go/dsl01

--- End Message ---
--- Begin Message ---
On Sun, Dec 27, 2009 at 11:44 PM, Sascha Meyer <harlequ...@gmx.de> wrote:
> Hi Carsten,
>
> Carsten wrote:
>> But on Windows that's buggy:
>> | # php -a
>> | Interactive mode enabled
>> |
>> | <?php
>> | $a=5;
>> | $a++;
>> | echo $a.PHP_EOL;
>> |
>> Nothing happens on Windows at this point. The cursor is in the next line
>> waiting for input. But, if I now enter "^C", I can see the result:
>> | 6
>> |
>> | #
same for me on windows xp 32bit, php 5.3.1.
>> So on Windows the whole code/input is executed at once and not step by
>> step.
>> And because PHP is also terminated with "^C", I can't enter additional
>> code.
>
> just tried with PHP 5.3 on XP and Windows 7 and both directly output code 
> when the echo command is called, not when the script is terminated.
> Which PHP version did you use that shows the buggy behaviour?
>
> Best regards,
>
> Sascha
> --
> Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!
> http://portal.gmx.net/de/go/dsl01
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to