CVS tricks

Show all modules:

I lifted this from my friend Joels website, www.gadgetwiz.com, and have found myself using it many times:

List all directories in cvs

I accidentally typed this command and recieved a list of all the cvs root directories available for checkout. Other commands to list modules did not work, but this one did. You must be in a CVS directory first.
Code:

cvs -n co .

Recursively show all files:

Have you ever worked in a CVS module, added a deep tree of directories and files and needed to add them to CVS. If you have, you may have had to go through a painful process of adding one dir at a time, then all the files in that dir, then repeat until you’ve done all the dirs. I have a solution for that:

Just run this over and over again, until all files are added:

Read moreCVS tricks

Bookmark a page that auto-posts your login

The idea is this: I am tired of logging into the same site over and over again. This is a simple GET to POST converter. The page helps you create a URL that you can bookmark. When you use this link, your data to POST is sent to your server in the form of GET. Your webserver then translates the GET parameters into a form and POSTS to the server you’re trying to login to. So, the sensative data is kept on your computer in the bookmark (the URL). Since you don’t want anybody to be able to just read your username and password, this script will encrypt the data in the URL so your bookmark contains nothing but encrypted data.

Read moreBookmark a page that auto-posts your login

What PHP accelerator works well with PHP?

I know that the Zend Accelerator works well, but it’s expensive. Turke MMCache is the best freeware PHP accelerator for PHP4, but has some problems with PHP5. Any thoughts?
        
Best Freeware Available, I think, is E Accelerator (this site uses this with PHP5):
http://eaccelerator.net/HomeUk?lg=uk

Best Payware, Zend:
http://www.zend.com/

Couple others:
– PHP Accelerator (http://www.php-accelerator.co.uk/)
– Alternative PHP Cache (http://pecl.php.net/package/APC)
– AfterBurner Cache (http://bwcache.bware.it/)

Read moreWhat PHP accelerator works well with PHP?

PHP5 Autoload classes

This is really handy for medium to large size projects. You don’t have to remember to put a set of require_once functions in every file.  I usually put this in a config file that’s loaded early and on every page.

<?php
function __autoload($class_name) {
   require_once $class_name . ‘.php’;
}

$obj  = new MyClass1();
$obj2 = new MyClass2();
?>

See http://us2.php.net/manual/en/language.oop5.autoload.php for more information.

Read morePHP5 Autoload classes