Cannot redeclare class Facebook with facebook-php-sdk-master - php

I have been test successful already with my project used Codeigniter with facebook-php-sdk-master for user login to facebook. Than i am back up it may be 2 month ago and now i just run it back i got errors message as
Fatal error: Cannot redeclare class Facebook in ../application/libraries/facebook.php on line 24
that this line have code
class Facebook extends BaseFacebook
{
//any code
}
I don't know it's make by any problem. By i search in Google i get result because i have duplicate class name. but after i check it. it's show really no the same name of class in his project and other one why before it's run well and now ?
Anyone have idea with it? please share to me now .
thanks

Try include_once as your code instead of include

Related

Fatal error: Uncaught Error: Class 'INFOCUS_THEME\Inc\Menus' not found

I am trying to follow a WordPress tutorial by Imran Sayed - Codeytek Academy (https://www.youtube.com/watch?v=lNtw4yxEydM&list=PLD8nQCAhR3tT3ehpyOpoYeUj3KHDEVK9h) to allow wordpress to build a menu and then inject into the html. I have followed the turorials 22, 23 and 24 (from the playlist) trying to use this in my own project.
I have copied the code and folder/file structure and added in the class, helpers, singletons and autoloaders. BUT everytime I try and run the code i get
Fatal error: Uncaught Error: Class 'INFOCUS_THEME\Inc\Menus' not found in /home/will/Local Sites/karenkeyinfocus/app/public/wp-content/themes/infocus/template-parts/header/nav.php on line 13
Error: Class 'INFOCUS_THEME\Inc\Menus' not found in /home/will/Local Sites/karenkeyinfocus/app/public/wp-content/themes/infocus/template-parts/header/nav.php on line 13
I have changed the text domain from aquila to infocus as thats whats in my project in all the locations. BUT i am completly stuck and can't work out why my code is not running.
Think this is the code thats causing the problems as it can't find the class 'INFOCUS_THEME\Inc\Menus'
<?php
$menu_class = \INFOCUS_THEME\Inc\Menus::get_instance();
$header_menu_id = $menu_class->get_menu_id( 'infocus-header-menu' );
$header_menus = wp_get_nav_menu_items( $header_menu_id );
?>
I have uploaded it to my github account and post the link here, as I thought that is the best way.
https://github.com/wkey1980/infocus
When declaring a variable as a class you must use 'new' to initiate the class.
$menu_class = new \INFOCUS_THEME\Inc\Menus();
//and then you can do
$menu_instance = $menu_class->get_instance();

Fatal error: Class 'Camiloo_Amazonimport_Helper_Data' not found in /home/drwakde1/public_html/eshop/app/Mage.php on line 547

I am new to Magento. I just installed Camiloo Global Amazon Integration 2.4.1.0, as soon as I installed it, I am not able to login to my Magento admin. When I enter the login id and password in the admin area, it displays the following error -
Fatal error: Class 'Camiloo_Amazonimport_Helper_Data' not found in
/home/drwakde1/public_html/eshop/app/Mage.php on line 547
I would appreciate your help.
Many thanks,
Nilesh
check if app/code/{local or community}/Camiloo/Amazonimport/Helper/Data.php exits? If not, check your module if it has or not. If not, then simply create a file Data.php under above mentioned path and paste the following code in it:
class Camiloo_Amazonimport_Helper_Data extends Mage_Core_Helper_Abstract
{
}

PHP Fatal-Error: Call to a member function append_output()

I use codeigniter in my blog and since a while I get this error
PHP Fatal error: Call to a member function append_output() on a non-object in /var/www/site/blog/system/core/Loader.php on line 862
I don't know what change caused this and why it appears. The site gets rendered and send to browser completely, from views header.php, index.php to footer.php everything is there and after that this error appears. Search with google showed another site, that has this error at the very bottom of their site...
I now supressed the error with error_reporting(0) as the whole site works fine, but that's not a solution I want to stay with.
It happens on all pages, I have one Controler (blog.php) and several methods like index(), article(), archive() in it. The methods do what they are supposed to do, but when CI finished rendering the page, the error appears, with all controler methods.
What can I do to trace where this problem appears?
https://github.com/EllisLab/CodeIgniter/blob/develop/system/core/Loader.php#L938
If the error is occurring on the value returned from get_instance, here will be your problem. Although you may have to look at the version you are using to get the right line number.
Additionally:
https://github.com/EllisLab/CodeIgniter/blob/develop/system/core/Controller.php#L75
This appears to be the singleton class that function leads to, it is returning self::$instance which is created in the constructor.
To me this means the CI_Controller singleton has not been instantiated at the time that error has occurred.
Hope that helps you debug your problem.
I had the same problem. I'd overwritten the output class ($this->output) in my controller.

Fatal error: Call to a member function sql_in_set() on a non-object in

My question is what exactly is this error message telling me? What do I need to do specifically?
Fatal error: Call to a member function sql_in_set() on a non-object in /home/savas/x/inc/recenttopicsfeed.php on line 15
I have a php page pulling users and info from a phpbb3 forum. I decided to add a recent topics side bar on the same page and use the code from elsewhere so it's not mine and I don't fully understand it. I get this error message.
I tried looking and can't figure it out, but so I guess I want to understand fully what this means to better try and solve it.
Thank you.
This error messages is explaining itself by saying that sql_in_set is being called on non object.
If you are familiar with OOPS concepts then you must know that whenever we are going to call some member functions of class, we have to do it through class objects.
e.g: $db=new Database();
$db->member_function();
In this example we are calling member_function by object $db of Database class.
As you have mentioned that you are using it phpbb3 form and copying code from somewhere else.
I suppose you are doing it something like:
$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $sql_in);
as explained here: https://wiki.phpbb.com/Dbal.sql_in_set
So i suppose you are using it somewhere where $db is not accessible/not created yet.
Try understanding the flow of phpbb3 and pass variables according to it.

Trying to install Auth for CI: Call to undefined method CI_Loader::setdata()

I have been trying to implement an auth system for Codeigniter. I wanted to save time, though it hasn't succeeded so far.
The system I'm trying to implement is: http://codeigniter.com/wiki/auth/
Currently I have some forms working, but the registration form generates a fatal error:
PHP Fatal error: Call to undefined method CI_Loader::setdata() in /Applications/MAMP/htdocs/CI+Login/system/application/controllers/auth.php on line 159
Anyone has an idea what that is about? Anyone has got this system running?
thx.
EDIT:
The code that generates the error is:
if ($this->config->item('auth_use_security_code'))
$this->authlib->register_init();
$data['countries'] = $this->Usermodel->getCountries();
$this->load->setdata($data);
The problem is that load does not contain a method named setdata, has it in a previous version of CI or what can I make of this?
Try this:
$this->load->vars($data);
or remove this line and use the second parameter of the $this->load->view() function.
$this->load->view($this->config->item('auth_register_view'),$data);

Categories