PHP console (php.exe -a)

PHP console (php.exe -a)

am 27.12.2009 16:05:27 von Libor

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 or 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

Re: PHP console (php.exe -a)

am 27.12.2009 16:40:08 von harlequin2

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

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 27.12.2009 16:44:25 von Shahar Evron

--------------020704070404040800040607
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: 7bit

Hi,

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

When working with -a don't forget to add the opening ' 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 ' 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 or didn't execute code. Please, help me!
>
> (I am running PHP 5.3.0 on Win XP.)
>
> Thanks
> Libor
>
--
Shahar Evron

Product Manager
Zend Technologies


--------------020704070404040800040607--

Re: PHP console (php.exe -a)

am 27.12.2009 16:50:52 von Libor

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 :
> 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 s=
cript 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
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 27.12.2009 17:03:57 von Ferenc Kovacs

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

Tyrael

2009/12/27 Libor :
> 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 or 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

Re: PHP console (php.exe -a)

am 27.12.2009 17:09:00 von bedul

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 wrote:
> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>
> Tyrael
>
> 2009/12/27 Libor :
>> 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 or 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..

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 27.12.2009 17:18:25 von Libor

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-co mmand-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 :
> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>
> Tyrael
>
> 2009/12/27 Libor :
>> 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 or 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

Re: PHP console (php.exe -a)

am 27.12.2009 17:25:09 von Rasmus Lerdorf

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-co mmand-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 :
>> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>>
>> Tyrael
>>
>> 2009/12/27 Libor :
>>> 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 or 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

Re: PHP console (php.exe -a)

am 27.12.2009 17:28:27 von Libor

Hello Rasmus,
I know what you are talking about. "Nice" means auto-completion for
variables, builtin functions, etc. after pressing 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 :
> 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-co mmand-line.h=
tml
>> 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 =3D 1;
>> php > $bar =3D 4;
>> php > echo $foo + $bar;
>> 5
>>
>> --
>> Libor
>>
>> 2009/12/27 Ferenc Kovacs :
>>> php.exe -r "echo date('Y-m-d H:i:s');" works for me on windows.
>>>
>>> Tyrael
>>>
>>> 2009/12/27 Libor :
>>>> Hi all,
>>>> I don't know if I am stupid or what but I can't find out how to send t=
yped
>>>> code to execute.
>>>>
>>>>> php.exe -a
>>>> Interactive mode enabled
>>>>
>>>> Pressing or 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

Re: PHP console (php.exe -a)

am 27.12.2009 17:30:12 von Rasmus Lerdorf

Libor Jelinek wrote:
> Hello Rasmus,
> I know what you are talking about. "Nice" means auto-completion for
> variables, builtin functions, etc. after pressing 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

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 27.12.2009 18:12:11 von Carsten Wiedmann

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 -a
| Interactive mode enabled
|
| | $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
|
| | $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



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 27.12.2009 19:25:36 von Shahar Evron

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 ' > 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 ' > Windows.
>
Hehe stupid me, I meant readline, not gettext

Shahar.

--
Shahar Evron

Product Manager
Zend Technologies



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: PHP console (php.exe -a)

am 27.12.2009 23:44:58 von harlequin2

Hi Carsten,

Carsten wrote:
> But on Windows that's buggy:
> | # php -a
> | Interactive mode enabled
> |
> | > | $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

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: PHP console (php.exe -a)

am 28.12.2009 10:59:49 von Ferenc Kovacs

On Sun, Dec 27, 2009 at 11:44 PM, Sascha Meyer wrote:
> Hi Carsten,
>
> Carsten wrote:
>> But on Windows that's buggy:
>> | # php -a
>> | Interactive mode enabled
>> |
>> | >> | $a=3D5;
>> | $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
>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 28.12.2009 12:00:34 von Carsten Wiedmann

Am 27.12.2009 23:44, schrieb Sascha Meyer:
>> | 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?

All PHP 5.3.x versions. With PHP 5.2.x it's correct and the same behavior
like on *nix.

Just curious, if I test this more then one time, sometimes I can see the
output with "^C", and sometimes not?

BTW: It's always a VC6-TS build and XP SP3 32bit.

Regards,
Carsten



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: PHP console (php.exe -a)

am 28.12.2009 13:41:04 von Ferenc Kovacs

On Mon, Dec 28, 2009 at 12:00 PM, Carsten Wiedmann wrote:
> Am 27.12.2009 23:44, schrieb Sascha Meyer:
>>> | 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?
>
> All PHP 5.3.x versions. With PHP 5.2.x it's correct and the same behavior
> like on *nix.
>
> Just curious, if I test this more then one time, sometimes I can see the
> output with "^C", and sometimes not?
>
> BTW: It's always a VC6-TS build and XP SP3 32bit.
>
php-5.3.1-Win32-VC9-x86 for me, and Im seeing the same behaviour.

Tyrael
> Regards,
> Carsten
>
>
>
> --
> 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

Re: PHP console (php.exe -a)

am 28.12.2009 13:47:03 von Pierre Joye

2009/12/27 Libor :
> 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 or didn't execute code. Please, help me!
>
> (I am running PHP 5.3.0 on Win XP.)
>

As far as I remember the interactive mode never got ported to windows.

PS: interactive mode means that you can enter php line of code and
they will be executed everytime you press enter.

Cheers,
--
Pierre

http://blog.thepimp.net | http://www.libgd.org

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 28.12.2009 14:15:58 von Ferenc Kovacs

nice :D

Tyrael

On Mon, Dec 28, 2009 at 1:47 PM, Pierre Joye wrote:
> 2009/12/27 Libor :
>> 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 or didn't execute code. Please, help me!
>>
>> (I am running PHP 5.3.0 on Win XP.)
>>
>
> As far as I remember the interactive mode never got ported to windows.
>
> PS: interactive mode means that you can enter php line of code and
> they will be executed everytime you press enter.
>
> Cheers,
> --
> Pierre
>
> http://blog.thepimp.net | http://www.libgd.org
>
> --
> 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

RE: Re: PHP console (php.exe -a)

am 28.12.2009 14:17:46 von Louis Solomon

------_=_NextPart_001_01CA87C0.8D0EAA3B
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

> ... But, if I now enter "^C" ...
=20
although maybe not a solution to php being a strange beast, IIFC Ctrl-Z =
is the normal way to terminate input via stdin.
=20
Louis Solomon
www.SteelBytes.com =20
=20

________________________________

From: news on behalf of Carsten Wiedmann
Sent: Mon 2009/12/28 10:00 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Re: PHP console (php.exe -a)



Am 27.12.2009 23:44, schrieb Sascha Meyer:
>> | 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?

All PHP 5.3.x versions. With PHP 5.2.x it's correct and the same =
behavior
like on *nix.

Just curious, if I test this more then one time, sometimes I can see the
output with "^C", and sometimes not?

BTW: It's always a VC6-TS build and XP SP3 32bit.

Regards,
Carsten



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




------_=_NextPart_001_01CA87C0.8D0EAA3B--

Re: PHP console (php.exe -a)

am 28.12.2009 14:24:02 von Libor

It's not good message for me but thank you for definitive answer.
Libor


2009/12/28 Pierre Joye :
> 2009/12/27 Libor :
>> 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 or didn't execute code. Please, help me!
>>
>> (I am running PHP 5.3.0 on Win XP.)
>>
>
> As far as I remember the interactive mode never got ported to windows.
>
> PS: interactive mode means that you can enter php line of code and
> they will be executed everytime you press enter.
>
> Cheers,
> --
> Pierre
>
> http://blog.thepimp.net | http://www.libgd.org
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 28.12.2009 14:38:47 von Carsten Wiedmann

Am 28.12.2009 13:47, schrieb Pierre Joye:
> 2009/12/27 Libor :
>> 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.
>
> As far as I remember the interactive mode never got ported to windows.

OK, but as you can read in my other Mail, it's working with PHP 5.2.x on
Windows exactly like on *nix. Only PHP 5.3.x is not working correctly on
Windows.

Maybe a silly question:
If it's not ported to Windows, why is "php -a" working, the "-a" parameter
is exepted?

Regards,
Carsten


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 28.12.2009 14:45:30 von harlequin2

Hi all,

had to check my php installation today and just realized that php.exe called from command line was not the same as used by my Apache2 webserver (because of different locations set in PATH and PHPRC environment variables).

Means that my test from yesterday was not performed with PHP 5.3.x, but with 5.2.9. The 5.2.x branch seems to work correctly whereas 5.3.x is definitely broken.

Pierre wrote:
> As far as I remember the interactive mode never got ported to windows.

you are talking about the newer PHP 5.3 branch, right? Otherwise 5.2.x versions would behave as the 5.3 branch. Do you know why it was not ported?

Regards,

Sascha

--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 30.12.2009 11:56:41 von Richard Quadling

2009/12/27 Libor :
> 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 or 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
>
>

As mentioned, CTRL+Z is the END-OF-TEXT character needed to terminate
input from STDIN.

[2009/12/30 10:56:09] [C:\] [] >php -v
PHP 5.3.2-dev (cli) (built: Dec 18 2009 13:57:17)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

[2009/12/30 10:56:11] [C:\] [] >php -a
Interactive mode enabled

Plain text.
$a = "This is still plain text and not assigning anything to $a.";
The next line is switching to PHP processing.
// This is a comment.
$b = "The first variable PHP is seeing is this one.";
echo $a;
echo $b;
// Switch out of PHP again.
?>
This is some more plain text.
To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
^Z
Plain text.
$a = "This is still plain text and not assigning anything to $a.";
The next line is switching to PHP processing.

Notice: Undefined variable: a in - on line 7
The first variable PHP is seeing is this one.This is some more plain text.
To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).




Can someone confirm that CTRL+Z/F6 is the same exit mechanism for non
windows please? If so, I'll update the manual with something relevant.

Regards,

Richard Quadling.

--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 30.12.2009 12:11:45 von Richard Quadling

2009/12/30 Richard Quadling :
> 2009/12/27 Libor :
>> 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 or 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
>>
>>
>
> As mentioned, CTRL+Z is the END-OF-TEXT character needed to terminate
> input from STDIN.
>
> [2009/12/30 10:56:09] [C:\] [] >php -v
> PHP 5.3.2-dev (cli) (built: Dec 18 2009 13:57:17)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
>
> [2009/12/30 10:56:11] [C:\] [] >php -a
> Interactive mode enabled
>
> Plain text.
> $a = "This is still plain text and not assigning anything to $a.";
> The next line is switching to PHP processing.
> > // This is a comment.
> $b = "The first variable PHP is seeing is this one.";
> echo $a;
> echo $b;
> // Switch out of PHP again.
> ?>
> This is some more plain text.
> To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
> ^Z
> Plain text.
> $a = "This is still plain text and not assigning anything to $a.";
> The next line is switching to PHP processing.
>
> Notice: Undefined variable: a in - on line 7
> The first variable PHP is seeing is this one.This is some more plain text.
> To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
>
>
>
>
> Can someone confirm that CTRL+Z/F6 is the same exit mechanism for non
> windows please? If so, I'll update the manual with something relevant.
>
> Regards,
>
> Richard Quadling.
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>

On the surface, for Windows, the interactive mode offers nothing extra
and in fact offers less than non-interactive mode.

Specifically, autoload functions, though registered (either by having
__autoload() or by using spl_autoload_register()), are not invoked for
missing classes.

So, for windows, what's the point of the interactive mode?


--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 30.12.2009 12:12:45 von Richard Quadling

2009/12/30 Richard Quadling :
> 2009/12/30 Richard Quadling :
>> 2009/12/27 Libor :
>>> 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 or 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
>>>
>>>
>>
>> As mentioned, CTRL+Z is the END-OF-TEXT character needed to terminate
>> input from STDIN.
>>
>> [2009/12/30 10:56:09] [C:\] [] >php -v
>> PHP 5.3.2-dev (cli) (built: Dec 18 2009 13:57:17)
>> Copyright (c) 1997-2009 The PHP Group
>> Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
>>
>> [2009/12/30 10:56:11] [C:\] [] >php -a
>> Interactive mode enabled
>>
>> Plain text.
>> $a = "This is still plain text and not assigning anything to $a.";
>> The next line is switching to PHP processing.
>> >> // This is a comment.
>> $b = "The first variable PHP is seeing is this one.";
>> echo $a;
>> echo $b;
>> // Switch out of PHP again.
>> ?>
>> This is some more plain text.
>> To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
>> ^Z
>> Plain text.
>> $a = "This is still plain text and not assigning anything to $a.";
>> The next line is switching to PHP processing.
>>
>> Notice: Undefined variable: a in - on line 7
>> The first variable PHP is seeing is this one.This is some more plain text.
>> To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
>>
>>
>>
>>
>> Can someone confirm that CTRL+Z/F6 is the same exit mechanism for non
>> windows please? If so, I'll update the manual with something relevant.
>>
>> Regards,
>>
>> Richard Quadling.
>>
>> --
>> -----
>> Richard Quadling
>> "Standing on the shoulders of some very clever giants!"
>> EE : http://www.experts-exchange.com/M_248814.html
>> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>
>
> On the surface, for Windows, the interactive mode offers nothing extra
> and in fact offers less than non-interactive mode.
>
> Specifically, autoload functions, though registered (either by having
> __autoload() or by using spl_autoload_register()), are not invoked for
> missing classes.
>
> So, for windows, what's the point of the interactive mode?
>
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>

[2009/12/30 11:08:44] [C:\] [] >php -a
Interactive mode enabled

print_r(spl_autoload_functions());
echo static_Krypt::EnKryptB64('Hello');
^Z
Array
(
[0] => AutoLoadRAQ
)

Fatal error: Class 'static_Krypt' not found in - on line 3


[2009/12/30 11:09:42] [C:\] [] >php
print_r(spl_autoload_functions());
echo static_Krypt::EnKryptB64('Hello');
^Z
Array
(
[0] => AutoLoadRAQ
)
QJeZiALdGhA=

[2009/12/30 11:12:12] [C:\] [] >

--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 30.12.2009 12:44:00 von Carsten Wiedmann

Am 30.12.2009 11:56, schrieb Richard Quadling:
> As mentioned, CTRL+Z is the END-OF-TEXT character needed to terminate
> input from STDIN.

ctrl-z signals end-of-file. On *nix that's ctrl-d (ctrl-z on *nix is for job
control).


> [2009/12/30 10:56:09] [C:\] [] >php -v
> PHP 5.3.2-dev (cli) (built: Dec 18 2009 13:57:17)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
>
> [2009/12/30 10:56:11] [C:\] [] >php -a
> Interactive mode enabled
>
> Plain text.
> $a = "This is still plain text and not assigning anything to $a.";
> The next line is switching to PHP processing.
> > // This is a comment.
> $b = "The first variable PHP is seeing is this one.";
> echo $a;
> echo $b;
> // Switch out of PHP again.
> ?>
> This is some more plain text.
> To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
> ^Z
> Plain text.
> $a = "This is still plain text and not assigning anything to $a.";
> The next line is switching to PHP processing.
>
> Notice: Undefined variable: a in - on line 7
> The first variable PHP is seeing is this one.This is some more plain text.
> To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).

An end-of-file signal also exiting PHP. So you can't type additional PHP code.

And you also don't see the main problem/difference:
With PHP5.2/*nix or PHP5.2/Win I can see the output from an echo() after a
. With PHP5.3/Win (don't have PHP5.3/*nix) I must exit from PHP
(ctrl-z / ctrl-c) to see the output from an echo().

PHP5.2:
| D:\PHP\php-5.2.12-win32>php -n -a
| Interactive mode enabled
|
| | echo 'test';
| test^Z
|
| D:\PHP\php-5.2.12-win32>

PHP5.3:
| D:\PHP\php-5.3.1-win32>php -n -a
| Interactive mode enabled
|
| | echo 'test';
| ^Z
| test
| D:\PHP\php-5.3.1-win32>


So for now it looks like PHP5.3/Win is buffering the output (and the whole
buffer is flushed while PHP is exiting). PHP 5.2 is not buffering the output
and you can see the output immediately.

Regards,
Carsten



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP console (php.exe -a)

am 30.12.2009 12:51:39 von Carsten Wiedmann

Am 30.12.2009 12:12, schrieb Richard Quadling:
>> Specifically, autoload functions, though registered (either by having
>> __autoload() or by using spl_autoload_register()), are not invoked for
>> missing classes.
>>
>> So, for windows, what's the point of the interactive mode?
>
> [2009/12/30 11:08:44] [C:\] [] >php -a
> Interactive mode enabled
>
> > print_r(spl_autoload_functions());
> echo static_Krypt::EnKryptB64('Hello');
> ^Z
> Array
> (
> [0] => AutoLoadRAQ
> )
>
> Fatal error: Class 'static_Krypt' not found in - on line 3

That's the same output you get on *nix. So no difference between *nix and
Windows in this point.

Regards,
Carsten


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

read an xml string from a form field

am 05.01.2010 18:58:22 von Harpreet

------_=_NextPart_001_01CA8E30.AC05AA72
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I have a simple form with a textarea to receive an xml string.=20

=20

My xml string is something like this:

=20





=20

=20

How can I request the value in my php page $_GET wont work.

=20


------_=_NextPart_001_01CA8E30.AC05AA72--

RE: read an xml string from a form field

am 05.01.2010 19:16:01 von Harpreet

------_=_NextPart_001_01CA8E33.23957DD9
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

POST or get both don't work I guess because of the < > characters

=20

________________________________

From: Antonio CS [mailto:antoniocs@gmail.com]=20
Sent: Tuesday, January 05, 2010 12:59 PM
To: Harpreet
Subject: Re: [PHP-WIN] read an xml string from a form field

=20

Why not use $_POST?

On Tue, Jan 5, 2010 at 5:58 PM, Harpreet
wrote:

I have a simple form with a textarea to receive an xml string.



My xml string is something like this:











How can I request the value in my php page $_GET wont work.




=20


------_=_NextPart_001_01CA8E33.23957DD9--

RE: read an xml string from a form field

am 05.01.2010 20:42:53 von Harpreet

Stripslashes is the function i was looking for. Thanks

-----Original Message-----
From: Harpreet [mailto:harpreet@crispincorp.com]=20
Sent: Tuesday, January 05, 2010 1:16 PM
To: Antonio CS; php-windows@lists.php.net
Subject: RE: [PHP-WIN] read an xml string from a form field

POST or get both don't work I guess because of the < > characters

=20

________________________________

From: Antonio CS [mailto:antoniocs@gmail.com]=20
Sent: Tuesday, January 05, 2010 12:59 PM
To: Harpreet
Subject: Re: [PHP-WIN] read an xml string from a form field

=20

Why not use $_POST?

On Tue, Jan 5, 2010 at 5:58 PM, Harpreet
wrote:

I have a simple form with a textarea to receive an xml string.



My xml string is something like this:











How can I request the value in my php page $_GET wont work.




=20


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php