PHP Suit - How To... Tips, tricks, techniques and tutorials... en Blog: Self-extracting archives in PHP <p>How to create a self-extracting PHP script?</p> <p><cite>The __halt_compiler(); function in php enables to store some additional data in a php-file without blowing up the memory. A very nice possibility is to use this for a self-extracting php file as installation-packages of your php application.</cite></p> <p><a href="">Cookie Pattern: Self-extracting PHP archive</a></p> Archive How To... idea scripts TAR Sun, 01 Mar 2009 09:32:36 +0000 admin 51 at Paypal Direct Payment Component Using cURL <p>Another PayPal component for your pages.</p> <p><cite>Looking for a lightweight, easy to use, Paypal credit card processing script? You have found it! This is for Cake 1.2. All you need is cURL and a Paypal API account! Pre-requisites: cURL and Paypal Account with API keys and such</cite></p> <p><a href="">Paypal Direct Payment Component Using cURL</a>.</p> <p>See also <a href="">my PayPal implementation</a>.</p> Blog How To... PayPal Useful scripts Tue, 17 Feb 2009 09:23:51 +0000 admin 50 at Creating system daemon in PHP <p>Kevin van Zonneveld shows how to create daemons (services) in PHP.</p> <p><cite>A daemon is a Linux program that run in the background, just like a 'Service' on Windows. It can perform all sorts of tasks that do not require direct user input. Apache is a daemon, so is MySQL. All you ever hear from them is found in somewhere in /var/log, yet they silently power over 40% of the Internet.</cite></p> <p><cite>Everyone knows PHP can be used to create websites. But it can also be used to create desktop applications and commandline tools. And now with a class called System_Daemon, you can even create daemons using nothing but PHP.<cite></cite></cite></p> <p><a href="">Create daemons in PHP</a></p> Blog Daemon How To... System Fri, 16 Jan 2009 10:23:59 +0000 admin 49 at BlogAPI Drupal filter <p>Using blog clients such as <a href="">BlogJet</a> or Windows Live Writer with Drupal can produce some unwanted things, such as ignoring the perex/article break or curious formatting. There is very simple module to solve.</p> <p>Someone says at <a href="">Drupal pages</a>:<br /> <cite>(&hellip;) WLW's "split post" feature, which is available when using the Movable Type API but not with the Metaweblog API, does not produce the &lt;!--break--&gt; tags that Drupal expects. Instead it produces &lt;!--pagebreak--&gt; sometimes and &lt;!--extended--&gt; other times, despite the fact that before posting, the HTML source within WLW shows &lt;!--more--&gt;. Supporting all of these possible page-breaking tags in Drupal would require hacking the core.</cite><br /> <a href="">BlogApi: post from blog tools |</a><br /> I&rsquo;ve extended the module from this discussion and rewrite it for Drupal 5 too. Updated module can convert P and BR tags to NL.<br /> You can download it here:</p> <div class="tablewrapper"><table class="webfm-attach-list" class="tableclass"> <thead><tr><th>Attachment</th><th>Date</th><th>Size</th> </tr></thead> <tbody> <tr class="odd"><td class="att-title"><a href="/webfm_send/8/1" title="Download" target="_blank"><img src="" alt="[file]" title="Download"/> </a><a href="/webfm_send/8" title="Open" target="_blank"></a></td><td class="att-time">14/12/08 9:20 am</td><td class="att-size">884 bytes</td> </tr> <tr class="even"><td class="att-title"><a href="/webfm_send/9/1" title="Download" target="_blank"><img src="" alt="[file]" title="Download"/> </a><a href="/webfm_send/9" title="Open" target="_blank"></a></td><td class="att-time">14/12/08 9:18 am</td><td class="att-size">892 bytes</td> </tr> </tbody></table> </div> Blog BlogJet Drupal How To... Useful scripts Sun, 14 Dec 2008 16:18:03 +0000 admin 45 at Joining .WAVs with PHP <p>Join WAVs into one file.</p> <p><cite><br /> I'm currently working on a <a class="interwiki iw_doku" title="" href="">CAPTCHA plugin</a> for <a class="wikilink1" title="dokuwiki" href="">DokuWiki</a> and thought about providing audio output for users not able to see the image. This is pretty simple for CAPTCHAs &ndash; there is no need for complicated speech synthesis because you only need recordings of the 26 possible letters. But you need a way of joining those recordings on the fly&hellip; </cite></p> <p>I looked around the web for a way to concatenate multiple wave files with PHP and found an article by Phillip Perkins called <a class="urlextern" title="" href="">Create an audio stitching tool in PHP</a>. But at a closer look his example code was overly complicated for my simple task.<br /> </p> <p><a href="">Joining .WAVs with PHP </a></p> Blog How To... Sat, 13 Dec 2008 01:36:25 +0000 admin 44 at Blog: Tips and tricks from other pages VII <p>PHP under control, LINQ and cURL examples...</p> <p><cite>phpUnderControl is an addon application for the continuous integration tool CruiseControl, which integrates some of the best PHP development tools. This project aims to make your first steps with CruiseControl and PHP as easy as possible. Therefore phpUnderControl comes with a command line tool that performs all modifications to an existing CruiseControl installation.</cite></p> <p><a href="">phpUnderControl</a></p> <p><cite>A set of PHP classes mimicing C#3.0's LINQ (Language Integrated Query) extension methods. </cite></p> <p><a href="">PHPLinq</a></p> <p>(Con: <cite>I read about the PHP Implementation of LINQ called PHPLinq. Frankly, I was sceptical about it. Finally, I gave it a try. I still remain sceptical... </cite> - <a href="">Is PHPLinq As Cool As Real LINQ?</a>)</p> <p><cite>We try to collect examples on how to program the PHP/CURL interface here. If you have any source snippests you want to share with the rest of the world, please let us know!</cite></p> <p><a href="">PHP / cURL examples collection</a></p> Blog CURL How To... LINQ PHPLinq testing Useful scripts Wed, 19 Nov 2008 16:28:34 +0000 admin 40 at Tip: Create a zip file from folders <p>How to compress files from some folder into one ZIP file in PHP?</p> <p><cite>For a future project I needed these days some easy to use zip or gzip class to create a zip file from files / folders inside a specified directory. A short search on Google has lead me to the Create ZIP File PHP class from Rochak Chauhan. I tested two other scripts before and must say that this script works great for single files if you add them manually. To compress a whole directory with an unknown number of files into one zip file I created some class extension to get this job done.</cite></p> <p><a href="">Create a zip file from folders on the fly</a></p> Blog compression How To... Useful scripts ZIP Tue, 18 Nov 2008 15:24:54 +0000 admin 39 at Tip: Bot detection <p>A tutorial for detecting the robots in PHP scripts.</p> <p>Very simple script... But the most valuable part is the bot's UAs list.</p> <p><cite>Bots or Crawlers, are basically search engines crawling around the internet. This is how you get your pages on search engines (well, a major way). Bot Detection isn't something super vital, but if your CMS or website already has practically everything, then you need Bot Detection.</cite></p> <p><a href="">Bot Detection with PHP</a></p> bots How To... tips Sat, 08 Nov 2008 14:31:42 +0000 admin 38 at Blog: Tips and tricks from other pages VI <p>Some PHP snippets, the cURL-based HTTP class, session starter that works across the browsers and a little tip for your .htaccess to lowering load and save the bandwith. Go on!<br /> &lt;!--break--><br /> <cite>A small list of some useful code snippets which might help you when writing your PHP scripts - mail check, password generator, check IP, XSLT transform, sending mail etc.</cite></p> <p><a href="">10 code snippets for PHP developers</a></p> <p><cite>I expanded the previous sample of Basic cUrl and PHP Usage. I added the headers processing which can be useful to handle cookies. It is now easier to use but basic PHP knowledge is required.</cite></p> <p><a href="">eHTTP client class</a></p> <p><cite>If a session based web application is used by a visitor using Internet Explorer it's possible that this user get some trouble. This will happen if parts of the application are accessed for example via a shortcut on the desktop and the application opens then in a new Explorer window. At this moment a second session is started with a different ID, if the used web application has some session based authentication system the user has to login again. At the same time the user has to logout twice! In browsers like Mozilla Firefox new windows are treated the same way then tabs where the problem doesn't exists.</cite></p> <p><a href="">Cross-browser session starter</a></p> <p><cite>The number one turn off for a website has to be loading times. If your server supports mod_expires you can improve your loading times by 66%, as well as saving your self bandwidth.</cite></p> <p><a href="">Save Bandwidth and Loading Times</a></p> Blog cache CURL How To... htaccess sessions snippets tips Useful scripts Tue, 04 Nov 2008 16:35:56 +0000 admin 37 at A new open-source PHP compiler <p>I've found a new promising project in early beta stage: <a href="">phc</a> - the open-source PHP compiler.</p> <p><cite>phc is an open source compiler for PHP with support for plugins. In addition, it can be used to pretty-print or obfuscate PHP code, as a framework for developing applications that process PHP scripts, or to convert PHP into XML and back, enabling processing of PHP scripts using XML tools.</cite></p> <p>phc for PHP programmers:</p> <p> * Compile PHP source into an (optimized) executable.<br /> * Compile a web application into an (optimized) extension.<br /> * Pretty-print PHP code.<br /> * Obfuscate PHP code.<br /> * Combine many php scripts into a single file.<br /> * Optimize PHP code using classical compiler optimizations.</p> <p>phc for tools developers:</p> <p> * Analyse, modify or refactor PHP scripts using C++ plugins.<br /> * Convert PHP into a well-defined XML format, process it with your own tools, and convert it back to PHP.<br /> * Operate on ASTs, simplified ASTs, or 3-address code.<br /> * Analyse or optimize PHP code using an SSA-based IR.</p> <p>Link: <a href="">phc</a></p> compiler How To... open-source phc Useful scripts Thu, 30 Oct 2008 20:04:30 +0000 admin 36 at