PHP Suit - How To... https://www.php-suit.com/taxonomy/term/4/0 Tips, tricks, techniques and tutorials... en Blog: Self-extracting archives in PHP https://www.php-suit.com/blog-self-extracting-archives-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="http://www.cookiepattern.com/search/label/extracting?max-results=100">Cookie Pattern: Self-extracting PHP archive</a></p> https://www.php-suit.com/blog-self-extracting-archives-php#comments Archive How To... idea scripts TAR Sun, 01 Mar 2009 09:32:36 +0000 admin 51 at https://www.php-suit.com Paypal Direct Payment Component Using cURL https://www.php-suit.com/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="http://bakery.cakephp.org/articles/view/paypal-direct-payment-component-using-curl">Paypal Direct Payment Component Using cURL</a>.</p> <p>See also <a href="https://www.php-suit.com/paypal">my PayPal implementation</a>.</p> https://www.php-suit.com/paypal-direct-payment-component-using-curl#comments Blog How To... PayPal Useful scripts Tue, 17 Feb 2009 09:23:51 +0000 admin 50 at https://www.php-suit.com Creating system daemon in PHP https://www.php-suit.com/creating-system-daemon-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="http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/">Create daemons in PHP</a></p> https://www.php-suit.com/creating-system-daemon-php#comments Blog Daemon How To... System Fri, 16 Jan 2009 10:23:59 +0000 admin 49 at https://www.php-suit.com BlogAPI Drupal filter https://www.php-suit.com/blogapi-drupal-filter <p>Using blog clients such as <a href="http://www.codingrobots.com/blogjet/">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="http://drupal.org/">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="http://drupal.org/node/295">BlogApi: post from blog tools | drupal.org</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 blogapi_break_converter_5.zip" target="_blank"><img src="https://www.php-suit.com/modules/webfm/image/icon/zip.gif" alt="[file]" title="Download blogapi_break_converter_5.zip"/> </a><a href="/webfm_send/8" title="Open blogapi_break_converter_5.zip" target="_blank">blogapi_break_converter_5.zip</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 blogapi_break_converter.zip" target="_blank"><img src="https://www.php-suit.com/modules/webfm/image/icon/zip.gif" alt="[file]" title="Download blogapi_break_converter.zip"/> </a><a href="/webfm_send/9" title="Open blogapi_break_converter.zip" target="_blank">blogapi_break_converter.zip</a></td><td class="att-time">14/12/08 9:18 am</td><td class="att-size">892 bytes</td> </tr> </tbody></table> </div> https://www.php-suit.com/blogapi-drupal-filter#comments Blog BlogJet Drupal How To... Useful scripts Sun, 14 Dec 2008 16:18:03 +0000 admin 45 at https://www.php-suit.com Joining .WAVs with PHP https://www.php-suit.com/joining-wavs-php <p>Join WAVs into one file.</p> <p><cite><br /> I'm currently working on a <a class="interwiki iw_doku" title="http://www.dokuwiki.org/plugin%3Acaptcha" href="http://www.dokuwiki.org/plugin%3Acaptcha">CAPTCHA plugin</a> for <a class="wikilink1" title="dokuwiki" href="http://www.splitbrain.org/projects/dokuwiki">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="http://articles.techrepublic.com.com/5100-.html" href="http://articles.techrepublic.com.com/5100-.html">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="http://www.splitbrain.org/blog/2006-11/15-joining_wavs_with_php">Joining .WAVs with PHP </a></p> https://www.php-suit.com/joining-wavs-php#comments Blog How To... Sat, 13 Dec 2008 01:36:25 +0000 admin 44 at https://www.php-suit.com Blog: Tips and tricks from other pages VII https://www.php-suit.com/blog-tips-and-tricks-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="http://www.phpundercontrol.org/about.html">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="http://www.codeplex.com/PHPLinq">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="http://www.mikeborozdin.com/post/Is-PHPLinq-As-Cool-As-Real-LINQ.aspx">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="http://curl.haxx.se/libcurl/php/examples/resizejpg.html">PHP / cURL examples collection</a></p> https://www.php-suit.com/blog-tips-and-tricks-other-pages-vii#comments Blog CURL How To... LINQ PHPLinq testing Useful scripts Wed, 19 Nov 2008 16:28:34 +0000 admin 40 at https://www.php-suit.com Tip: Create a zip file from folders https://www.php-suit.com/tip-create-zip-file-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="http://www.web-development-blog.com/archives/tutorial-create-a-zip-file-from-folders-on-the-fly/">Create a zip file from folders on the fly</a></p> https://www.php-suit.com/tip-create-zip-file-folders#comments Blog compression How To... Useful scripts ZIP Tue, 18 Nov 2008 15:24:54 +0000 admin 39 at https://www.php-suit.com Tip: Bot detection https://www.php-suit.com/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="http://www.goodphptutorials.com/out/Bot_Detection_with_PHP">Bot Detection with PHP</a></p> https://www.php-suit.com/tip-bot-detection#comments bots How To... tips Sat, 08 Nov 2008 14:31:42 +0000 admin 38 at https://www.php-suit.com Blog: Tips and tricks from other pages VI https://www.php-suit.com/blog-tips-and-tricks-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="http://htmlblog.net/10-code-snippets-for-php-developers/">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="http://www.tellinya.com/read/2007/08/03/39.html">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="http://www.finalwebsites.com/snippets.php?id=42">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="http://myphpdigest.com/news.php?title=Save_Bandwidth_and_Loading_Times">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 https://www.php-suit.com A new open-source PHP compiler https://www.php-suit.com/new-open-source-php-compiler <p>I've found a new promising project in early beta stage: <a href="http://www.phpcompiler.org/">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="http://www.phpcompiler.org/">phc</a></p> https://www.php-suit.com/new-open-source-php-compiler#comments compiler How To... open-source phc Useful scripts Thu, 30 Oct 2008 20:04:30 +0000 admin 36 at https://www.php-suit.com