Zend Framework 2 authentication using Facebook - php

I am using SocalNick/ScnSocialAuth (https://github.com/SocalNick/ScnSocialAuth) library with Zend Framework 2 for my project. While I am trying to login using Facebook I am getting folowing error message.
Fatal error: Call to a member function getState() on a non-object in D:\php\htdocs\test\vendor\socalnick\scn-social-auth\src\ScnSocialAuth\Authentication\Adapter\HybridAuth.php on line 144
I am trying hard to find out the root of this problem, but could not find any solution so far.
Can any one say what can be the solution??
Thanks

From what info you've provided it seems that the Entity you have defined for Authentication has a member variable 'state' but no method to get it. (i.e. getState()).
Assumptions here include that you're using ZfcUser and you're probably overwriting the entity.
'user_entity_class' => '<mymodule>\Entity\User',

Related

Laravel - Creating Custom Classes throws error of undefined

I've been following this short tutorial and wanted to make my own class and call it simple like classname::methodname, but without injection.
I get the following error:
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with
message 'Call to undefined method
App\Facades\LiveSearch::getServiceList()'
Link to Tutorial: here
It makes sense and that is why i cannot figure out where the problem lies ..
Hey you also need to do the follow up steps to create laravel classes.
I hope this reference on How to create a laravel class is helpful.

CakePHP: Fatal error: Call to a member function image()

I'm using the following Helper: http://pastebin.com/qBs2GvG4 in my CakePHP 2.0 app to show a gravatar for a user like so:
<?php $this->Gravatar->image($profile['User']['email'], array('default'=>'mm','size'=>48)); ?>
However it gives the error:
Fatal error: Call to a member function image() on a non-object in /Users/cameron/Sites/social/app/View/Helper/GravatarHelper.php on line 97
Any ideas what the problem is? This worked in my 1.3 app so wondering if something has changed between 1.3 and 2.0 that causes this issue? Thanks
Helpers have slightly different dependencies in 2.0, especially if they require other helpers.I actually made the commits to fix this one in the CakeDC utils plugin.
You can find an updated version of that helper here: https://github.com/CakeDC/utils/blob/2.0/View/Helper/GravatarHelper.php
Looks like the GravatarHelper has a dependency on the HtmlHelper. Is Html in your list of helpers in the controller?

call to undefined function View::fetch cakePHP

I started experimenting with CakePHP version 2.x, I created a default.ctp layout file in View/Layouts inside of which I have codes like:
echo $this->fetch('css');
but I keep getting the following error:
Fatal error: Call to undefined method View::fetch() in C:\wamp\www\.......
I tried creating a block for this css in my view file like:
$this->start('css');
$this->Html->css('home_page', null, array('inline' => false));
$this->end();
But when I do this I get the following error:
Fatal error: Call to undefined method View::start() in C:\wamp\www\.......
Any help please?!!!
Thank you
View::fetch() is available since 2.1, what is your version?
I dont think you need fetch, start, end for including css, you can just use:
$this->Html->css(array('home_page.css'));
//OR
echo $this->fetch('css'); //from version 2.1
Ref: Css CakePHP
The book is a little ahead of the release atm! fetch() is from 2.1 code, which is still alpha.
Try generating a default layout using cake's bake tool and study that to see how 2.0 does it, and make sure do you don't follow bits of the book which say they are new in 2.1 until you are using the 2.1 codebase.

Zend AMF throwing InvocationTargetException

I am trying to make a service call to a php function from flex, through Zend AMF. Most of the functions get called fine, but for one particular function, it throws the following exception:
InvocationTargetException:There was an
error while invoking the operation.
Check your operation inputs or server
code and try invoking the operation
again.
Reason: Fatal error: Call to a member
function getInvokeArguments() on a
non-object in
D:\wamp\www\ZendFramework\library\Zend\Amf\Server.php
on line 328
I am not able to debug through this - has anyone faced any issue like this before, or have any ideas how this can be debugged?
At a quick glance through ZFW's source, this appears to be a bug on their framework.
// There is no check if $this->_table[$qualifiedName] is an object, implements an interface, extends a class, only if it's set (the key exists).
$info = $this->_table[$qualifiedName];
$argv = $info->getInvokeArguments(); // Here's when you get the error.
Source: http://framework.zend.com/code/filedetails.php?repname=Zend+Framework&path=/trunk/library/Zend/Amf/Server.php
I looked in their bug tracker and haven't found anything related to this, perhaps you should open a new issue?
Additionally, you can debug the problem by grabbing the message that Flex is sending to the PHP client and making a test case out of it.
We finally realized that this was a problem in the flex project setup - don't know exactly what it was, but once we deleted and created the project again, things started working fine!

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