<?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>Alexey Zakhlestins blog &#187; programming</title>
	<atom:link href="http://blog.milkfarmsoft.com/category/computers/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.milkfarmsoft.com</link>
	<description>Programming for Mac and Web</description>
	<lastBuildDate>Thu, 17 Mar 2011 21:32:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>On feature-branches and pull-requests</title>
		<link>http://blog.milkfarmsoft.com/2011/03/on-feature-branches/</link>
		<comments>http://blog.milkfarmsoft.com/2011/03/on-feature-branches/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 13:22:18 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=183</guid>
		<description><![CDATA[Novice Git users don't know how to use Pull Requests on github optimally, and "naive" approach leads to complexities. There's better approach, and it's name is "Feature Branches". It's quite simple. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2011/03/on-feature-branches/">On feature-branches and pull-requests</a></span>]]></description>
			<content:encoded><![CDATA[<p>Everyone and their mother uses <a href="http://git-scm.com/" title="Git - Fast Version Control System">Git</a> + <a href="https://github.com/">GitHub</a> combo these days. A lot of open-source projects accept patches using github&#8217;s <a href="http://help.github.com/pull-requests/" title="Help.GitHub - Sending pull requests">pull requests</a>, because… well, because it is the easiest way to review and accept patches.</p>
<p><img src="http://blog.milkfarmsoft.com/wp-content/uploads/2011/03/Screen-shot-2011-03-17-at-16.19.51.png" alt="" title="commits" width="377" height="299" /></p>
<p>But, novice Git users don&#8217;t know how to do this optimally, and &#8220;naive&#8221; approach leads to complexities. Git is a distributed version control system, which means that everyone can &#8220;commit&#8221; to their copies of repositories. Syncing these commits with upstream is a bit more difficult and leads to commit-conflicts sometimes. So, here&#8217;s aforementioned &#8220;naive&#8221; approach:</p>
<ol style="padding-left: 30px">
<li>Fork upstream github repository</li>
<li>Clone forked repository to local machine</li>
<li>Make changes</li>
<li>Commit</li>
<li>Push</li>
<li>Send Pull Request</li>
</ol>
<p>It will work, but, there&#8217;s one non-obvious thing: pull request, probably, won&#8217;t be merged immediately and there are high chances, that there will be some commits commits pushed to official repository before our commit is merged. As the result, we have a conflict between upstream repository and our forked repository. So, at this point, if we plan to use our forked repository again, we have to &#8220;merge&#8221; upstream changes. It&#8217;s not end of the world, and git, if we&#8217;re lucky enough, will do this merge automatically as part of &#8220;<code>git pull upstream</code>&#8220;, but it won&#8217;t be &#8220;fast-forward&#8221; merge and github&#8217;s &#8220;<a href="https://github.com/blog/39-say-hello-to-the-network-graph-visualizer">Network</a>&#8221; diagram (or branches diagram in your favourite git GUI) won&#8217;t be nice and clean anymore.</p>
<p>There&#8217;s better approach, and it&#8217;s name is &#8220;<strong>Feature Branches</strong>&#8220;. It&#8217;s quite simple. Once you have cloned forked repository (i.e. after steps 1-2), use &#8220;<code>git checkout -b new_branch_name</code>&#8221; command (it&#8217;s nice, if &#8220;new_branch_name&#8221; summarises changes you&#8217;re going to implement). This command creates new branch, starting from current &#8220;master&#8221; and makes it active. Make changes and commit them: &#8220;master&#8221; branch is left intact and all the things you changed sit nicely in this new branch. Now, push these changes with &#8220;<code>git push origin new_branch_name</code>&#8221; command. This will send your new branch to github. Now, open this branch on github and send Pull Request from your &#8220;new_branch_name&#8221; to upstream&#8217;s &#8220;master&#8221;, as usually.</p>
<p>Use &#8220;<code>git checkout master</code>&#8221; to return to the &#8220;master&#8221; branch, and, whenever upstream merges your changes, and you pull those, they will appear here automatically, without a single &#8220;merge&#8221; effort from you. As a bonus, you get beautiful tree of branches without complex knots.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2011/03/on-feature-branches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>on PHP&#8217;s webserver</title>
		<link>http://blog.milkfarmsoft.com/2011/03/on-phps-webserver/</link>
		<comments>http://blog.milkfarmsoft.com/2011/03/on-phps-webserver/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 10:29:06 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[aip]]></category>
		<category><![CDATA[appserver]]></category>
		<category><![CDATA[http]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=179</guid>
		<description><![CDATA[There are a lot of talks today about "Built-in web server" [for PHP] RFC by Moriyoshi Koizumi. There is a nice discussion on Hacker News (and 2 threads on reddit: here and here). So, here's couple of cents from me. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2011/03/on-phps-webserver/">on PHP&#8217;s webserver</a></span>]]></description>
			<content:encoded><![CDATA[<p>There are a lot of talks today about <a href="http://wiki.php.net/rfc/builtinwebserver" title="PHP: rfc:builtinwebserver    [PHP Wiki]">&#8220;Built-in web server&#8221; [for PHP] RFC</a> by <a href="https://github.com/moriyoshi">Moriyoshi Koizumi</a>. There is a nice discussion on <a href="http://news.ycombinator.com/item?id=2281724" title="Hacker News | A Built-in Web Server For PHP">Hacker News</a> (and 2 threads on reddit: <a href="http://www.reddit.com/r/programming/comments/fw4dg/rfc_for_php_web_server_based_on_questionable/" title="RFC for PHP web server based on questionable premise that one would use PHP after having used Python/Rails : programming">here</a> and <a href="http://www.reddit.com/r/PHP/comments/fwf0p/built_in_web_server_for_php/" title="Built in web server for PHP : PHP">here</a>). So, here&#8217;s couple of cents from me.</p>
<p><strong>1.</strong> That is a great addition to the standard PHP tool-set. I remember days, when I had to configure web-servers to run my web-projects and it was ridiculously distracting. It&#8217;s not &#8220;rocket science&#8221;, but still complicates matters a lot. Finally, developers would be able to forget about these monstrous WAMP/XAMPP/whatever packages and just run their applications using &#8220;php -S localhost:8080&#8243;.</p>
<p><strong>2.</strong> Dear developers, please, do not expect this to handle production load. This web-server is solely for localhost developer needs. It is a single-process, single-threaded, blocking http-server.</p>
<p><strong>3.</strong> If you&#8217;re looking for the solution, which is similar <a href="http://rack.rubyforge.org/" title="Rack: a Ruby Webserver Interface">Ruby&#8217;s Rack</a> or <a href="http://www.wsgi.org/wsgi/" title="WsgiStart - WSGI Wiki">Python&#8217;s WSGI</a> this is not it. But <a href="https://github.com/indeyets/appserver-in-php">AiP</a> (formerly &#8220;<a href="http://blog.milkfarmsoft.com/2007/06/application-server-in-php-well%E2%80%A6-yes/" title="Application Server in PHP? well… Yes! &laquo; Alexey Zakhlestins blog">AppServer in PHP</a>&#8220;) is: it lets your application pre-initialize classes (and keep them in memory between requests), pre-open database connections, pre-warm caches, etc. and serve application with a fast multi-processed server (you can choose from HTTP, SCGI and ØMQ/Mongrel2 protocols). And it is still as easy to start bundled http-server: &#8220;aip app path/to/application&#8221;</p>
<p>Various versions of AiP are used in production on several large projects and show nice results (it is stable and really fast). And we&#8217;re planning to release next major version really soon now. If that sounds interesting, join our <a href="http://groups.google.com/group/aip-php-dev" title="AiP development |<br />
  Google Groups">discussion group</a> and watch the <a href="https://github.com/indeyets/appserver-in-php">project on github</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2011/03/on-phps-webserver/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>GObject for PHP (new bindings project)</title>
		<link>http://blog.milkfarmsoft.com/2011/02/gobject-for-php-new-bindings-project/</link>
		<comments>http://blog.milkfarmsoft.com/2011/02/gobject-for-php-new-bindings-project/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 19:37:33 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[gobject]]></category>
		<category><![CDATA[introspection]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=174</guid>
		<description><![CDATA[It's been in the news, that PHP-GTK "…is being split up into different projects, PECL/Cairo, GLib, GObject, etc…", but there were not many details on these changes. I was working on "GObject" part from the list. Our idea is to get rid of legacy code, target php 5.3+ and build highly modular system, which would be easy to extend and maintain. This new PHP extension is called "GObject for PHP", so, my main concern, obviously is building comfortable bridge between GObject objects and PHP's objects. It starts to work, but there's a lot of stuff to be done. Please join the project. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2011/02/gobject-for-php-new-bindings-project/">GObject for PHP (new bindings project)</a></span>]]></description>
			<content:encoded><![CDATA[<p>Today, my brain refused to recall details of mercurial commands and I moved <a href="https://github.com/indeyets/gobject-for-php">GObject for PHP</a> project to github.</p>
<p>I didn&#8217;t mention this project on blog, but that is only because I wasn&#8217;t blogging much lately. <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It&#8217;s been in the news, that PHP-GTK &#8220;<a href="http://gtk.php.net/" title="PHP-GTK">is being split up into different projects, PECL/Cairo, GLib, GObject, etc</a>&#8220;, but there were not many details on these changes. It&#8217;s time to fill the gap.</p>
<p>I was working on &#8220;GObject&#8221; part from the list. Our idea is to get rid of legacy code, target php 5.3+ and build highly modular system, which would be easy to extend and maintain.</p>
<p>This new PHP extension is called &#8220;GObject for PHP&#8221;, so, my main concern, obviously is building comfortable bridge between GObject objects and PHP&#8217;s objects. It starts to work, but there&#8217;s a lot of stuff to be done. Please <strong>join the project</strong>, if you are interested. We need more hands! <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Anyway, here&#8217;s what is done:</p>
<h3>&#8220;master&#8221; branch</h3>
<p>I started my implementation with &#8220;master&#8221; branch. I see it as a common ground for various specific php extensions wrapping gobject libraries. For example, <a href="http://mahcuz.com/" title="m a h c u z . c o m">Mark Skilbeck</a> implemented <a href="http://bitbucket.org/mahcuz/notify/overview" title="mahcuz / Notify / overview &mdash; Bitbucket">libnotify binding</a> this way. Eventually, new generation of GTK+ bindings could be implemented in similar fashion.</p>
<p>At the moment I have PHP counterparts of the following parts of GObject world:</p>
<ul>
<li>GType — implemented as <strong>GObject\Type</strong>. This is the scaffolding, which is used for creating new classes in runtime.</li>
<li>GParamSpec — implemented as <strong>GObject\ParamSpec</strong>. These describe properties and are assigned to GObject\Type.</li>
<li>GObject — implemented as <strong>GObject\Object</strong>. Base class for all specific classes in GObject hierarchy.</li>
<li>GSignal — implemented as <strong>GObject\Signal</strong>. Signal&#8217;s are definitions of event slots. Whenever you define new GObject class (using GType) you can specify which event slots it will have, how those events should be handled and, after that, during runtime, trigger events.</li>
</ul>
<p>So, it&#8217;s easy. Define classes, properties, signal slots. Create objects, set properties, emit signals. GObject-for-php takes care of event marshalling, conversion of parameters, etc.</p>
<h3>&#8220;introspection&#8221; branch</h3>
<p>After the code above started to work, I branched the code to give another concept a try. These days, a lot of effort in GNOME community goes into <a href="http://live.gnome.org/GObjectIntrospection" title="GObjectIntrospection - GNOME Live!">GObject Introspection</a> project. They idea is, that bindings developers spend too much time by manually tweaking bindings to every change in C libraries. That&#8217;s what PHP-GTK team had to do, for example.</p>
<p>Here&#8217;s quotation from project&#8217;s web site:</p>
<blockquote><p>The introspection project solves this by putting all of the metadata inside the GObject library itself, using annotations in the comments. This will lead to less duplicate work from binding authors, and a more reliable experience for binding consumers. Additionally, because the introspection build process will occur inside the GObject libraries themselves, a goal is to encourage GObject authors to consider shaping their APIs to be more binding friendly from the start, rather than as an afterthought.</p></blockquote>
<p>So, &#8220;introspection&#8221; branch aims to provide bindings for GObject Introspection infrastructure. The main entry point is <strong>GIRepository\load_ns</strong>(&#8216;Namespace&#8217;) function, which creates php-counterparts of all classes, functions, constants of corresponding GObject namespace dynamically. At least, it will do that one day. With your help <img src='http://blog.milkfarmsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2011/02/gobject-for-php-new-bindings-project/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pake 1.4.0 is released</title>
		<link>http://blog.milkfarmsoft.com/2010/03/pake-1-4-0-is-released/</link>
		<comments>http://blog.milkfarmsoft.com/2010/03/pake-1-4-0-is-released/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 08:16:18 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[pake]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=156</guid>
		<description><![CDATA[<p>I just released new version of Pake.</p> <p></p> <p>Pake is a command line utility for executing predefined tasks, inspired by make. It is written in PHP and the tasks are also described in PHP. Pake can be used for compiling projects from different pieces, generating code, preprocessing templates and deploying projects.</p> <p>If you know Phing, <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2010/03/pake-1-4-0-is-released/">Pake 1.4.0 is released</a></span>]]></description>
			<content:encoded><![CDATA[<p>I just released new version of <a href="http://wiki.github.com/indeyets/pake/">Pake</a>.</p>
<p></p>
<p>Pake is a command line utility for executing predefined tasks, inspired by make. It is written in PHP and the tasks are also described in PHP. Pake can be used for compiling projects from different pieces, generating code, preprocessing templates and deploying projects.</p>
<p>If you know Phing, then Pake is a similar thing, but doesn&#8217;t use XML, is easier to use and faster.</p>
<p></p>
<p>Here&#8217;s the brief Changelog:</p>
<ul>
<li>added &#8220;interactive mode&#8221; (pake -i)</li>
<li>new helper: pakeMercurial (in addition to pakeSubversion and pakeGit we already had)</li>
<li>updated sfYaml library</li>
<li>use copy+unlink instead of rename in pake_rename() to workaround problem of moving files between volumes</li>
<li>&#8220;pake compact&#8221; (developers-only) command works again</li>
<li>added explicit pakePearTask::package_pear_package($file, $target) method</li>
<li>fixed output-formatting (long texts in exceptions, etc.)</li>
<li>various packaging fixes</li>
</ul>
<p>All Pake 1.x versions are compatible with php-5.2. Earlier versions might work, but those are not tested.</p>
<p>If you need automation tool for your project, then Pake might be exactly what you need.</p>
<p></p>
<p>Useful links:</p>
<ul>
<li><a href="http://wiki.github.com/indeyets/pake/" title="Pake">Pake&#8217;s homepage</a> (including documentation)</li>
<li><a href="http://wiki.github.com/indeyets/pake/installing-pake" title="Installing Pake">Installation instructions</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2010/03/pake-1-4-0-is-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ode to mb_ereg functions</title>
		<link>http://blog.milkfarmsoft.com/2009/11/ode-to-mb_ereg-functions/</link>
		<comments>http://blog.milkfarmsoft.com/2009/11/ode-to-mb_ereg-functions/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 00:28:20 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=151</guid>
		<description><![CDATA[There is a common misunderstanding, that mb_ereg_* functions are just unicode counterparts of ereg_* functions: slow and non-powerful. That's as far from truth as it can be. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2009/11/ode-to-mb_ereg-functions/">ode to mb_ereg functions</a></span>]]></description>
			<content:encoded><![CDATA[<p>PHP has some sets of functions, which are not known to the wide audience. One of those is mb_ereg_* family of functions.</p>
<p>There is a common misunderstanding, that mb_ereg_* functions are just unicode counterparts of ereg_* functions: slow and non-powerful. That&#8217;s as far from truth as it can be.</p>
<p>mb_ereg_* functions are based on <a href="http://www.geocities.jp/kosako3/oniguruma/" title="Oniguruma">oniguruma</a> regular expressions library. And oniguruma is one of the fastest and most capable regular expression libraries out there. Couple of years ago I made <a href="http://blog.milkfarmsoft.com/2006/12/regexps-in-php-again/" title="Alexey Zakhlestins blog  &raquo; regexps in PHP, again">a little speed-test</a>.</p>
<p>Anyway, this time, I was going to tell about it&#8217;s usage. PHP-documentation isn&#8217;t telling much.</p>
<p>Let&#8217;s start with the basic fact: you don&#8217;t need to put additional delimeters around your regular exprsssions, when you use mb_ereg_* funcitons. For example:</p>
<pre>// find first substring consisting of letters from 'a' to 'c' in 'abcdabc' string.
<a href="http://docs.php.net/mb_ereg" title="PHP: mb_ereg - Manual">mb_ereg</a>('[a-c]+', 'abcdabc', $res);</pre>
<p>To execute same search, but in case-insensitive fashion, you should use <a href="http://docs.php.net/mb_eregi" title="PHP: mb_eregi - Manual">mb_eregi</a>()</p>
<p>mb_ereg(), mb_eregi() and mb_split() functions use pre-set options in their work. You can check current options and set the new ones using <a href="http://docs.php.net/mb_regex_set_options" title="PHP: mb_regex_set_options - Manual">mb_regex_set_options</a>() function. This function is parametrized by string, each letter of which means something.</p>
<p>There are parameters (you can specify several of these at the same time):</p>
<ul>
<li>&#8216;i&#8217;: ONIG_OPTION_IGNORECASE;</li>
<li>&#8216;x&#8217;: ONIG_OPTION_EXTEND;</li>
<li>&#8216;m&#8217;: ONIG_OPTION_MULTILINE;</li>
<li>&#8216;s&#8217;: ONIG_OPTION_SINGLELINE;</li>
<li>&#8216;p&#8217;: ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE;</li>
<li>&#8216;l&#8217;: ONIG_OPTION_FIND_LONGEST;</li>
<li>&#8216;n&#8217;: ONIG_OPTION_FIND_NOT_EMPTY;</li>
<li>&#8216;e&#8217;: eval() resulting code</li>
</ul>
<p>And there are &#8220;modes&#8221; (if you specify several of these, the LAST one will be used):</p>
<ul>
<li>&#8216;j&#8217;: ONIG_SYNTAX_JAVA;</li>
<li>&#8216;u&#8217;: ONIG_SYNTAX_GNU_REGEX;</li>
<li>&#8216;g&#8217;: ONIG_SYNTAX_GREP;</li>
<li>&#8216;c&#8217;: ONIG_SYNTAX_EMACS;</li>
<li>&#8216;r&#8217;: ONIG_SYNTAX_RUBY;</li>
<li>&#8216;z&#8217;: ONIG_SYNTAX_PERL;</li>
<li>&#8216;b&#8217;: ONIG_SYNTAX_POSIX_BASIC;</li>
<li>&#8216;d&#8217;: ONIG_SYNTAX_POSIX_EXTENDED;</li>
</ul>
<p>Descriptions of these constants are available in this document: <a href="http://www.geocities.jp/kosako3/oniguruma/doc/API.txt">API.txt</a></p>
<p>So, for example, mb_regex_set_options(&#8216;pr&#8217;) is equivalent to mb_regex_set_options(&#8216;msr&#8217;) and means:</p>
<ul>
<li>. should include \n (aka &#8220;multiline-match&#8221;)</li>
<li>^ is equivalent to \A, $ is equivalent to \Z (aka &#8220;strings are single-lined&#8221;)</li>
<li>using RUBY-mode</li>
</ul>
<p>By the way, that is the default setting for mb_ereg_* functions. And, mb_ereg_match and mb_ereg_search families of functions take options-parameter explicitly.</p>
<p>So, back to functions:</p>
<pre>// make sure, that the whole string matches the regexp:
<a href="http://docs.php.net/mb_ereg_match" title="PHP: mb_ereg_match - Manual">mb_ereg_match</a>('[a-c]+', $user_string, 'pz'); // 'pz' specifies options for this operation
                                             // (multiline perl-mode in this case)

// replace any of letters from 'a' to 'c' range with 'Z'
$output = <a href="http://docs.php.net/mb_ereg_replace" title="PHP: mb_ereg_replace - Manual">mb_ereg_replace</a>('[a-c]', 'Z', $user_string, 'b'); // use basic POSIX mode</pre>
<p>Ok, these were easy and similar to what you&#8217;ve seen in preg_* functions. Now, to something more powerful. The real strength lies in mb_ereg_search_* functions. The idea is, that you can let oniguruma preparse and cache text and/or regexp in its internal buffers. If you do, matching will work a lot faster.</p>
<pre><a href="http://docs.php.net/mb_ereg_search_init" title="PHP: mb_ereg_search_init - Manual">mb_ereg_search_init</a>($some_long_text); // preparse text
<a href="http://docs.php.net/mb_ereg_search" title="PHP: mb_ereg_search - Manual">mb_ereg_search</a>('[a-c]'); // execute search
while ($r = <a href="http://docs.php.net/mb_ereg_search_getregs" title="PHP: mb_ereg_search_getregs - Manual">mb_ereg_search_getregs</a>()) { // get next result
    // work with matched result
}

mb_ereg_search('[d-e]'); // execute different search on the same text

mb_ereg_search_init($some_other_text); // preparse another text
mb_ereg_search(); // execute search using previous (already preparsed) regexp</pre>
<p>This is the fastest way of parsing large documents in php, as far as I know.</p>
<p>Notes on charsets. Though, it is often mentioned, that mb_ereg_* functions are &#8220;unicode&#8221;, it would be more practical to say, that they are encoding-aware. It is a good idea to specify, which encoding you use beore calling oniguruma.</p>
<p>Some options:</p>
<pre><a href="http://docs.php.net/mb_regex_encoding" title="PHP: mb_regex_encoding - Manual">mb_regex_encoding</a>('UTF-8');
mb_regex_encoding('CP1251'); // windows cyrillic encoding
mb_regex_encoding('Shift_JIS'); // japanese</pre>
<p>Check the <a href="http://docs.php.net/manual/en/mbstring.encodings.php" title="PHP: Summaries of supported encodings - Manual">full list of supported encodings</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2009/11/ode-to-mb_ereg-functions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>XSLCache in PECL</title>
		<link>http://blog.milkfarmsoft.com/2009/08/xslcache-in-pecl/</link>
		<comments>http://blog.milkfarmsoft.com/2009/08/xslcache-in-pecl/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:50:42 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=136</guid>
		<description><![CDATA[<p>XSLCache extension for PHP, originally developed by NYTimes started its second life in PECL&#8217;s repository and I am proud to announce first PECL-release.</p> <p>The XSL Cache extension is a modification of PHP&#8217;s standard XSL extension that caches the parsed XSL stylesheet representation between sessions for 2.5x boost in performance for sites that repeatedly apply the <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2009/08/xslcache-in-pecl/">XSLCache in PECL</a></span>]]></description>
			<content:encoded><![CDATA[<p>XSLCache extension for PHP, originally developed by NYTimes started its second life in PECL&#8217;s repository and I am proud to announce <a href="http://pecl.php.net/package/xslcache">first PECL-release</a>.</p>
<p>The XSL Cache extension is a modification of PHP&#8217;s standard XSL extension that caches the parsed XSL stylesheet representation between sessions for 2.5x boost in performance for sites that repeatedly apply the same transform. API-wise it is compatible with usual <a href="http://docs.php.net/manual/en/book.xsl.php">XSL extension</a> with two small exceptions:</p>
<ol>
<li>instead of XSLTProcessor class you should use <strong>XSLTCache</strong> class.</li>
<li>importStyleshet method has another &#8220;signature&#8221;: <strong>void importStylesheet(string $path, bool $cachesheet=true);</strong></li>
</ol>
<p>Installation, from now on, should be as simple as &#8220;<strong>pecl install xslcache</strong>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2009/08/xslcache-in-pecl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pake: PHP project build system</title>
		<link>http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/</link>
		<comments>http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 14:03:33 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=127</guid>
		<description><![CDATA[Pake project wasn't maintained for a while, so I decided to give it a spin (as there is a good chance, that I will be able to use it for my current projects). I imported it's version history to GitHub. My plan is to add some generally usable helpers to current branch, write some documentation and then to start work on Pake2 which would use all new features of PHP-5.3 (namespaces, closures, rich SPL). <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/">Pake: PHP project build system</a></span>]]></description>
			<content:encoded><![CDATA[<p>Sometimes, there are pieces of software, which are unfairly forgotten. Let&#8217;s talk about one these.</p>
<p>Often, while working on software projects, one finds, that there are repetitive tasks, which would be much easier to deal with, if automated. In the C/Unix world, this task is often solved by <a href="http://en.wikipedia.org/wiki/Make_(software)">Make</a>, Java programmers prefer <a href="http://en.wikipedia.org/wiki/Ant_(software)">Apache Ant</a>, Ruby programmers use <a href="http://en.wikipedia.org/wiki/Rake_(software)">Rake</a>. The fact, which is not commonly known, is, that PHP also has such instrument, and it is called <strong>Pake</strong>. It was originally created by authors of <a href="http://www.symfony-project.org/">Symfony framework</a>. Unfortunately, they never wrote any documentation, which killed adoption rates.</p>
<p>To start automating something, you need to create Pakefile.php in the root-directory of your project, define some tasks inside and run them with &#8220;pake taskname&#8221; from command-line. The good news is, that tasks are defined in PHP language and syntax is quite simple:</p>
<div class="php" style="font-family: monospace; color: #000000;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></p>
<p>pake_desc<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;FOO task&#8217;</span><span style="color: #66cc66;">&#41;</span>;<br />pake_task<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;foo&#8217;</span>, <span style="color: #ff0000;">&#8216;bar&#8217;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>pake_desc<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;BAR task&#8217;</span><span style="color: #66cc66;">&#41;</span>;<br />pake_task<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;bar&#8217;</span>, <span style="color: #ff0000;">&#8216;baz&#8217;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>pake_desc<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;BAZ task&#8217;</span><span style="color: #66cc66;">&#41;</span>;<br />pake_task<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;baz&#8217;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>pake_alias<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;default&#8217;</span>, <span style="color: #ff0000;">&#8216;foo&#8217;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// marking foo as default task</span></p>
<p><span style="color: #000000; font-weight: bold;">function</span> run_foo<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$task</span>, <span style="color: #0000ff;">$args</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <a style="text-decoration: none;" href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;foo<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;<br /><span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #000000; font-weight: bold;">function</span> run_bar<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$task</span>, <span style="color: #0000ff;">$args</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <a style="text-decoration: none;" href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;bar<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;<br /><span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #000000; font-weight: bold;">function</span> run_baz<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$task</span>, <span style="color: #0000ff;">$args</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <a style="text-decoration: none;" href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;baz<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;<br /><span style="color: #66cc66;">&#125;</span></div>
<p>I defined 3 rules, gave them descriptions and specified dependencies. Additionally, I specifed default rule. Now, we can play with this a bit. Create file with this contents, save it somewhere, and point your terminal to the same directory.</p>
<p><code><br />
> pake<br />
baz<br />
bar<br />
foo<br />
</code></p>
<p>What happened? Pake looks for &#8220;default&#8221; task in the pakefile. We defined &#8220;foo&#8221; as default. Pake found out, that foo depends on bar, and bar depends on baz. So, Pake runs &#8220;baz&#8221;, then &#8220;bar&#8221; and then, finally, &#8220;foo&#8221;. That is as simple as it can be.</p>
<p>Pake has builtin support for basic file-operations (pake_mkdirs(), pake_copy(), pake_rename(), pake_remove()), which are the powered-up versions of php&#8217;s filesystem-functions, templating (pake_replace_tokens()), directory-mirroring (pake_mirror()) and runners for creating PEAR-packages, <a href="http://phing.info/trac/">Phing</a>-commands and <a href="http://www.simpletest.org/">Simpletest</a>.</p>
<p>Pake project wasn&#8217;t maintained for a while, so I decided to give it a spin (as there is a good chance, that I will be able to use it for my current projects). I imported it&#8217;s version history to GitHub. You can find latest version here: <a href="http://github.com/indeyets/pake">http://github.com/indeyets/pake</a></p>
<p>My plan is to add some generally usable helpers to current branch, write some documentation and then to start work on Pake2 which would use all new features of PHP-5.3 (namespaces, closures, rich SPL).</p>
<p>Git-project is a source for creating pear-package. To build one use the following command:</p>
<p><code><br />
> php bin/pake.php release 1.1.0a1<br />
</code></p>
<p>it will create &#8220;pake-1.1.0a1.tgz&#8221; file in the same directory. You can install it with the following command:</p>
<p><code><br />
> pear install -f pake-1.1.0a1.tgz<br />
</code></p>
<p>If you want to grab a prebuild pear-package of pake, you can do it <a href="http://github.com/indeyets/pake/downloads">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>work with TwitterData in PHP</title>
		<link>http://blog.milkfarmsoft.com/2009/08/work-with-twitterdata-in-php/</link>
		<comments>http://blog.milkfarmsoft.com/2009/08/work-with-twitterdata-in-php/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 19:36:35 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=106</guid>
		<description><![CDATA[I recently created a small library for working with twitterdata in PHP. Sources are available from GitHub. Twitter Data is a simple, open, semi-structured format for embedding machine-readable, yet human-friendly, data in Twitter messages. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2009/08/work-with-twitterdata-in-php/">work with TwitterData in PHP</a></span>]]></description>
			<content:encoded><![CDATA[<p>I recently created a small library for working with <a href="http://twitterdata.org/" target="_blank">twitterdata</a> in PHP. Sources are available from GitHub: <a href="http://github.com/indeyets/php-twitterdata/tree/master">php-twitterdata</a></p>
<p>Here&#8217;s the description from Twitter Data site:</p>
<blockquote><p>
Twitter Data is a simple, open, semi-structured format for embedding machine-readable, yet human-friendly, data in <a href="http://twitter.com/">Twitter</a> messages. This data can then be transmitted, received, and interpreted in real time by powerful new kinds of applications built on the Twitter platform. Here is an example Twitter Data message:</p>
<p><code>I love the #twitterdata proposal! $vote +1</code></p>
<p>The part with the dollar sign, $vote +1, is a piece of data embedded using the Twitter Data format.
</p></blockquote>
<p>To use php-twitterdata library, <a href="http://github.com/indeyets/php-twitterdata/downloads">download</a> it into the sub-direcory in your project&#8217;s directory (or any other place you like) and init the autoloader:</p>
<div class="php" style="font-family: monospace; color: #000000;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br /><span style="color: #2500B9; font-weight: bold;">require</span> <span style="color: #ff0000;">&#8216;php-twitterdata/autoload.php&#8217;</span>;<br /><span style="color: #000000; font-weight: bold;">?&gt;</span></div>
<p>PHP API provided by php-twitterdata has 2 layers. On lower level, there are 3 classes: <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData_Message.php#L12" target="_blank">TwitterData_Message</a>, <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData_Frame.php#L12" target="_blank">TwitterData_Frame</a> and <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData_Tuple.php#L12" target="_blank">TwitterData_Tuple</a> which correspond to parts of data-enabled twitter-message. Message can consist of several Frames, Frame can consist of several Tuples and a &#8220;subject&#8221;. Objects of each of these classes can be created programmatically and combined in hierarchy. Each of them has &#8220;magic&#8221; <a href="http://docs.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring" target="_blank">__toString()</a> method, so, to export them as a valid twitter-message, you just need to put objects in string context. Something like this:</p>
<div class="php" style="font-family: monospace; color: #000000;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br /><span style="color: #0000ff;">$tuple</span> = <span style="color: #000000; font-weight: bold;">new</span> TwitterData_Tuple<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;foo&#8217;</span>, <span style="color: #ff0000;">&#8216;bar&#8217;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #0000ff;">$frame</span> = <span style="color: #000000; font-weight: bold;">new</span> TwitterData_Frame<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;Hello, world!&#8217;</span>, <a style="text-decoration: none;" href="http://docs.php.net/array" target="_blank"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$tuple</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br /><a style="text-decoration: none;" href="http://docs.php.net/echo" target="_blank"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$frame</span>;<br /><span style="color: #000000; font-weight: bold;">?&gt;</span></div>
<p>and the result will be:<br />
<code><br />
Hello, world! $foo bar<br />
</code></p>
<p>If you need to parse Twitter Data messages you should use <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData_Parser.php#L29" target="_blank">TwitterData_Parser</a> class. It is a SAX-style parser, with DOM-style export. If all you need is a hierarchy of objects, use it like this:</p>
<div class="php" style="font-family: monospace; color: #000000;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br /><span style="color: #0000ff;">$parser</span> = <span style="color: #000000; font-weight: bold;">new</span> TwitterData_Parser<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$text_from_twitter</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #0000ff;">$message</span> = <span style="color: #0000ff;">$parser</span>-&gt;<span style="color: #006600;">export</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// $message is object of TwitterData_Message class</span><br /><span style="color: #000000; font-weight: bold;">?&gt;</span></div>
<p>Otherwise, you can specify another handler-class as a second parameter of constructor. Such class has to implement <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData_Parser.php#L12" target="_blank">TwitterData_Parser_CallbackInterface</a>.</p>
<p>Does it all sound too complex? No problem!</p>
<p>php-twitterdata library also includes high-level interface, which consists of 2 simple functions: <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData.php#L14" target="_blank">TwitterData::array_to_TwitterData()</a> and <a href="http://github.com/indeyets/php-twitterdata/blob/e59c94763f60deb9701a380101047d9cb6586245/TwitterData.php#L19" target="_blank">TwitterData::TwitterData_to_array()</a>. First one converts associative array into the string, which can be inserted into twitter-message, and second one takes message-string received from twitter and returns associative array parsed out of tuples from the first frame of message (If you need to get all possible data from message, you will still need to use low-level API).</p>
<p>Example of high-level API:</p>
<div class="php" style="font-family: monospace; color: #000000;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />TwitterData::<span style="color: #006600;">TwitterData_to_array</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;Hello, world! $foo bar&#8217;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #808080; font-style: italic;">// array(&#8216;foo&#8217; =&gt; &#8216;bar&#8217;);</span></p>
<p><span style="color: #0000ff;">$message</span> = <span style="color: #ff0000;">&#8216;Hello, world! &#8216;</span>.TwitterData::<span style="color: #006600;">array_to_TwitterData</span><span style="color: #66cc66;">&#40;</span><a style="text-decoration: none;" href="http://docs.php.net/array" target="_blank"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;foo&#8217;</span> =&gt; <span style="color: #ff0000;">&#8216;bar&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #808080; font-style: italic;">// Hello, world! $foo bar</span><br /><span style="color: #000000; font-weight: bold;">?&gt;</span></div>
<p>Library has <a href="http://github.com/indeyets/php-twitterdata/tree/e5f7ae14a65ed00368e23750de1addaac20f5684/tests" target="_blank">unit-tests</a>, which cover all examples provided on Twitter Data site both on <a href="http://twitterdata.org/" target="_blank">Introduction</a> page and on <a href="http://twitterdata.org/examples/" target="_blank">Examples</a> page and is licensed under <a href="http://github.com/indeyets/php-twitterdata/blob/e5f7ae14a65ed00368e23750de1addaac20f5684/LICENSE#L1" target="_blank">MIT-style license</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2009/08/work-with-twitterdata-in-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Move to GitHub</title>
		<link>http://blog.milkfarmsoft.com/2009/08/move-to-github/</link>
		<comments>http://blog.milkfarmsoft.com/2009/08/move-to-github/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 18:05:16 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql query builder]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=101</guid>
		<description><![CDATA[<p>Just notifying all interested parties, that my &#8220;Application Server in PHP&#8221; and &#8220;MySQL Query Builder&#8221; projects are moved to GitHub.</p> <p>Their new homes are:</p> Application Server in PHP MySQL Query Builder <p>p.s. newest release of MySQL Query Builder has support for subqueries in IN(…) statements</p> ]]></description>
			<content:encoded><![CDATA[<p>Just notifying all interested parties, that my &#8220;<a href="http://blog.milkfarmsoft.com/?p=51">Application Server in PHP</a>&#8221; and &#8220;<a href="http://blog.milkfarmsoft.com/?p=55">MySQL Query Builder</a>&#8221; projects are moved to GitHub.</p>
<p>Their new homes are:</p>
<ul>
<li><a href="http://github.com/indeyets/appserver-in-php/tree/master">Application Server in PHP</a></li>
<li><a href="http://github.com/indeyets/MySQL-Query-Builder/tree/master">MySQL Query Builder</a></li>
</ul>
<p>p.s. newest <a href="http://github.com/indeyets/MySQL-Query-Builder/downloads">release of MySQL Query Builder </a>has support for subqueries in <strong>IN(…)</strong> statements</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2009/08/move-to-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-FPM is BSD-licensed now</title>
		<link>http://blog.milkfarmsoft.com/2009/06/php-fpm-is-bsd-licensed-now/</link>
		<comments>http://blog.milkfarmsoft.com/2009/06/php-fpm-is-bsd-licensed-now/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 06:25:16 +0000</pubDate>
		<dc:creator>indeyets</dc:creator>
				<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.milkfarmsoft.com/?p=88</guid>
		<description><![CDATA[It took several years of waiting, but, it finally happened. PHP-FPM project is officially BSD-licensed now and has good chances to become a part of official PHP distribution. <span style="color:#777"> . . . &#8594; Read More: <a href="http://blog.milkfarmsoft.com/2009/06/php-fpm-is-bsd-licensed-now/">PHP-FPM is BSD-licensed now</a></span>]]></description>
			<content:encoded><![CDATA[<p>Some seriously good news here. It took several years of waiting, but, it finally happened. <a href="http://php-fpm.anight.org/" title="php-fpm: PHP FastCGI Process Manager">PHP-FPM</a> project is <a href="http://groups.google.com/group/highload-php-en/browse_thread/thread/974eaff4ad094391">officially BSD-licensed</a> now, which means, that it has good chances to become a part of official PHP distribution.</p>
<p>PHP-FPM is &#8220;deciphered&#8221; as &#8220;PHP FastCGI Process Manager&#8221; and is a patch for php to greatly improve FastCGI SAPI usage in production. It adds a bunch of additional features to php&#8217;s fastcgi such as: easy php-process daemonization (with ability to specify uid/gid/chroot/log-file), safe php-processes restart (without losing requests), custom error-handling and accelerated file-upload support (requires additional support from web-server).</p>
<p>There&#8217;s not much documentation in english, currently, but, again, there is a good chance that it will be added really soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.milkfarmsoft.com/2009/06/php-fpm-is-bsd-licensed-now/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

