php-windows Digest 30 Sep 2009 11:09:27 -0000 Issue 3704

Topics (messages 29625 through 29629):

Re: [PHP-DOC] Coloured console output support for windows.
        29625 by: Richard Quadling
        29627 by: Nathan Adams
        29628 by: Richard Quadling

Write your own P2P application using PHP
        29626 by: Carsten Rhod Gregersen

problems with includes after upgrade from 5.2.1 to 5.2.11
        29629 by: Paul J. Smith

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 ---
2009/9/24 Jason Hood <[email protected]>:
> Richard Quadling wrote:
>>
>> MAYBE ... combining PHP with ANSICon COULD be a solution? Maybe an
>> php_ansicon.dll extension.
>
> If PHP supports loading DLLs, you should be able to do that
> now, since it should be enough to just load ANSI.dll.  Anyway,
> the new version of ANSICON with the install option is on my
> site (http://adoxa.110mb.com/ansicon/ansi121.zip).
>
> Jason.
>

With ansicon loaded

php -r "while(1) { echo getenv('ANSICON'), ""\r""; }"

provides the realtime size of the console window as you stretch it or
change the layout.
-- 
-----
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

--- End Message ---
--- Begin Message ---
On Tue, Sep 22, 2009 at 4:38 AM, Richard Quadling
<[email protected]> wrote:
> 2009/9/21 Hannes Magnusson <[email protected]>:
>> On Mon, Sep 21, 2009 at 12:59, Richard Quadling
>> <[email protected]> wrote:
>>> doing, it can be done quite easily using the REG command from the
>>> Windows Resource Toolkit.
>>>
>>> REG ADD "HKLM\Software\Microsoft\Command Processor" /v AutoRun /t
>>> REG_SZ /d "C:\Utils\ANSICon.exe -p"
>>
>> Right, but that has to be done when installing the application, not
>> every time phd.bat is executed.
>
> Agreed. And the ANSICON instructions could easily be amended to show this.
>
>
>> And we would also have to detect if the system supports it rather then
>> blindly polluting the registry.
>
> "blindly polluting the registry" ?
>
> From cmd /? ...
>
> "If /D was NOT specified on the command line, then when CMD.EXE starts, it
> looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
> either or both are present, they are executed first.
>
>    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
>
>        and/or
>
>    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun"
>
>
> This is "blindly polluting", but a completely standard and supported
> facility, albeit an obscure one.
>
> As for detection, once ANSICON is loaded,  the ANSICON environment variable.
>
> But maybe ANSICon needs a small installer which has the option of
> doing this (Jason - possible?) automatically for those too nervous of
> editing registry.
>
>>
>> Plus, afaik, the PEAR installer doesn't support doing such things.
>>
>
> !is_null(getenv('ANSICON')) ?
>
>> -Hannes
>>
>
> I think that whilst windows no longer has coloured console output as
> standard, a free alternative is a viable option.

Windows does indeed support colored console output. You have a few
options to accomplish this without installing 3rd party programs:use
the DOS subsystem, you can program in 16bit assembly using interrupts
(which will just get launched in the DOS subsystem), or use Windows
API to output text in colored format. Microsoft has dropped support
for DOS interrupts in the 32bit console unfortunately and replaced it
with goofy API that you have to call : (. Now, I could just be talking
through my teeth but I am 99% sure of what I said (at least for
Windows OS based on the NT kernel such as 2K/XP, I have very little
experience with Vista so I can't comment).

See the following KB article for more info
http://support.microsoft.com/kb/101875

>
> The other option is to disable coloured output when on windows, but if
> that was the case, I would like the option of having a mechanism to
> enable this without having to add it to the command line every time -
> yet another env_var?
>
> The source is available. Jason has been very receptive to the issues
> that I've raised.
>
> Richard
>
> --
> -----
> 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
>

My 2 cents anyways.

--- End Message ---
--- Begin Message ---
2009/9/24 Nathan Adams <[email protected]>:
> On Tue, Sep 22, 2009 at 4:38 AM, Richard Quadling
> <[email protected]> wrote:
>> 2009/9/21 Hannes Magnusson <[email protected]>:
>>> On Mon, Sep 21, 2009 at 12:59, Richard Quadling
>>> <[email protected]> wrote:
>>>> doing, it can be done quite easily using the REG command from the
>>>> Windows Resource Toolkit.
>>>>
>>>> REG ADD "HKLM\Software\Microsoft\Command Processor" /v AutoRun /t
>>>> REG_SZ /d "C:\Utils\ANSICon.exe -p"
>>>
>>> Right, but that has to be done when installing the application, not
>>> every time phd.bat is executed.
>>
>> Agreed. And the ANSICON instructions could easily be amended to show this.
>>
>>
>>> And we would also have to detect if the system supports it rather then
>>> blindly polluting the registry.
>>
>> "blindly polluting the registry" ?
>>
>> From cmd /? ...
>>
>> "If /D was NOT specified on the command line, then when CMD.EXE starts, it
>> looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
>> either or both are present, they are executed first.
>>
>>    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
>>
>>        and/or
>>
>>    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun"
>>
>>
>> This is "blindly polluting", but a completely standard and supported
>> facility, albeit an obscure one.
>>
>> As for detection, once ANSICON is loaded,  the ANSICON environment variable.
>>
>> But maybe ANSICon needs a small installer which has the option of
>> doing this (Jason - possible?) automatically for those too nervous of
>> editing registry.
>>
>>>
>>> Plus, afaik, the PEAR installer doesn't support doing such things.
>>>
>>
>> !is_null(getenv('ANSICON')) ?
>>
>>> -Hannes
>>>
>>
>> I think that whilst windows no longer has coloured console output as
>> standard, a free alternative is a viable option.
>
> Windows does indeed support colored console output. You have a few
> options to accomplish this without installing 3rd party programs:use
> the DOS subsystem, you can program in 16bit assembly using interrupts
> (which will just get launched in the DOS subsystem), or use Windows
> API to output text in colored format. Microsoft has dropped support
> for DOS interrupts in the 32bit console unfortunately and replaced it
> with goofy API that you have to call : (. Now, I could just be talking
> through my teeth but I am 99% sure of what I said (at least for
> Windows OS based on the NT kernel such as 2K/XP, I have very little
> experience with Vista so I can't comment).
>
> See the following KB article for more info
> http://support.microsoft.com/kb/101875
>
>>
>> The other option is to disable coloured output when on windows, but if
>> that was the case, I would like the option of having a mechanism to
>> enable this without having to add it to the command line every time -
>> yet another env_var?
>>
>> The source is available. Jason has been very receptive to the issues
>> that I've raised.
>>
>> Richard
>>
>> --
>> -----
>> 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
>>
>
> My 2 cents anyways.
>

Natan, sorry.

I should have said, windows no longer has a native support for ANSI
escape sequences which worked admirably on previous incarnations of
MSDos and Windows (via ANSI.SYS) and many other operating systems.

So, technically, yes you CAN DIY if you like making wheels or you can
use a freely available alternative.

Sorry for the confusion.

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

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

I want to announce a complete new PHP based P2P framework, for writing
peer-to-peer application. By P2P we mean one-location to
another-location, direct and private connections using your browser
(without having to do complicated configuration of your firewall and
other tricks).

Most PHP applications works without adjustment !!!

It can be regarded as a complex mix of HTTPS and VOIP.

http://www.nabto.com

Example usecases: Connect to your home media center, from the remote and
fetch or stream the song or video you need.

Why is this smart:
Because the average internet user doesn't know how to adjust firewall's,
dynamic DNS and other tech-clutter to get connected to his home
network. 

How:

Install our serversoftware:
---------------------------
(a reverseproxy and an apache server) on the "to-be-remote" computer.
Deploy your PHP application (based on phar files) on this computer (when
you register your compute, it will get a unique DNS address).

Install a plugin in your browser in the other end:
--------------------------------------------------
And connect to your P2P-PHP application directly using your browser, no
matter firewalls, dynamic IP allocation and other problems that makes
creating internet connections (to your home network) awfully complicated
for the average internet user.


Security:
It's super secure. Connections are authenticated using PKI
(public/private key infrastructure) before the firewall is "punched".
And strong encryption is use for encrypting the data.

It's free for non-commercial use.

Currently it's "only Windows" (and only IE on the browser), but we are
launching a crossplatform Firefox and Unix (linux/mac) based server
version very soon. Which is why I'm using this maillist ;-)

The catch... it's Alpha version release! but I'm sure readers of this
list can manage ;-). 


-- 
best regards,
Nabto ApS - Reconnecting the internet
Carsten Rhod Gregersen
Web: http://www.nabto.com
Åbogade 15, 8200 Århus N, Tlf: +45 8734 5513



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

I just upgraded php and am using it with IIS / FastCgi.

Now all my code 'includes' and 'requires' are failing as they don't have drive 
letters :(

This does not see to happen if you run from the command line.

My php files are all stored on drive e:

Previously all my code just referenced full paths like /mysite/includes/test.php

Now I find this does not work unless I use e:/mysite/includes/test.php

Any way to fix this without having to change 1000's of lines of code!?

Thanks,

Paul

--- End Message ---

Reply via email to