barbushin / multirequest Goto Github PK
View Code? Open in Web Editor NEWPHP library for easy and flexible multithread requests handling by CURL
License: MIT License
PHP library for easy and flexible multithread requests handling by CURL
License: MIT License
Hi
I have integrated your lib in my project but i am getting MultiRequest\Exception: Callback "debugRequestComplete" with name "onRequestComplete" is not callable
Line 233 in Request.php
$this->responseContent
is
string(188) "
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="int2.css">
</head>
<body>
Błąd. Brak numeru paczki.
</body></html>
"
$this->serverEncoding
is string(5) "utf-8"
and
$clientEncoding
is string(12) "windows-1250"
PHP 5.5.9-1ubuntu4.9 (cli)
Hello -
Love this library - can't thank you enough for it. However, I'm trying to find a way to send alternate header content types. For example, the URL I'm trying to query returns data in XML, and I would like to get the data back in JSON form. Their support has informed me I need to "pass the header value of
Content-Type: application/json; charset=utf-8"
I've tried modifying line 139 in Request.php
$this->addHeader('Content-Type: application/x-www-form-urlencoded; charset=' . $clientEncoding);
I've also tried adding an array element to the protected $headers variable in Request.php
protected $headers = array('Expect:','application/json');
but neither of these options seem to return the data in JSON.
Am I on the right track with my thinking, or is it something I need to get back in touch with their support? I would appreciate any guidance on this topic!
Thanks again!
Last version published to Packagist was on 2014-10-16.
Доброго времени суток. Подскажите пожалуйста как в метод onRequestComplete передать параметром функцию из этого же класа, array('this','RequestComplete'), не работает.
Вопрос наверное даже не по либе, а по самому PHP. Если не сложно, подскажите.
Я знаю что CURL либа супортит шаринг TCP конекшенов и если нам нужно сделать N запросов, то мы может один раз сделать curl_init и после чего выполнять эти запросы, меняя только базовые параметры. Когда закончили - вызываем curl_close. В этом случае сама либа CURL будет юзать тот же самый TCP конекшен, который она открыла при первом запросе.
Но можно ли шарить эти конекшены между разными PHP реквестами ?
У меня есть сервер, на нём десятки сайтов. Каждая страница должна делать 1 запрос на сторонюю API. Будет ли эта логика тут работать ? Могут ли разные PHP реквесты обращаюсь в CURL либу, по сути шарить между собой конекшены или нет ?
И вообще реально ли такое сделать ?
Я знаю что PHP может работать в 2х режимах:
Ведь если для каждого реквеста мне нужно делать запрос в АПИ, то количество сокетов возрастёт в два раза (на каждый реквест - запрос в АПИ). И поскольку сокеты система сразу не освобождает, то будет проблема в доступных сокетах.
Что Вы можете подсказать по этому вопросу ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.