Error Call To A Member Function Read On A Non-object
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta call to a member function read() on a non-object in cakephp Discuss the workings and policies of this site About Us Learn
Call To A Member Function Read() On A Non-object In Php
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us dir php Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to a member function read() on a non-object on LanguageComponent up vote 0 down vote favorite I am having this line in my CakePHP code: $language = $this->Cookie->read('language'); and I'm getting this error: Fatal error: Call to a member function read() on a non-object in C:\Apache24\htdocs\cake\app\Controller\Component\LanguageComponent.php on line 27 Here is my LanguageComponent.php code controller = $controller; if (empty($languages)) { $this->languages = Configure::read('Config.languages'); } $this->set(); } public function set($language = null) { $saveCookie = false; if (empty($language) && isset($this->controller)) { if (!empty($this->controller->params['named']['lang'])) { $language = $this->controller->params['named']['lang']; } elseif (!empty($this->controller->params['url']['lang'])) { $language = $this->controller->params['url']['lang']; } if (!empty($language)) { $saveCookie = true; } } if (empty($language)) { $language = $this->Cookie->read('language'); if (empty($language)) { $saveCookie = true; } } if (empty($language) && !array_key_exists($language, $this->languages)) { $language = Configure::read('Config.language'); } Configure::write('Config.language', $language); if ($saveCookie) { $this->Cookie->write('language', $language, false, '1 year'); } } } ?> Where could the problem be? php cakephp cookies share|improve this question edited Jun 23 '14 at 7:40 Wojciech Rutkowski 4,8211919 asked Jun 23 '14 at 7:35 ashermcoa 3918 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted Wrong pare
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Magento - Call to a member function read() on a non-object up vote 0 down vote favorite I tried to make a compilation in my magento app but it redirect me to a blank page then I http://stackoverflow.com/questions/24360641/fatal-error-call-to-a-member-function-read-on-a-non-object-on-languagecompone added @ homepage ini_set('display_errors', 1); It shows that error Fatal error: Call to a member function read() on a non-object in /PATH/TO/public/app/code/core/Mage/Compiler/Model/Process.php on line 109 Process.php if (is_dir($source)) { $dir = dir($source); while (false !== ($file = $dir->read())) { //The error here if (($file[0] == '.')) { continue; } $sourceFile = $source . DS . $file; if ($file == 'controllers') { $this->_controllerFolders[] = $sourceFile; continue; } if ($firstIteration) { $targetFile = $target . DS . $file; } else { $targetFile = $target http://stackoverflow.com/questions/29628428/magento-call-to-a-member-function-read-on-a-non-object . '_' . $file; } $this->_copy($sourceFile, $targetFile, false); } How can I solve it? php magento content-management-system share|improve this question edited Apr 14 '15 at 13:22 asked Apr 14 '15 at 13:18 Moamen Abdelwahed 4311 Post some more code where you are calling read() –Being Sunny Apr 14 '15 at 13:19 @BeingSunny Edited –Moamen Abdelwahed Apr 14 '15 at 13:22 1 Check your $source in dir() function because it Returns an instance of Directory, or NULL with wrong parameters, or FALSE in case of another error. –Being Sunny Apr 14 '15 at 13:24 @BeingSunny It isn't NULL or FALSE, it has a lot of directories –Moamen Abdelwahed Apr 14 '15 at 13:33 1 Insert if ($dir === false || $dir === null) { var_dump($source); die('gotcha'); } right after the $dir = dir($source); line. Maybe the fatal error is not triggered by the first call. –Jürgen Thelen Apr 14 '15 at 20:28 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged php magento content-management-system
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes Cafepress Shop-front IntegrationIssues Fatal error: Call to a member function read() https://www.drupal.org/node/185433 on a non-object in /home/XXXXXXX/public_html/ADR/modules/cafepress-5.x-0.0/cafepre Closed (fixed)Project:Cafepress Shop-front IntegrationVersion:5.x-0.0Component:CodePriority:NormalCategory:Support requestAssigned:UnassignedReporter:alphadawgCreated:October 22, 2007 - 03:56Updated:May 6, 2008 - 22:01 Log in or register to update this issue Great idea for a module and was so excited to download and implement. Having problems and have placed the code below. Any help would be greatly appreciated. Fatal error: Call to a member function read() on a call to non-object in /home/XXXXXXX/public_html/ADR/modules/cafepress-5.x-0.0/cafepress/cafepress.module on line 268 Comments Comment #1 rooey CreditAttribution: rooey commented October 23, 2007 at 1:32pm Please provide more information. What platform are you running on etc? Log in or register to post comments Comment #2 alphadawg CreditAttribution: alphadawg commented October 24, 2007 at 3:03am i'm running drupal 5.0 and the cafe press version 5.0 as well Log in or register call to a to post comments Comment #3 VM CreditAttribution: VM commented October 24, 2007 at 3:08am the developer meant what version of PHP, Apache and the like. side note: if you are serously running Drupal 5.0 you should consider updating to Drupal 5.3 you are three security releases behind and are open to some pretty bad security holes. Log in or register to post comments Comment #4 Street CreditAttribution: Street commented October 28, 2007 at 8:14pm Title: HELP ยป Fatal error: Call to a member function read() on a non-object in /home/XXXXXXX/public_html/ADR/modules/cafepress-5.x-0.0/cafepre I am getting the same error when I enable the cafepress block. I am running on Apache 2.0.54 with php 5.2.3 on Dreamhost. Log in or register to post comments Comment #5 oldblackcrow CreditAttribution: oldblackcrow commented November 2, 2007 at 2:28am I'm having the same problem... I had to delete the cafepress module via ftp to get back into my site. How do I know what versions I'm running of the software listed? Thanks! Log in or register to post comments Comment #6 oldblackcrow CreditAttribution: oldblackcrow commented November 3, 2007 at 4:07am Okay, here are my setti