mdvignesh Posted September 22, 2012 Share Posted September 22, 2012 (edited) I am doing Photo gallery using cakephp and flickr by seeing this link http://www.sitepoint.com/photo-gallery-cakephp-flickr/# I am getting Error: Class 'phpFlickr' not found File: C:\wamp\www\cake\app\Controller\Component\flickrComponent.php Line: 28 This is my flickrComponent.php <?php /** * Flickr Component * @author RosSoft * @license MIT * @version 0.1 */ define(‘FLICKR_CACHE_DIR’,CACHE . ‘flickr/’); class FlickrComponent extends Object { /** * Api Key. Change to your own * @var string * @link http://www.flickr.com/services/api/misc.api_keys.html */ //var $_api_key=’CHANGE_TO_YOUR_KEY’; var $_api_key='55d16262ee69f739466b7c45b073cc8a'; function startup(&$controller) { App::import('Vendor', 'phpFlickr', array('file' => 'phpflickr'.DS.'phpFlickr'.DS.'phpFlickr.php')); //vendor(‘phpflickr/phpFlickr’); //FlickrComponent instance of controller is replaced by a phpFlickr instance $controller->flickr =& new phpFlickr($this->_api_key); if (!is_dir(FLICKR_CACHE_DIR)) { mkdir(FLICKR_CACHE_DIR,0777); } $controller->flickr->enableCache(‘fs’, FLICKR_CACHE_DIR); $controller->set(‘flickr’,$controller->flickr); } } ?> This is my gallerycontroller.php <?php class GalleryController extends AppController { var $name = 'Gallery'; var $components = array('Flickr'); var $uses = null; } ?> Edited September 22, 2012 by mdvignesh Quote Link to comment https://forums.phpfreaks.com/topic/268657-build-a-photo-gallery-using-cakephp-and-flickr/ Share on other sites More sharing options...
jazzman1 Posted September 22, 2012 Share Posted September 22, 2012 Change the name of the file, exactly like this: gallerycontroller.php to gallery_controller.php Quote Link to comment https://forums.phpfreaks.com/topic/268657-build-a-photo-gallery-using-cakephp-and-flickr/#findComment-1380006 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.