News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
__halt_compiler() - how nuts?
May 13, 2006 @ 06:26:55

On the SitePoint PHP Blog, Harry Fuecks has a look at the "new(ish) __halt_compiler function" in PHP.

Simon blogmarked PHP's new(ish) __halt_compiler function which, according to the packet: "halts the execution of the compiler. This can be useful to embed data in PHP scripts, like the installation files. Byte position of the data start can be determined by the __COMPILER_HALT_OFFSET__ constant which is defined only if there is a __halt_compiler() presented in the file."

It may or may not be an elegant solution (it's certainly relatively simple) but it does have a very valid use case-to allow PHP applications which install themselves from a single script, all related pieces (other PHP scripts, CSS, HTML, images, etc.) being packed at the end of the script in a binary form.

Herry also mentions some specific examples of cases that could use it, including Ilia's fudforum software, which makes use of it to perform its installation.

0 comments voice your opinion now!
__halt-compiler embed data fudforum intsall __halt-compiler embed data fudforum intsall


blog comments powered by Disqus

Similar Posts

Johannes Schluter's Blog: Data structures in PHP 5.3

Ilia Alshanetsky's Blog: FUDforum 2.7.7RC2 Released

DevGuide.net: Dynamic Bitmap Graphics with PHP and GD

SpinDrop.us: Not taking frameworks for granted

Ilia Alshanetsky\'s Blog: FUDforum 2.7.4RC1 Released


Community Events

Don't see your event here?
Let us know!


series opinion podcast voicesoftheelephpant php7 community performance part2 application conference configure interview laravel release api composer introduction example framework symfony2

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework