Browsing articles tagged with " PHP"

Simple PHP script to migrate articles from Radiant (Rails CMS) to Joomla (PHP CMS)

I was working on migrating data from Radient 0.8.1 (Ruby on Rails CMS) to Joomla 2.5.6 (PHP CMS), and it was a bit silly but interesting task. So, I wrote the following simple php script to migrate articles, but you should adjust some variables first.
Continue reading »

Preventing Joomla! from sending no-cache in headers

If you are using Joomla! 1.5+ and trying to cache with nginx or other caching server and at same time you don’t want to use Joomla! system cache plugin. You’ll face a big problem, that Joomla! is sending “Cache-Control: no-cache” and “Pragma: no-cache” in response headers.

Here’s the solution :

1. Edit the following file :

Joomla root/libraries/joomla/environment/response.php

2. Search for the following code :

if (self::allowCache() === false) {
self::setHeader('Cache-Control', 'no-cache', false);
// HTTP 1.0
self::setHeader('Pragma', 'no-cache');

3. Comment this if condition, to be as follows

if (self::allowCache() === false) {
self::setHeader('Cache-Control', 'no-cache', false);
// HTTP 1.0
self::setHeader('Pragma', 'no-cache');

Now, you can disable Joomla! caching, and run whatever caching server, as nginx.

PHP Coding Standards

I’d been writing PHP Code for about 5 years ago 🙂 !! at 1st I started by some short tutorials then went for trial & error and ofcourse the help of Waleed Gad, later on I started to read many books and my Programming level started to be near professional , but each time I was looking for coding standards. 2 days ago by chance I did a search and I found a lot of useful links that I wanted to share with you !

  1. PHP Coding Standards text file (Found on their CVS)
  2. PEAR coding standards
  3. Zend Framework coding standard
  4. Typo3 general php practices
  5. WordPress coding style guidelines
  6. phpbb3 group coding guidelines
  7. Buxaprojects php coding guidelines
  8. php coding guidelines
  9. BlackGate php coding guidelines
  10. Blueshoes coding guidelines
  11. OpenClinic coding guidelines