21
Zend Framework and Firebug – Log and Debug your Projects
When developing an application there are some important factors that you have to pay close attention to avoid problems in the future. I think one of the most important is logging information on how your application is working and when it fails.
Must of us like to log only big exceptions and fatal errors, but the truth is, that when you are in the development process it’s very important to keep track of not just errors, but important information of when something gets executed. As a web developer one of the most important tools to have is FireBug. If you didn’t know, FireBug has an API that you can use to send console messages for logging purposes, when debugging JavaScript. But, did you know you can use FireBug to debug your php applications? read more
18
Facebook iPhone App 3.0
According to Joe Hewitt, developer of the facebook app. Version 3.0 of the facebook application has already been submitted to apple, and it’s waiting for approval.
read more
24
Maintaining PHP session when using CURL.
Working now on some iGoogle like dashboard for the system I’m developing.
I was trying some stuff out with CURL and was having a hard time to maintain my current session when making a curl request to another page. I needed to stay authenticated in order to retrieve my widget.
Here is my initial code:
$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/'; $ch = curl_init($rssFeedLink); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt( $ch, CURLOPT_COOKIE, $strCookie ); $response = curl_exec($ch); curl_close($ch);
The problem with that piece of code is that it was generating a new session id instead of sending my current session.
The solution? read more
22
Zend Cache and Zend Feed Problem
Today I ran into a problem while caching feeds using Zend_Cache. I decided that I wanted to cache the returned object by the Zend_Feed. I had something like this:
$rssFeedLink = 'http://www.smooka.com/blog/';
$cacheId = 'rss_feed';
$frontendOptions = array(
'lifetime' => 1800, // cache lifetime of 30 mins
'automatic_serialization' => true);
$backendOptions = array(
// Directory where to put the cache files
'cache_dir' => '/cache/'
);
// getting a Zend_Cache_Core object
$cache = Zend_Cache::factory('Core','File', $frontendOptions, $backendOptions);
if (!$rss = $cache->load($cacheId)) {
try {
$rss = Zend_Feed::import($rssFeedLink);
} catch (Exception $e) {
$feedError = true;
}
//check to see if it did not fail
if (!$feedError && is_object($rss))
{
$cache->save($rss, $cacheId);
}
}
//assuming that everything went right while fetching the feed
foreach ($rss as $item) {
$channel['items'][] = array(
'title' => $item->title(),
'link' => $item->link(),
'description' => $item->description()
);
}



