Coder Social home page Coder Social logo

getstream / stream-php Goto Github PK

View Code? Open in Web Editor NEW
141.0 40.0 36.0 390 KB

PHP Client - Build Activity Feeds & Streams with GetStream.io

Home Page: https://getstream.io

License: BSD 3-Clause "New" or "Revised" License

PHP 98.84% Dockerfile 0.24% JavaScript 0.92%
php stream activity-feed getstream-io timeline notification-feed news-feed feed

stream-php's Introduction

Official PHP SDK for Stream Feeds

build Latest Stable Version

Official PHP API client for Stream Feeds, a web service for building scalable newsfeeds and activity streams.
Explore the docs »

Laravel Feeds Library · Report Bug · Request Feature

📝 About Stream

💡 Note: this is a library for the Feeds product. The Chat SDKs can be found here.

You can sign up for a Stream account at our Get Started page.

You can use this library to access Feeds API endpoints server-side.

For the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries (docs).

💡 Note: there is also a higher level Laravel integration which hooks into the Eloquent ORM.

⚙️ Installation

$ composer require get-stream/stream

Composer will install our latest version automatically.

PHP compatibility

Current releases require PHP 8.0 or higher, and depends on Guzzle version ^7.5.0.

If you need to use the client with an old PHP or earlier versions of Guzzle, you can grab an earlier version of this package, for example:

$ composer require get-stream/stream:"~5.0.0"

See the action for details of how it is built and tested against different PHP versions.

📚 Documentation

Our full documentation for this package is available at https://getstream.io/docs/php/.

✨ Getting started

First, signup here for a free account and grab your API key and secret.

Initiating a Client and a Feed object:

// Instantiate a new client, find your API keys in the dashboard.
$client = new GetStream\Stream\Client('YOUR_API_KEY', 'YOUR_API_SECRET');

// Instantiate a feed object
$userFeed = $client->feed('user', '1');

// If you want, you can set a custom http handler
$handler = new \GuzzleHttp\HandlerStack();
$stack->push(Middleware::mapRequest(function (RequestInterface $r) {
    echo 'Sending request to Stream Feeds API: ' . $r->getUri() . PHP_EOL;
    return $r;
}));
$client->setCustomHttpHandler($handler);

By default, the Client will target the GetStream REST API at stream-io-api.com/api. If you want to change this for some reason you can set the STREAM_BASE_URL environment variable.

Activities in a feed:

// Create a new activity
$data = [
    'actor' => '1',
    'verb' => 'like',
    'object' => '3',
    'foreign_id' => 'like:42',
];

$response = $userFeed->addActivity($data);

// The response will include Stream's internal ID:
// {"id": "e561...", "actor": "1", ...}

// Get the latest activities for this user's personal feed, based on who they are following.
$response = $userFeed->getActivities();

// Get activities directly by their ID or combination of foreign ID and time.
$response = $client->getActivitiesById(['74b9e88a-a684-4197-b30c-f5e568ef9ae2', '965f7ba5-8f1d-4fd1-a9ee-22d1a2832645']);
$response = $client->getActivitiesByForeignId(['fid:123', '2006-01-02T15:04:05.000000000'], ['fid:456', '2006-01-02T16:05:06.000000000']);

// The response will be the json decoded API response.
// {"duration": 45ms, "next": "/api/v1.0/feed/...", "results": [...]}

// Remove an activity by its ID
$userFeed->removeActivity('e561de8f-00f1-11e4-b400-0cc47a024be0');

// To remove activities by their foreign_id, set the "foreign id" flag to true.
$userFeed->removeActivity('like:42', true);

Following/follower relations of a feed:

// When user 1 starts following user 37's activities
$userFeed->follow('user', '37');

// When user 1 stops following user 37's activities
$userFeed->unfollow('user', '37');

// Retrieve followers of a feed
$userFeed->followers();

// Retrieve feeds followed by $userFeed
$userFeed->following();

Advanced activity operations:

// Create a bit more complex activity with custom fields
$data = [
    'actor' => 1,
    'verb' => 'run',
    'object' => 1,
    'foreign_id' => 'run:42',

    // Custom fields:
    'course' => [
        'name'=> 'Golden Gate park',
        'distance'=> 10,
    ],
    'participants' => ['Thierry', 'Tommaso'],
    'started_at' => new DateTime('now', new DateTimeZone('Pacific/Nauru'),
];

// Add an activity and push it to other feeds too using the `to` field
$data = [
    'actor' => '1',
    'verb' => 'like',
    'object' => '3',
    'to' => [
        'user:44',
        'user:45',
    ],
];

$userFeed->addActivity($data);

// Batch adding activities
$activities = [
    ['actor' => '1', 'verb' => 'tweet', 'object' => '1'],
    ['actor' => '2', 'verb' => 'like', 'object' => '3'],
];

$userFeed->addActivities($activities);

Advanced batching:

// Batch operations (batch activity add, batch follow)
$batcher = $client->batcher();

// Add one activity to many feeds
$activity = ['actor' => '1', 'verb' => 'tweet', 'object' => '1'];
$feeds = ['user:1', 'user:2'];

$batcher->addToMany($activity, $feeds);

// Create many follow relations
$follows = [
    ['source' => 'user:b1', 'target' => 'user:b2'],
    ['source' => 'user:b1', 'target' => 'user:b3'],
];

$batcher->followMany($follows);

Generating tokens for client-side usage:

// Generating a user token
$userToken = $client->createUserSessionToken("the-user-id");

RateLimits:

If your app hits a ratelimit, a StreamFeedException is thrown. You can get additional info by catching the exception and calling the following methods:

try {
    $client->updateActivity($activity);
}catch(StreamFeedException $e){
    $limit = $e->getRateLimitLimit();
    $remaining = $e->getRateLimitRemaining();
    $reset = $e->getRateLimitReset(); // a unix timestamp
}

Reactions:

The reactions module has the following methods.

- add(string $kind, string $activityId, string $userId, array $data=null, array $targetFeeds=null)
- addChild(string $kind, string $parentId, string $userId, array $data=null, array $targetFeeds=null)
- delete(string $reactionId)
- filter(string $lookupField, string $lookupValue, string $kind=null, array $params=null)
- get(string $reactionId)
- update(string $reactionId, array $data=null, array $targetFeeds=null)

Also see documention on the reactions endpoint

$reaction = $client->reactions()->add('like', $activity_id, 'bob');

$bob_likes = $client->reactions()->filter('user_id', 'bob', 'like');

$client->reactions()->delete($reaction['id']);

Users:

The users module has the following methods.

- add(string $userId, array $data=null, bool $getOrCreate=false)
- createReference(string $userId)
- delete(string $userId)
- get(string $userId)
- update(string $userId, array $data=null)

Also see documention on the users endpoint

$user = $client->users()->add('42');

$user =  $client->users()->update('42', array('name' => 'Arthur Dent');

$client->users()->delete('42');

Again, our full documentation with all options and methods, is available at https://getstream.io/docs/php/.

☯️ Framework integration

Laravel

There's a higher level integration with Laravel called get-stream/stream-laravel. The stream-laravel integration helps you to hook into the Laravel's Eloquent ORM to sync data to Stream.

✍️ Contributing

Project is licensed under the BSD 3-Clause.

We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.

🧑‍💻 We are hiring!

We've recently closed a $38 million Series B funding round and we keep actively growing. Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.

Check out our current openings and apply via Stream's website.

stream-php's People

Contributors

bdandy avatar dirkaholic avatar dwightgunning avatar erikaugust avatar ferhatelmas avatar github-actions[bot] avatar gmponos avatar hannesvdvreken avatar iandouglas avatar jimmypettersson85 avatar kevin-lot avatar marco-ulge avatar matthisk avatar neeckeloo avatar olix21 avatar peterdeme avatar pterk avatar ruggi avatar tbarbugli avatar teightnoteight avatar tschellenbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stream-php's Issues

Error dsiplay while connecting from client to server in zimbra api

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ServerException' with message 'Server error response [url] https://10.10.2.32:7071/service/admin/soap [status code] 500 [reason phrase] Server Error' in /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:89 Stack trace: #0 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php(33): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Message\Request), Object(GuzzleHttp\Message\Response)) #1 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Event/Emitter.php(108): GuzzleHttp\Subscriber\HttpError->onComplete(Object(GuzzleHttp\Event\CompleteEvent), 'complete') #2 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/RequestFsm.php(91): GuzzleHttp\Event\Emitter->emit('complete', Object(GuzzleHttp\Event\CompleteEvent)) #3 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/ in /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89

Please help me all.

Attempted to call function "parse_query"

I am getting this error

Attempted to call function "parse_query" from namespace "GuzzleHttp\Psr7".

I guess I am running the correct versions of Guzzle:

/app# composer info | grep guzzle
guzzlehttp/guzzle                        7.3.0     Guzzle is a PHP HTTP c...
guzzlehttp/promises                      1.4.1     Guzzle promises library
guzzlehttp/psr7                          2.0.0     PSR-7 message implemen...

The PSR7 Repo says that the parse_query has been replaced by Query::parse.

Batcher unfollowMany results in 429 Too Many Requests

Client error: POST https://api.stream-io-api.com/api/v1.0/unfollow_many/?api_key=xxxxxxx resulted in a 429 Too Many Requests

response:

{ "detail": "Too many requests, check response headers for more information.", "status_code": 429, "code": 9, "exception ": "RateLimitReached", "duration ": "0.00 ms " }

I see that the REST Documentation does not have the v1.0/unfollow_many documented. I assume this API endpoint was implemented but has been removed again?

https://github.com/GetStream/stream-php/blob/master/lib/GetStream/Stream/Batcher.php#L91

JWT Version Again

Could you please bump JWT Version again?

  • get-stream/stream[5.0.0, ..., 5.0.2] require firebase/php-jwt ^v5.0.0 -> found firebase/php-jwt[v5.0.0, ..., v5.5.1] but the package is fixed to v6.8.1 (lock file version)

Replace abandoned packages

Hi,

I see that this project is using 3 abandoned packages:

  • phpunit/phpunit-mock-objects
  • guzzle/guzzle
  • satooshi/php-coveralls

Do you plan to upgrade those dependencies? Do you need help with that?

ERROR - The request could not be satisfied same as MaxTiago's

Hi Guys,

I am getting this cloudfront error similar to MaxTiago's. But I can't seem to fix it. I am assuming, based on MaxTiago's comment, that we need to have our VPS server bind to listen all:

listen-on { any; };
listen-on-v6 { any; };

but it is still not working. Works perfectly on my local machine (XAMPP) as well as our test server in Heroku, but not on our VPS server.

ERROR - The request could not be satisfied

Type: GetStream\Stream\StreamFeedException
Message: ERROR The request could not be satisfied (bad request)

Generated by cloudfront (CloudFront)

Filename: .../vendor/get-stream/stream/lib/GetStream/Stream/Feed.php
Line Number: 102

I'm getting this exception when fetching some activities on testing setup (ubuntu, apache 2.4.7, php 7.0.8)
The same code works fine on my local setup (windows, xampp -> php 7.0.6)

Error when making call from client to server

Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException' with message 'cURL error 60: SSL certificate problem: self signed certificate in certificate chain' in C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php:126 Stack trace: #0 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php(90): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Object(GuzzleHttp\Ring\Client\CurlHandler), Array, Array) #1 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlHandler.php(78): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Object(GuzzleHttp\Ring\Client\CurlHandler), Array, Array, Array, Resource id #68) #2 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array) #3 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(30): GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client{closure}(Array) #4 C:\workspace\app\vendor\guzzlehttp\guzzle\src\RequestFsm.php(129): GuzzleHttp\Ring\Cli in C:\workspace\app\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 51

I would appreciate if you could help me get around this error

Time Parameter For Batch Methods

My Acitity
foreign_id - activity:1
time - 2021-04-04T05:47:16.065221Z

$results = $this->client->getActivities(null, [[
'activity:1',
Carbon::parse("2021-04-04T05:47:16.065221Z"),
]]);

If i pass time as "2021-04-04T05:47:16.065221Z", I got "Call to a member function format() on string" error.
So i pass like that "Carbon::parse("2021-04-04T05:47:16.065221Z")"
But i can't get activity because of the wrong time.

I see getstream php library format the time like that.
$times[] = $fit[1]->format(DateTime::ISO8601);
It returns 2021-04-04T10:27:25+0000

If i change your code like below, i can retrieve.
$times[] = $fit[1]->format('Y-m-d\TH:i:s.u');

gz#10834

All tests are failing

I actually get different test failures/errors when I've pulled it to run it locally, which is interesting. But either way, CI isn't much use if tests fail all the time.

How to enrich reactions

I want to store reactions as a Laravel eloquent object, so I can enrich it.
How to enrich this data from the feed? I added a model reference in the data field, but i'm not sure if it is possible in this way?

Feed slug validation is not consistent with GetStream docs

I am getting a feed_slug validation error with this slug: "user-aggregated".

I was able to create this feed from the dashboard and the docs don't mention much about the naming convention.

Issue at: BaseFeed::validFeedSlug

Exception received: StreamFeedException(feed_slug can only contain alphanumeric characters or underscores)

Mark Seen option does not accept an array

More of an inconsistency than anything else, but when passing options to a notification feed, the documentation states the same for both mark_seen and mark_read:

NAME        DESCRIPTION
mark_read   Comma separated list of activity ids to mark as read, or boolean true
mark_seen   Comma separated list of activity ids to mark as seen, or boolean true

And the code example given shows this being achieved with an array rather than a string:

# Mark some activities as read
$options = array('mark_read' => array('activity_id_1', 'activity_id_2'));
$results = $notification_feed->getActivities(0, 10, $options);

This works fine for mark_read but does not work for mark_seen. I believe both should behave the same way.

consistency followFeed

python, js and ruby do it like this

Get the feed object for aggregated 3 and follow user 1

aggregated3 = client.feed('aggregated:3')
aggregated3.follow('user:1')

vs

// Get the feed object for aggregated 3 and follow user 1
$aggregated3 = $client->feed('aggregated:3');
$aggregated3->followFeed('user:1');

Batch upsert collection fails with "error parsing 'data'"

Expected Behavior

Example was copied directly from official documentation

Performing upsert() with an array of arrays should batch insert/update many collection items.

Actual Behavior

Exception is thrown:

Type:        GetStream\Stream\StreamFeedException
Message:     {"detail":"Error parsing 'data'","status_code":400,"code":4,"except
ion":"InputException","exception_fields":{"data":["Error parsing 'data'"]},"dura
tion":"0.16ms"}

Steps to Reproduce the Problem

  1. Install and configure the stream-php library as described in documentation Quickstart
  2. Paste example code from Batch Endpoint documentation
$client->collections()->upsert('visitor', [
    [
        'id' => '123',
        'username' => 'johndoe',
        'favorite_color' => 'blue',
    ]
]);
  1. Execute code and exception is thrown.

Troubleshooting

  • Tried JS example code which works successfully (ruling out account-specific issues)
  • JS lib posts to "collections/" endpoint and PHP lib to "meta/" (Collections.php line 178)
  • PHP lib encapsulates "data" in an array resulting in batch requests having an "extra" array compared to the JS code.
  • Removing the extra array causes non-batch requests to fail.

Solution

I did not create a pull request because this solution is not something I've put a lot of thought into regarding performance or compatibility, it's just good enough to work.

public function upsert($collectionName, array $data)
    {
        $shouldBatch = array_filter($data, 'is_array') === $data;

        $response = $this->doRequest('POST', 'collections/', ['data' => [$collectionName => $shouldBatch ? $data : array($data)]]);
        $body = $response->getBody()->getContents();
        return json_decode($body, true);
    }

Specifications

  • Version: 3.0.0
  • Platform: PHP 7.0.33, Linux, Nginx

'Invalid Json Payload' error on updateActivities()

here is the data being posted to updateActivities() method [which is exactly same when new activity is added]

(
[actor] => admin
[verb] => content_published
[object] => Post: Grading Go Bags
[title] => Grading Go Bags
[started_at] => Array
(
[date] => 2018-08-08 13:42:21.000000
[timezone_type] => 3
[timezone] => UTC
)

[status] => new status on activity update is published
[content_url] => This is test url to see if activity can be updated using this way.
[time] => 2018-07-23 14:30:16
[meta] => Array
    (
        [post_type] => post
        [excerpt] => The quality of earthquake survival kits ranges from solid to shaky. We rated several emergency kits on the market to find the survival bag most likely to come in handy when The Big One hits. 
        [category] => TOOLS
        [story_headline] => Getting Ready for the Big One
        [deck_headline] => The quality of earthquake survival kits ranges from solid to shaky
        [author] => Beth Spotswood
        [thumbnail] => Array
            (
                [url] => http://localhost/altaonline.com/wp-content/uploads/2018/06/ATA050118starwars_img01.jpg
                [alt] => 
            )

    )

[foreign_id] => 3798

)

and it says 'Invalid JSON Payload with following trace

PHP Fatal error: Uncaught exception 'GetStream\Stream\StreamFeedException' with message '{"detail":"Invalid JSON payload","status_code":400,"code":4,"exception":"InputException","duration":"0.14ms"}' in C:\wamp64\www\altaonline.com\wp-content\plugins\feed-manager\vendor\get-stream\stream\lib\GetStream\Stream\Feed.php:100

auth naming

secret = the api secret
token = a token for accessing a feed (generated from the secret)
authorization = the header sent for authorization combining the feed name and the token

expose signing

the readme and code should explain how to generate a token for usage in the client side API

Add interfaces for the Feed and the Client

Hi,

I think it should be a great idea to implements interfaces in this project.
We are using the SDK in Symfony, and we are trying to cover our code with some behat tests.
By implementing some interfaces, I could be able to create Dummies of the Feed and the Client objects in my tests.

I Can do a PR for that, do you have any good practice for that? Naming conventions, specific namespace?
I'm also wondering why all the methods are public? Some of them seem to be internal and should be protected/private, no?

Add child reaction fail with {"detail":"Error parsing 'target_feeds'","status_code":400,"code":4,"exception":"InputException","exception_fields":{"ta (truncated...)

Steps to reproduce
Add child reaction with target_feed array parameter.

Current Behavior
When i am adding child reaction with target_feed, it returns this error. That i think, in the addChild function which is converting target_feed array to comma separated string. Like this
if( $targetFeeds !== null ){
$payload['target_feeds'] = join(',', $targetFeeds);
}
if i change to this
$payload['target_feeds'] = $targetFeeds;
It is working fine.

Can't log request/response to file

For debugging I'd like to be able to log out all requests and responses from the Stream API to a file, would it be possible to expose the Guzzle client in some way so we can add additional log handlers, etc?

Guzzle 6.0 Issue

Message: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in /vendor/guzzlehttp/guzzle/src/Client.php on line 87 and defined

Use of undefined constant VERSION

Running getstream with Symfony 5.2 on PHP 7.4.

This notice appears frequently:

NOTICE: PHP message: PHP Warning: Use of undefined constant VERSION - assumed 'VERSION' (this will throw an Error in a future version of PHP) in /srv/http/vendor/get-stream/stream/lib/GetStream/Stream/Feed.php on line 67

Best regards.

gz#10568

Restrictive package requirements of Guzzle

Guzzle is required, but is specified to be as follows:

"guzzlehttp/guzzle": "6.0.*"

Instead, given that Guzzle follows Semantic Versioning, could this please be changed to the following to ensure maximum compatibility when integrating with large projects?

"guzzlehttp/guzzle": "^6.0"

Erro trying to make a request to a https url

Hi,

I'm trying to make a request to this url https://www.whoscored.com/?t=Hart, but I'm getting the following error:

Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFa in C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

I know of course is related with the SSL connection, but I'm kind of lost in this aspect. I've made some search over the internet, but I haven't found a solution for the problem.

Could you help me with this? Some guide on how to solve the problem...

This is the code that make the request:

$client = new Client();

$url = 'http://www.whoscored.com/Search/?t=' . $player["name"];

$crawler = $client->request('GET', $url);

Is there anyway to make the call without a cert?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.