<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/category/blog/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:10:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>php &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>PHP6?</title>
		<link>https://blog.sephiroth.it/2006/10/23/php6/</link>
					<comments>https://blog.sephiroth.it/2006/10/23/php6/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Mon, 23 Oct 2006 22:51:56 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[delegate]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[php6]]></category>
		<category><![CDATA[strict]]></category>
		<category><![CDATA[unicode]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=177</guid>

					<description><![CDATA[waiting for php6<br />
]]></description>
										<content:encoded><![CDATA[<p>Have you already play with <strong>PHP6</strong>?<br />
Today I discovered the PHP6 CVS snapshots and I decided to take a look at it (still not tested).</p>
<p>I read some unhappy comment to the fact php want to put the <strong>Unicode </strong>settings into the php.ini, but if this change will make PHP faster  I would prefer in this way, expecially if unicode will be always set to on.<br />
Is there a reason to put unicode support off in this world? (for example I haven&#8217;t still understood why wxPython continues to releases both ansi and unicode builds&#8230;)<br />
Finally <strong>register globals</strong>&#8216; PHP3 BC to go!<br />
<strong>Namespaces</strong>. Maybe they will add namespace.. I really hope so! This is indeed one of the most awaited features for me! (<a title="php6 namespaces" href="http://blog.bitflux.ch/archive/2005/11/29/php-is-most-presumably-getting-namespaces.html" target="_blank">read</a> about a discussion on namespaces)<br />
Support for <strong>delegates.</strong></p>
<p>My big hope is also to see a &#8220;real&#8221; strict type language, but this is only my though.<br />
Backward Compatibility. Well this could cause a flame for many developers but if they really want to make a solid new product from scratch probably they dont have to take care about BC.</p>
<p>Read more about the <a title="php6 meeting in Paris" href="http://www.php.net/~derick/meeting-notes.html" target="_blank">PHP6 Novermber meeting</a> and all the proposals.<br />
<a title="php6 snapshot" href="http://snaps.php.net/" target="_blank">Download</a> the PHP6 snapshot</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/10/23/php6/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Debugging PHP with XDebug</title>
		<link>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/</link>
					<comments>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 16 Feb 2006 18:53:54 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[traceback]]></category>
		<category><![CDATA[xdebug]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=129</guid>

					<description><![CDATA[In these days, working with PHP after a lot of time, I&#8217;ve installed this cool tool for debugging PHP (it supports both PHP 4 and 5). XDebug is really useful for debugging PHP, which is usually not really easy to debug, and also easy to install. It provides a lot of valuable debug informations, for &#8230; <a href="https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/" class="more-link">Continue reading <span class="screen-reader-text">Debugging PHP with XDebug</span></a>]]></description>
										<content:encoded><![CDATA[<p>In these days, working with PHP after a lot of time, I&#8217;ve installed this cool tool for debugging PHP (it supports both PHP 4 and 5).<br />
XDebug is really useful for debugging PHP, which is usually not really easy to debug, and also easy to install.<br />
It provides a lot of valuable debug informations, for example a full <a href="http://www.xdebug.org/screens.php">traceback for errors</a>, <a href="http://www.xdebug.org/docs-profiling.php">profilig</a> with memory and CPU usage, <a href="http://www.xdebug.org/docs-functions.php#profiling">profiling functions </a>, etc..<br />
I really suggest to take a look at it!<br />
Both Windows and Linux versions are available for download<br />
<a href="http://www.xdebug.org">http://www.xdebug.org</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP5: a big failure ?</title>
		<link>https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/</link>
					<comments>https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 16 Feb 2006 18:52:57 +0000</pubDate>
				<category><![CDATA[general]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[zend]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=128</guid>

					<description><![CDATA[What&#8217;s happening ? PHP 5 has been presented as a revolution, a lot of new features have been added and a lot of projects have been made. But only a small group of hosters seem interested in supporting PHP 5 on their web servers. It is not so useful to have a beautiful programming language &#8230; <a href="https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/" class="more-link">Continue reading <span class="screen-reader-text">PHP5: a big failure ?</span></a>]]></description>
										<content:encoded><![CDATA[<p>What&#8217;s happening ?<br />
<a href="http://www.php.net/downloads.php">PHP 5</a> has been presented as a <span style="font-weight: bold;">revolution</span>, a lot of new features have been added and a lot of projects have been made. But only a <span style="font-style: italic;">small group of hosters</span> seem interested in supporting PHP 5 on their web servers. It is not so useful to have a beautiful programming language to use if we can&#8217;t apply it to production environments.<br />
But what about the causes ? Maybe they are related to the fact that <a href="http://www.zend.com">Zend </a>decided to <span style="font-weight: bold;">support both</span> PHP 4 and 5 <span style="font-weight: bold;">separately</span>, allowing hoster to choose which version to compile on their webservers, or maybe to the fact that PHP 5 is <span style="font-weight: bold;">not fully compatible</span> with the older versions, and there are some <span style="font-weight: bold;">security-related bugs</span> that increase our doubts.<br />
I&#8217;m using a lot PHP 5 in production environments, without any problem. It is quite <span style="font-weight: bold;">fast and reliable</span>, and has got a lot of useful features that adapt perfectly to enterprise development. We MUST use PHP 5 to help it growing until it become the standard &#8230;<br />
To conclude I&#8217;d like to inform the ones who don&#8217;t know it, that PHP team is <a href="http://www.php.net/%7Ederick/meeting-notes.html">working on the sixth version</a> (yes &#8230; <span style="font-weight: bold;">PHP </span>6 &#8230; and it is available for download at <a href="http://snaps.php.net/">snaps.php.net</a>) that will add to the language a lot of interesting features, such as native support to <a href="http://www.unicode.org">Unicode</a>.<br />
I <span style="font-style: italic;">hope </span>there will be only one (working) version of PHP in the future &#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Foundation PHP 5 for Flash</title>
		<link>https://blog.sephiroth.it/2005/03/30/foundation-php-5-for-flash/</link>
					<comments>https://blog.sephiroth.it/2005/03/30/foundation-php-5-for-flash/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 31 Mar 2005 06:53:43 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=71</guid>

					<description><![CDATA[php5 book<br />
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignleft size-full wp-image-607" title="1590594665" src="https://blog.sephiroth.it/wp-content/uploads/2005/03/1590594665.jpg" alt="" width="200" height="240" srcset="https://blog.sephiroth.it/wp-content/uploads/2005/03/1590594665.jpg 200w, https://blog.sephiroth.it/wp-content/uploads/2005/03/1590594665-125x150.jpg 125w" sizes="(max-width: 200px) 100vw, 200px" />It was from days of Flash 5 which this book first time appeared. Long time has elapsed (expecially considering the informatic times).</p>
<p>Today I see that <a href="http://www.friendsofed.com">friends of Ed</a> has published a new version of this book covering <span style="font-weight: bold;">ActionScript 2.0</span>, <span style="font-weight: bold;">PHP 5</span> and <span style="font-weight: bold;">MySQL 4.1</span>.<br />
Taking a look at the sample PDF chapter available it seems quite well done, clear and simple to read (ok, that is 2nd chapter and it talks of very basic things already&#8230;), but i noticed that it also threats of things/problems which often occured if you use php and flash everyday.. for example escape characters, magic_quotes_gpc etc..<br />
I think i will going to get a copy of the book, it&#8217;s always useful take my mind under exercise&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/03/30/foundation-php-5-for-flash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Charset handling proposal in AMFPHP</title>
		<link>https://blog.sephiroth.it/2005/01/28/charset-handling-proposal-in-amfphp/</link>
					<comments>https://blog.sephiroth.it/2005/01/28/charset-handling-proposal-in-amfphp/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Sat, 29 Jan 2005 01:13:20 +0000</pubDate>
				<category><![CDATA[amfphp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[mbstring]]></category>
		<category><![CDATA[utf8]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=57</guid>

					<description><![CDATA[amfphp charset handling problem and proposal<br />
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: bold;">Patrick Mineault</span> makes a proposal for the charset handling in <a href="http://www.amfphp.org">AMFPHP</a></p>
<div style="border: 1px dotted #cccccc; margin: 10px 15px; padding: 5px; background-color: #fdf8e5; font-style: italic;"><em>[..] that should put an end to problems with Unicode and native character set handling between PHP and Flash, a problem that has palgued AMFPHP for a long time</em></div>
<p>To use charset handling in the new CVS version, you will need to call the setCharsetHandler function from your gateway.php file, like this:</p>
<pre>$gateway-&gt;setCharsetHandler("iconv", "latin1", "latin1");</pre>
<p>Detail for setCharsetHandler method: setCharsetHandler(string <span style="font-weight: bold;">mode</span>, string <span style="font-weight: bold;">phpCharset</span>, string <span style="font-weight: bold;">sqlCharset</span>)  The mode can be: 1. none (don’t do anything) 2. <a href="http://www.php.net/iconv">iconv</a> (uses the iconv libray for reencoding) 3. <a href="http://www.php.net/mbstring">mbstring</a> (uses the mbstring library for reencoding) 4. <a href="http://www.php.net/recode">recode</a> (uses the recode library for reencoding) 5. <a href="http://www.php.net/utf8_decode">utf8_decode</a> (uses the XML function utf8_decode and encode for reencoding &#8211; ISO-8859-1 only)   I haven&#8217;t tested it already, but I&#8217;m sure this is a great step toward a solution of the charset problem!</p>
<p><a href="http://www.amfphp.org/wiki/doku.php?id=charset_issue">http://www.amfphp.org/wiki/doku.php?id=charset_issue</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/01/28/charset-handling-proposal-in-amfphp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Installing PHP5 on Apache server</title>
		<link>https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/</link>
					<comments>https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 21 Jul 2004 06:29:48 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[wamp]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=18</guid>

					<description><![CDATA[Today i was trying to install the new PHP5 module on my local apache server. It&#8217;s really simple at least, but when searching for instructions i discovered WAMP5, which includes in the installation: Apache 1.3.31 PHP 5.0.0 MySQL 4.0.18 PhpMyAdmin 2.5.7 sqlitemanager I&#8217;ve immediately installed it &#240;&#159;&#152;&#137; Once installed you&#8217;ll see a new tray icon &#8230; <a href="https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/" class="more-link">Continue reading <span class="screen-reader-text">Installing PHP5 on Apache server</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Today i was trying to install the new PHP5 module on my local apache server.<br />
It&#8217;s really simple at least, but when searching for instructions i discovered <strong>WAMP5</strong>, which includes in the installation: </span></p>
<ul>
<li>Apache 1.3.31</li>
<li>PHP 5.0.0</li>
<li>MySQL 4.0.18</li>
<li>PhpMyAdmin 2.5.7</li>
<li>sqlitemanager</li>
</ul>
<p>I&#8217;ve immediately installed it 😉<br />
Once installed you&#8217;ll see a new tray icon with some options for your installed services.<br />
I sugges it if you are thinking to install PHP5 on your local machine (i have also a separate apache/php4/mysql3 framework on my machine too, in this way i can always switch trought the two version of PHP/MySQL)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP 5.0.0 Released!</title>
		<link>https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/</link>
					<comments>https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 16 Jul 2004 06:31:21 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqli]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[zend]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=17</guid>

					<description><![CDATA[Finally, after months of release candidates&#8230; Some of the key features of PHP 5 include: * The Zend Engine II with a new object model and dozens of new features. * XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/). * A new SimpleXML &#8230; <a href="https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/" class="more-link">Continue reading <span class="screen-reader-text">PHP 5.0.0 Released!</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Finally, after months of release candidates&#8230;<br />
Some of the key features of PHP 5 include:</span></p>
<p>* The Zend Engine II with a new object model and dozens of new features.<br />
* XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/).<br />
* A new SimpleXML extension for easily accessing and manipulating XML as PHP objects. It can also interface with the DOM extension and vice-versa.<br />
* A brand new built-in SOAP extension for interoperability with Web Services.<br />
* A new MySQL extension named MySQLi for developers using MySQL 4.1 and later. This new extension includes an object-oriented interface in addition to a traditional interface; as well as support for many of MySQL&#8217;s new features, such as prepared statements.<br />
* SQLite has been bundled with PHP. For more information on SQLite, please visit their website.<br />
* Streams have been greatly improved, including the ability to access low-level socket operations on streams.<br />
* And lots more&#8230;</p>
<p><a href="http://www.php.net" target="_blank">http://www.php.net</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PEAR::SWF updating&#8230; read and modify swf with PHP</title>
		<link>https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/</link>
					<comments>https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 08 Jul 2004 06:36:10 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[swf]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=15</guid>

					<description><![CDATA[I&#8217;ve just begun to modify the old PHP class flashHeader. Now using the PEAR::File class for a better file I/O processes. Basically now, other than returning all the main information from an swf file, such as the bg color, framerate, player version, compression, protection used, movie size.., it allows to modify some of those parameters. &#8230; <a href="https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/" class="more-link">Continue reading <span class="screen-reader-text">PEAR::SWF updating&#8230; read and modify swf with PHP</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">I&#8217;ve just begun to modify the old PHP class flashHeader. Now using the PEAR::File class for a better file I/O  processes.<br />
Basically now, other than returning all the main information from an swf file, such as the bg color, framerate, player version, compression, protection used, movie size.., it allows to <strong>modify </strong>some of those parameters.<br />
For example it can change the <strong>framerate, background, protection</strong>&#8230; I&#8217;m also working in order to allows the class modify some other swf tags in runtime..<br />
<a title="PHP SWF Reader ( PEAR::SWF )" href="https://blog.sephiroth.it/projects/php-swf-reader-pearswf/" target="_blank">Working example</a></span></p>
<p>Here the source file<br />
<span style="color: #000000;"><br />
<span style="color: #0000bb;">&lt;?php<br />
</span><span style="color: #ff8000;">// include the PEAR package<br />
</span><span style="color: #007700;">require </span><span style="color: #dd0000;">&#8220;File/File_SWF.php&#8221;</span><span style="color: #007700;">;<br />
</span><span style="color: #0000bb;">$flash </span><span style="color: #007700;">= new </span><span style="color: #0000bb;">SWF</span><span style="color: #007700;">(</span><span style="color: #dd0000;">&#8220;source.swf&#8221;</span><span style="color: #007700;">);<br />
if(</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">is_valid</span><span style="color: #007700;">()){<br />
</span><span style="color: #0000bb;">$stat </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">stat</span><span style="color: #007700;">(); </span><span style="color: #ff8000;">// this give all the info<br />
// and also..<br />
</span><span style="color: #0000bb;">$fps </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getFrameRate</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$size </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getMovieSize</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$bg </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getBackgroundColor</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$prot </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getProtected</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$compr </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getCompression</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$version </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getVersion</span><span style="color: #007700;">();</p>
<p></span><span style="color: #ff8000;">// they can be changed&#8230;<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setFrameRate</span><span style="color: #007700;">(</span><span style="color: #0000bb;">60</span><span style="color: #007700;">);<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setProtected</span><span style="color: #007700;">(</span><span style="color: #0000bb;">1</span><span style="color: #007700;">);<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setBackgroundColor</span><span style="color: #007700;">(</span><span style="color: #0000bb;">51</span><span style="color: #007700;">,</span><span style="color: #0000bb;">51</span><span style="color: #007700;">,</span><span style="color: #0000bb;">204</span><span style="color: #007700;">);<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setCompression</span><span style="color: #007700;">(</span><span style="color: #0000bb;">1</span><span style="color: #007700;">);</p>
<p></span><span style="color: #ff8000;">// and write a new file&#8230;<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">write</span><span style="color: #007700;">(</span><span style="color: #dd0000;">&#8220;./new_one.swf&#8221;</span><span style="color: #007700;">,</span><span style="color: #0000bb;">1</span><span style="color: #007700;">);<br />
}<br />
</span><span style="color: #0000bb;">?&gt;</span></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ho to get bytesTotal from a dynamic generated content in PHP</title>
		<link>https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/</link>
					<comments>https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 25 Jun 2004 06:42:04 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[bytesLoaded]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=13</guid>

					<description><![CDATA[Think you want to load from Flash some dynamically generated images from PHP (maybe using GD..), or also some else dynamic content.. Think at this simple code: /**** MovieClip Loader listener ****/ loaderListener = { onLoadStart : function(){ trace('load started!'); trace(" ----------------------------------- ") }, onLoadProgress : function(target, bLoaded, bTotal){ trace(bLoaded + "/" + bTotal) }, &#8230; <a href="https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/" class="more-link">Continue reading <span class="screen-reader-text">Ho to get bytesTotal from a dynamic generated content in PHP</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Think you want to load from Flash some dynamically generated images from PHP (maybe using GD..), or also some else dynamic content..<br />
Think at this simple code: </span></p>
<pre>/**** MovieClip Loader listener ****/
loaderListener = {
	onLoadStart : function(){
		trace('load started!');
		trace(" ----------------------------------- ")
	},
	onLoadProgress : function(target, bLoaded, bTotal){
		trace(bLoaded + "/" + bTotal)
	},
	onLoadComplete : function(target){
		trace(" ----------------------------------- ")
		trace("complete: " + target.getBytesTotal());
		trace(" ----------------------------------- ")
	}
}

// I just add the rand variable to prevent caching...
movie_path = "http://local/ob_start.php?file=C:/DSCF0182.JPG&amp;rand=" + new Date().getTime()
var mcLoader = new MovieClipLoader()
mcLoader.loadClip(movie_path, loader)
mcLoader.addListener( loaderListener )</pre>
<p>Now, if your PHP code is written in this way (just a image copy and resize using the GD 2.x library):</p>
<pre><span style="color: #000000;">
<span style="color: #0000bb;">&lt;?php</span>
<span style="color: #ff8000;">// Get the required image from GET</span>
<span style="color: #0000bb;">$image </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'file'</span><span style="color: #007700;">];</span><span style="color: #0000bb;">$size </span><span style="color: #007700;">= </span><span style="color: #0000bb;">getimagesize</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);</span>
<span style="color: #ff8000;">// create an empty image and copy the original</span>
<span style="color: #0000bb;">$dst_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatetruecolor</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">);</span>
<span style="color: #0000bb;">$src_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatefromjpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);</span>
<span style="color: #ff8000;">// resize image</span>
<span style="color: #0000bb;">imagecopyresized</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$src_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">], </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]);</span>
<span style="color: #ff8000;">// start output content</span>
<span style="color: #0000bb;">header</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"Content-type: image/jpeg"</span><span style="color: #007700;">);</span>
<span style="color: #ff8000;">// display the image</span>
<span style="color: #0000bb;">imagejpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #dd0000;">""</span><span style="color: #007700;">, </span><span style="color: #0000bb;">80</span><span style="color: #007700;">);</span>
<span style="color: #0000bb;">?&gt;</span>
</span></pre>
<p>You will be noticed that the <strong>bytesTotal</strong> variable in flash is always &#8216;0&#8217;!<br />
This could be a problem if you want to use any kind of graphic preloader for this such of things&#8230;<br />
However with some little more code it&#8217;s always possible to get in flash (and not only from flash) the exact content bytes lenght.<br />
Try now this:</p>
<pre><span style="color: #0000bb;">&lt;?php
</span><span style="color: #ff8000;">// Turn on output buffering
</span><span style="color: #0000bb;"><a href="http://www.php.net/ob_start">ob_start</a></span><span style="color: #007700;">();
</span><span style="color: #ff8000;">// Get the required image from GET
</span><span style="color: #0000bb;">$image </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'file'</span><span style="color: #007700;">];
</span><span style="color: #0000bb;">$size </span><span style="color: #007700;">= </span><span style="color: #0000bb;">getimagesize</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// create an empty image and copy the original
</span><span style="color: #0000bb;">$dst_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatetruecolor</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">);
</span><span style="color: #0000bb;">$src_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatefromjpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// resize image
</span><span style="color: #0000bb;">imagecopyresized</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$src_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">], </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]);
</span><span style="color: #ff8000;">// start output content
</span><span style="color: #0000bb;">header</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"Content-type: image/jpeg"</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// display the image
</span><span style="color: #0000bb;">imagejpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #dd0000;">""</span><span style="color: #007700;">, </span><span style="color: #0000bb;">80</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// send the content lenght to output
</span><span style="color: #0000bb;">header</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"Content-Length: "</span><span style="color: #007700;">. </span><span style="color: #0000bb;"><a href="http://www.php.net/ob_get_length">ob_get_length</a></span><span style="color: #007700;">());
</span><span style="color: #ff8000;">// flush the output
</span><span style="color: #0000bb;"><a href="http://www.php.net/ob_end_flush">ob_end_flush</a></span><span style="color: #007700;">();
</span><span style="color: #0000bb;">?&gt;</span></pre>
<p><!--http://www.php.net/ob_start--></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A PHP domxml class in flash style!</title>
		<link>https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/</link>
					<comments>https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Tue, 02 Dec 2003 19:30:41 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=6</guid>

					<description><![CDATA[Some days ago Daniele, a friend of mine, point my attention to an opensource project hosted on sourceforge that is very interesting for PHP/Flash guys &#240;&#159;&#153;&#130; This module permit to do an xml parsing, in PHP, using a dom xml in the same way we already do in flash. Here a little example i made &#8230; <a href="https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/" class="more-link">Continue reading <span class="screen-reader-text">A PHP domxml class in flash style!</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Some days ago Daniele, a friend of mine, point my attention to an opensource project hosted on sourceforge that is very interesting for PHP/Flash guys 🙂<br />
This module permit to do an xml parsing, in PHP, using a dom xml in the same way we already do in flash.</span></p>
<p>Here a little example i made using this class:</p>
<pre>&lt;?
// include the php module
include('lib.xml.inc.php');
// load an external xml source
$test = new XML('test.xml');

// make a simple parsing, in AS style ;)
$childs = $test-&gt;firstChild-&gt;childNodes;
for($a = 0; $a &lt; count($childs); $a++){	
echo "nodeName " . $childs[$a]-&gt;nodeName . "&lt;br /&gt;";	
echo "nodeValue " . $childs[$a]-&gt;firstChild-&gt;nodeValue . "&lt;br /&gt;";
}
?&gt;</pre>
<p>as you can see, we&#8217;re already familiar with firstChild, nodeName, nodeValue&#8230; etc..<br />
I always hate the PHP SAX parser, and always always prefer a dom xml parser, much more simple to create and to read.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
