News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Sebastian Bergmann's Blog:
Global Variables and PHPUnit
June 17, 2008 @ 08:49:19

Sebastian Bergmann has a new post today about a feature of the PHPUnit unit testing tool that has the possibility of breaking when objects are introduced - backing up the globals.

It is hard to test code that uses singletons. The same is true for code that uses global variables. Typically, the code you want to test is coupled strongly with a global variable and you cannot control its creation. An additional problem is the fact that one test's change to a global variable might break another test.

You can disable the backup option if you'd like by setting the $backupGlobals option in your test to false. This lets PHPUnit know that you want to leave the globals (and superglobals) alone during the run.

0 comments voice your opinion now!
global variable phpunit unittest backup global superglobal test disable



Richard Heyes' Blog:
mail() replacement
December 10, 2007 @ 07:57:00

Richard Heyes has posted about a mail() replacement he's come up with that adds the additional functionality of backing up all of the data to a certain directory of your choosing.

A simple drop in replacement function for PHPs mail() function called mailb() which backs up all the data to a specified directory. [...] I've also added a simple header file to Apache and the download directory so it looks nicer.

You can download a copy of his library here as a .phps file (a quick and easy 40ish line script).

0 comments voice your opinion now!
mail email replace mailb backup data directory mail email replace mailb backup data directory


IBM developerWorks:
Turn SQL into XML with PHP
July 25, 2007 @ 09:21:00

On the IBM developerWorks site today, there's a new tutorial by Vikram Vaswani walking through the use of the XML_Query2XML PEAR package to pull data from your SQL database and push it into an XML structure.

Ever wished for an easy way to transform SQL result sets into XML? It's a PEAR package named XML_Query2XML, and it provides a comprehensive framework to efficiently turn the results of a database query into a customizable XML document. This article introduces the package, and demonstrates useful real-world applications, including using it with XSL and XPath, combining it with data from external Web services, and creating database dump files.

They go through the installation and the steps to create the XML:

  • Convert SQL to XML
  • Transform XML output with XSL
  • Customize XML output
  • Work with SQL joins
  • Filter SQL records with XPath
  • Merge data from multiple sources
  • Create database backups

Check out the full tutorial for an excellent guide to using this powerful PEAR package.

0 comments voice your opinion now!
pear xmlquery2xml xsl xpath join install backup pear xmlquery2xml xsl xpath join install backup


Ryan Malesevich's Blog:
WP Plugins Database Backup
September 21, 2006 @ 07:08:36

On his blog today, Ryan Malesevich brings us yet another spotlight on a useful WordPress plugin. This time, it's a look at a tool that could save your entire site if used - the WordPress Database Backup plugin.

Wordpress ships with a couple plugins installed like Akismet which is a great help. I'm not sure what the Hello Dolly one is and am afraid to try it because it sounds lame. But it also comes with a Wordpress Database Backup. I've been using this for a while and thought I would share it with you.

He shows the installation and use of the plugin, including screenshots of what the various bits of functionality look like. Making backups is always a good thing, and making it this easy is even better.

0 comments voice your opinion now!
wordpress plugin database backup preinstalled simple wordpress plugin database backup preinstalled simple


Sephiroth.it:
Backup your batabases w/o phpmyadmin
April 07, 2006 @ 07:28:40

As most people, especially those on a shared hosting environment, know, phpMyAdmin can be indespensible for managing your database setup. There are times, however, when you need to work with your databases without it - epecifically in doing a backup. If all you're left with is the command line and you need to make a backup quick, Sephiroth.it has a quick tip to help out.

I often read threads about export/import data from MySQL and it's always mentioned phpmyadmin as the only way to do that (with PHP indeed).

But that's not true, and it's indeed the slower way to do that, expecially when importing large database files (because phpmyadmin has problems with large db)...

He gives an example of the mysqldump functionality, complete with parameters for passing in things like a username and password. The reverse is also shown - reimporting the database data back into the system.

0 comments voice your opinion now!
php database backup without phpmyadmin mysqldump export import php database backup without phpmyadmin mysqldump export import


Sematopia.com:
How to - Backup MySQL database & email results using PHP
February 17, 2006 @ 07:06:03

From Sematopia.com today, there's a quick example of how to backup a MySQL database and email results with the help of a bit of PHP.

There are a bunch of scripts on the Internet that overly complicate the issue of automatically backing up your database. Here is a PHP script I wrote to backup a mysql database and email the results. Just set a cron job (/etc/crontab) to run this script with the following command: php dbBackUp.php

You can either copy and paste the code from the post or download a copy. It uses the PEAR Mail and Mail_Mime packages to do a lot of the work, so you'll need those installed before it will cooperate.

0 comments voice your opinion now!
php backup mysql database email results PEAR Mail Mime_Mail php backup mysql database email results PEAR Mail Mime_Mail



Community Events









Don't see your event here?
Let us know!


zend book releases developer PHP5 zendframework example mysql PEAR code job framework database application ajax cakephp release security package conference

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework