Friday, 6 September 2013

PHP compiler - HipHop

HipHop is a execution engines and improvements created by Facebook. 
HipHop was develop to save resources on Facebook servers. 
HipHop is currently around 1.9 million lines of mostly C++, C and PHP source code and is distributed as open source. 
It programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it.

Friday, 7 June 2013

Export CSV file in PHP

  header("Content-type:text/octect-stream");
  header("Content-Disposition:attachment;filename=data.csv");
 $recordlist = $this->db->query("SELECT * FROM `table` ");

        foreach($recordlist ->result_array() as $row)
        {
            print '"' . stripslashes(implode('","',$row)) . "\"\n";
        }
        exit;

How to enable gzip compression using cpanel

Login into cpanel  -> Software/Services -> Optimize Website -> Now Click on 'Compress all content'

Now check your site performance using this site
http://gtmetrix.com/















Monday, 22 April 2013

A WordPress blog in CakePhp site.

Create a folder blog in app->webroot in cakephp site.

Upload your wordpress blog in this folder.

Modify your root .htaccess  file in cakeph.

<IfModule mod_rewrite.c>
   RewriteEngine on
   RedirectMatch temp ^/blog/wp-admin$ site_name/blog/
    RewriteRule ^blog$ blog/ [L]
    RewriteRule ^blog/wp-admin$ blog/wp-admin/ [L]
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

Now admin URL
site_name/blog/wp-login.php

Sunday, 26 February 2012

Cakephp interview questions

What is cakephp?
Cakephp is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. it uses commonly known design patterns like MVC,ORM within the convention over configuration paradigm, It also reduces development costs and helps developers write less code.