Data cache routine in PHP using CodeIgniter

This routine stores and reads temporary data to and from a file that can be used for minimizing database query.

 

# save object or array to a file.
function save_cache($username, $file, $data)
{
$this->load->helper('file');
if(!@mkdir("./data/profiles/".$username, 0777, false)) return false;
write_file('./data/profiles/'.$username.'/'.$file, base64_encode(serialize($data)));
return true;
}
# read file and return object or array value
function read_cache($username, $file)
{
$this->load->helper('file');
if(!($data = read_file('./data/profiles/'.$username.'/'.$file))) return false;
$data =  unserialize(base64_decode($data));
return $data;
}

Willing Willie of TV5 : Mas ok kesa sa Pilipnas Win na Win

image

Why? hindi ko lang maiwasan ipag compare… Mas “masa” ang approach ni Willie kesa kina RicoJ.  And lalo na… Willie always acknowledge yung mga sponsors nya… not only to endorse the brand but also… i-acknowledge din ng participant at malaman nila na bigay ng sponsor o ng network yun at hindi galing sa bulsa nya… unless galing sa talaga sa bulsa nya o initiative nya yung ibibigay… Unlike yung Win na Win… nagsasalita as if sa bulsa nila galing yung premyo… No wonder, pina patronize parin sya ng masa…

Sa Pilipinas Win na Win…. oh come on! magagaling silang singer pero… as host? noob! sobrang noob!

Kung papipiliin naman ako sa dalawang show… kung sila lang ang pagpipilian… kay Willie nako…

osmand #android app turn-by-turn gps navigation in the philippines for FREE

image

osmand, a free/open-source android applications, lets you travel in Metro Manila like you’re in a “NFS” racing game. You just need to point your destination using your screen and it will calculate and select the fastest path you can have. But make sure you will still read road signs… because it might lead you to traffic officers for counterflow violations.

Various options in map settings.  You can get maps from Google or from OpenStreetMap or even from other map providers.  You can  download or use maps from your SD card for offline map while also using online for minimal data transfer from the source.

SMS Backup+ #android app stores your SMS, MMS and call logs to your GMail Labeled Mailbox.

image

With SMS Backup+, you dont have to say goodbye to your important phone messages to archive and save phone memory spaces. You can download and use it for free from Android Market.

SMS Backup+ can store your SMS, MMS and even your Call logs optimizing your GMail labeled mailboxes via Mobile or WLAN. As long as you have enough storage space to your Gmail, you can back-up as many as you want.