As internet applications get more and more complex and start to become more like desktop applications and less like electronic brochures, they can become more and more complex to test to ensure that everything is working properly. There are numerous strategies to cope with this including the development of “test based” development, where tests are [...]
Archive:
Archive for January, 2009
After a bunch of digging around and some help from the nice people on the #php channel on freenode IRC, I have cleared up the issue regarding PHP script execution and client connection. If a client disconnects (closes the browser window / tab) and PHP subsequently tries to send information to the client but fails, [...]
Some times you are working on a database that is just too big to export and import via phpMyAdmin. In those circumstances the best alternative is to use the Linux command line, usually via SSH. If you want to be able to download the file easily via FTP, you need to first of all go [...]
Sometime you need a PHP script to check for the existence of a MySQL table. This function achieves that for you. PLAIN TEXT PHP: function db_table_exists($table){ $exists = false; $tables_query = db_query("SHOW TABLES FROM " . MYSQL_DB); while($t = mysql_fetch_assoc($tables_query)){ foreach($t as $k=>$v){ [...]
A lot of hosting accounts do not have CLI PHP enabled. If you have some maintainence scripts that you want to run on a regular basis then you can still do this using cron combined with cURL. For example check out this crontab command: PLAIN TEXT CODE: # 0 0 * * * * /usr/bin/curl [...]
If you installed Magento via any other method than the downloader, then when you come to use Magento Connect, you will find that you are unable to due to permissions. For Magento Connect to work, all folders must have 777 permissions. If you have SSH access to your server, you can fix this by running [...]
Upgrading Magento can be a little tricky. I would definitely advise testing out any upgrades on a development copy of your site, not applying updates directly to the live site without testing for problems first. Being such a young platform, Magento is in a phase of rapid development. Inevitably this development will introduce bugs and [...]
There are a few simple steps you need to take to move your Magento based store from one place to another. First of all, create a full SQL dump of your store's database and import this to a database on the new server. To do this, simply use the backup functionality within the Magento Admin. [...]
Don't get me wrong, I love phpMyAdmin and use it every day. However sometimes on client servers the only access to the database is via phpMyAdmin and it hasn't been set up properly. One really irritating example is when trying to dump a database so that it can be installed on my local development server. [...]
If your host doesn't provide you with phpMyAdmin access, or if you simply want a faster lighter version of phpMyAdmin for simple DB admin tasks and running custom SQL queries, then take a look at phpMiniAdmin. Its a single script so its incredibly easy to install - simply upload it. I would be tempted to [...]