gpraveenonline / simple-linkedinphp

Automatically exported from code.google.com/p/simple-linkedinphp
0 stars 0 forks source link

Get error when trying to load class #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Installed and downloaded all files
2. Created an empty php file
3. Imported code (require_once('linkedin_3.2.0.class.php');)

What is the expected output? What do you see instead?
Expected the page to stay empty since the file was successfully loaded, but I 
get a weird error:
Parse error: syntax error, unexpected T_FUNCTION in 
/home/simichae/public_html/websites/linkedin/linkedin_3.2.0.class.php on line 
259

What version of the product are you using? On what operating system?
3.2.0 (latest)

Please provide any additional information below.
I am a newbie so I am sure I am doing something wrong but I have no idea what 
that is.

Sorry to bug, I'll understand if you can't help.

Thanks,
Michael.

Original issue reported on code.google.com by micha...@gmail.com on 8 Dec 2011 at 3:06

GoogleCodeExporter commented 8 years ago
Hello,

I have found a solution to this problem.

-First of all, the problem is due to the fact that only PHP 5.3+ allows this 
way of using array_walk:

array_walk($myArray, function(&$value, $key) {})

-To remedy this problem, define a new function as follows (before the 
declaration of the checkResponse function on line 256)

private function is_response_int($value, $key) {

        if(!is_int($value)) {
                throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
            }
    }

-And on the line where array_walk is used, replace the whole call to it by:

array_walk($http_code_required, 'is_response_int');

Hope this helps, and if you need any clarifications, feel free to contact me!

Cheers,
Georges

Original comment by gc.sabb...@gmail.com on 9 Dec 2011 at 12:45

GoogleCodeExporter commented 8 years ago
This is a known issue 
http://code.google.com/p/simple-linkedinphp/issues/detail?id=11

Original comment by p...@fiftymission.net on 9 Dec 2011 at 9:08

GoogleCodeExporter commented 8 years ago
Hi
   Thanks for the message, Yes it resolves this issue but when i tried to send the status update via api it said 
profile data could not be retrieved.
  Is this coz of the changes that we made earlier in your post ? Or what else the reason could be.

Original comment by abdulbas...@gmail.com on 5 Jun 2012 at 1:35