Category Archives: PHP

Call to a member function setPassword() on a non-object in /vendor/socalnick/scn-social-auth/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php

I was playing with ZfcUser together with ScnSocialAuth, ScnSocialAuthDoctrineORM and BjyAuthorize using a custom entity – mostly based on the User entity provided by BjyAuthorize – and ended up with the following fatal error: Fatal error: Call to a member function setPassword() on a non-object in …/vendor/socalnick/scn-social-auth/src /ScnSocialAuth/Authentication/Adapter/HybridAuth.php on line 441 This problem is caused Read the full article…

Missing `foo=bar` POST data line in Zend\Http\Request example of generating a formatted HTTP Request from a Request object

If You’re missing the foo=bar line in the output of the example Generating a formatted HTTP Request from a Request object, just add: $request->setContent($request->getPost()->toString()); right before: echo `$request->toString(); The original (not working) example (found here): use Zend\Http\Request; $request = new Request(); $request->setMethod(Request::METHOD_POST); $request->setUri(‘/foo’); $request->getHeaders()->addHeaders(array( ‘HeaderField1’ => ‘header-field-value1’, ‘HeaderField2’ => ‘header-field-value2’, )); $request->getPost()->set(‘foo’, ‘bar’); echo $request->toString(); Read the full article…