Happyr / LinkedIn-API-client

A library to connect with LinkedIn API. Perfect if you are looking for an API client or SDK for LinkedIn
MIT License
198 stars 97 forks source link

LinkedIn cannot be resolved to a type #155

Closed pratika2395 closed 6 years ago

pratika2395 commented 6 years ago
Q A
Bug? yes
New Feature? no
Are you using composer? yes
Version 1.6.3

Actual Behavior

Fatal errors: " Fatal error: Uncaught exception 'Http\Discovery\Exception\DiscoveryFailedException' with message 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors - Puli Factory is not available ' in /opt/lampp/htdocs/rightcomply/review_rating_system/LinkedIn/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php:41 Stack trace: #0 /opt/lampp/htdocs/rightcomply/review_rating_system/LinkedIn/vendor/php-http/discovery/src/ClassDiscovery.php(75): Http\Discovery\Exception\DiscoveryFailedException::create(Array) #1 /opt/lampp/htdocs/rightcomply/review_rating_system/LinkedIn/vendor/php-http/discovery/src/MessageFactoryDiscovery.php(25): Http\Discovery\ClassDiscovery::findOneByType('Http\Message\Me...') #2 /opt/lampp/htdocs/rightcomply/review_rating_system/LinkedIn/src/Http/RequestManager.php(83): Http\Discovery\MessageFactoryDiscovery::find() #3 /opt/lampp/htdocs/rightcomply/review_rating_system/LinkedIn/src/Http/RequestManager.php(3 in /opt/lampp/htdocs/rightcomply/review_rating_system/LinkedIn/vendor/php-http/discovery/src/MessageFactoryDiscovery.php on line 27 "

Expected Behavior

A LinkedIn Login and post status should be done

Steps to Reproduce

<?php require_once (DIR.'/LinkedIn/vendor/autoload.php'); //require_once (DIR.'/LinkedIn/src/LinkedIn.php');

$linkedIn=new Happyr\LinkedIn\LinkedIn('xxxxxx', 'xxxxx'); if ($linkedIn->isAuthenticated()) { $user=$linkedIn->get('v1/people/~:(firstName,lastName)'); echo "Welcome ".$user['firstName'];

exit();

} elseif ($linkedIn->hasError()) { echo "User canceled the login."; exit(); } $url = $linkedIn->getLoginUrl(); echo "Login with LinkedIn"; $linkedIn->setAccessToken('access_token_from_db');

$options = array('json'=> array( 'comment' => 'Im testing LinkedIn Share Sys!!', 'visibility' => array( 'code' => 'anyone' ) ) ); $result = $linkedIn->post('v1/people/~/shares', $options); var_dump($result); ?>

Possible Solutions

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" php composer.phar php composer.phar install

--I tried these commands. vendor folder and autoload.php file are created.

I don't know what the issue is. I googled by searching for the error. but no solution

Nyholm commented 6 years ago

See #156