Browsing articles from "April, 2009"
Apr
24

Deal: 1yr Hosting plus Domain Registration for $9.24

DreamHost.com is offering 1 year of hosting plus domain registration for only $9.24. That is a 92% off their normal pricing. Just select “Host a Domain” and when asked for coupon enter “777″

If you only need a domain name, GoDaddy.com has a 1-Year Domain Name Registration for only $1.19. Use coupon “99BUYCOM”.

I’m not sure until when the offers are valid, so just go grab yours now before is too late.

Apr
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()
	);
}

read more

Apr
17

5 Things: Working with Zend Framework and Ajax

Today I wanted to write about 5 awesome Zend Framework components/helpers that can help you when working with ajax.

isXmlHttpRequest()

This handy little method can eliminate the need to send extra parameters such as /ajax/true/ to let the controller know it’s an Ajax request. read more