Giter Site home page Giter Site logo

Comments (6)

aoberoi avatar aoberoi commented on July 19, 2024

@liyifei1987 do you have experience using composer? it sounds like if you want to adopt composer for your project (as we recommend) you might need to spend a few minutes learning how its used. here is a good resource: http://code.tutsplus.com/tutorials/easy-package-management-with-composer--net-25530

If you are trying to use the SDK in a project that does not use composer, I recommend downloading the latest release (https://github.com/opentok/OpenTok-PHP-SDK/releases), unzipping the files, and placing them in your project. In order to load the files, you will either need to use a PSR-0 compliant autoloader (such as http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/class-loading.html) or use require_once to load the OpenTok classes into your project. If you are just using require_once you will also need to load classes from the dependencies: guzzle/guzzle@~3.7, justinrainbow/json-schema@~1.3.

from opentok-php-sdk.

liyifei1987 avatar liyifei1987 commented on July 19, 2024

I don't have experience about composer.
I think the composer.json is not valid.

from opentok-php-sdk.

liyifei1987 avatar liyifei1987 commented on July 19, 2024

Hi,
Sorry, I have still some questions.
Yesterday, I succeeded to install composer and build the php sdk.
Thanks for your help yesterday.
But for now, I cannot create session.
Here is my code.

"create_session.php"

create_session($_SERVER["REMOTE_ADDR"], array('mediaMode' => MediaMode::ROUTED)); //$session = $apiObj->create_session(); var_dump($session); echo "here3"; echo $session->getSessionId(); ``` ?>

And the outputs are as follow:

here here1object(OpenTok\OpenTok)#2 (3) { ["apiKey":"OpenTok\OpenTok":private]=> string(8) "44888502" ["apiSecret":"OpenTok\OpenTok":private]=> string(40) "95300455e523ee423308ca28512fa4ae5408c2ca" ["client":"OpenTok\OpenTok":private]=> object(OpenTok\Util\Client)#3 (11) { ["apiKey":protected]=> string(8) "44888502" ["apiSecret":protected]=> string(40) "95300455e523ee423308ca28512fa4ae5408c2ca" ["configured":protected]=> bool(true) ["defaultHeaders":protected]=> object(Guzzle\Common\Collection)#5 (1) { ["data":protected]=> array(0) { } } ["userAgent":protected]=> string(82) "OpenTok-PHP-SDK/2.2.2 Guzzle/3.9.1 curl/7.22.0 PHP/5.4.28-1+deb.sury.org~precise+1" ["config":"Guzzle\Http\Client":private]=> object(Guzzle\Common\Collection)#4 (1) { ["data":protected]=> array(1) { ["curl.options"]=> array(3) { [10065]=> string(74) "/var/www/OpenTok/vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem" [64]=> bool(true) [81]=> int(2) } } } ["baseUrl":"Guzzle\Http\Client":private]=> string(23) "https://api.opentok.com" ["curlMulti":"Guzzle\Http\Client":private]=> NULL ["uriTemplate":"Guzzle\Http\Client":private]=> NULL ["requestFactory":protected]=> object(Guzzle\Http\Message\RequestFactory)#6 (3) { ["methods":protected]=> array(25) { ["getInstance"]=> int(0) ["__construct"]=> int(1) ["fromMessage"]=> int(2) ["fromParts"]=> int(3) ["create"]=> int(4) ["cloneRequestWithMethod"]=> int(5) ["applyOptions"]=> int(6) ["visit_headers"]=> int(7) ["visit_body"]=> int(8) ["visit_allow_redirects"]=> int(9) ["visit_auth"]=> int(10) ["visit_query"]=> int(11) ["visit_cookies"]=> int(12) ["visit_events"]=> int(13) ["visit_plugins"]=> int(14) ["visit_exceptions"]=> int(15) ["visit_save_to"]=> int(16) ["visit_params"]=> int(17) ["visit_timeout"]=> int(18) ["visit_connect_timeout"]=> int(19) ["visit_debug"]=> int(20) ["visit_verify"]=> int(21) ["visit_proxy"]=> int(22) ["visit_cert"]=> int(23) ["visit_ssl_key"]=> int(24) } ["requestClass":protected]=> string(27) "Guzzle\Http\Message\Request" ["entityEnclosingRequestClass":protected]=> string(42) "Guzzle\Http\Message\EntityEnclosingRequest" } ["eventDispatcher":protected]=> object(Symfony\Component\EventDispatcher\EventDispatcher)#9 (2) { ["listeners":"Symfony\Component\EventDispatcher\EventDispatcher":private]=> array(3) { ["request.sent"]=> array(1) { [100]=> array(1) { [0]=> array(2) { [0]=> object(Guzzle\Http\RedirectPlugin)#8 (1) { ["defaultMaxRedirects":protected]=> int(5) } [1]=> string(13) "onRequestSent" } } } ["request.clone"]=> array(1) { [0]=> array(1) { [0]=> array(2) { [0]=> object(Guzzle\Http\RedirectPlugin)#8 (1) { ["defaultMaxRedirects":protected]=> int(5) } [1]=> string(14) "cleanupRequest" } } } ["request.before_send"]=> array(1) { [0]=> array(2) { [0]=> array(2) { [0]=> object(Guzzle\Http\RedirectPlugin)#8 (1) { ["defaultMaxRedirects":protected]=> int(5) } [1]=> string(14) "cleanupRequest" } [1]=> array(2) { [0]=> object(OpenTok\Util\Plugin\PartnerAuth)#10 (2) { ["apiKey":protected]=> string(8) "44888502" ["apiSecret":protected]=> string(40) "95300455e523ee423308ca28512fa4ae5408c2ca" } [1]=> string(12) "onBeforeSend" } } } } ["sorted":"Symfony\Component\EventDispatcher\EventDispatcher":private]=> array(0) { } } } } here2

I can arrive at only "here2";
Could you please help me to fix this bug?
The path of the file "create_session.php" is - "/var/www/OpenTok/create_session.php"
The vendor folder - "/var/www/OpenTok/vendor"
OpenTok.php - "/var/www/OpenTok/OpenTok.php"

Thank you.
Best Regards.

from opentok-php-sdk.

aoberoi avatar aoberoi commented on July 19, 2024

I'm going to close this Issue since it seems like there were no issues building anymore. We can continue to discuss the problem you are having on the other Issue you created. Please do not post the same message more than once in the future, it makes things harder for me to work with.

from opentok-php-sdk.

deepak01230 avatar deepak01230 commented on July 19, 2024

Hi Frnds ,
i am new to opentok and dont know how to get the open tok package in my project folder.
I have successfully run the composer it does not show the open tok folder to use.
Pls help me to resolve the problem ?
$apiObj = new OpenTok($API_KEY, $API_SECRET); does not works.

from opentok-php-sdk.

aoberoi avatar aoberoi commented on July 19, 2024

@deepak01230 please send an email to [email protected] with a full description of your problem.

from opentok-php-sdk.

Related Issues (20)

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.