How to install Composer to use Ratchet ? |
Hi,
I would like to test and learn websocket. I found a lot of information, but I cannot understand what I have to do to have enabled Composer (http://socketo.me/) ? Is it enough to enable Composer in the CI config file ? Nothing to install ? Anything else to do to make it work ? => $config['composer_autoload'] = TRUE; // default FALSE Is what written in CI documention enough ? => https://codeigniter.com/user_guide/gener...t=composer According to this tutorial : https://c-mh.fr/posts/websockets-en-php-...n-y-parait I can read : "Ensuite, il vous faut composer, le "package manager" de PHP. Si vous ne l'avez pas, commencez par suivre ces instructions. En quelques mots, considérez cet outil comme un bidule qui va vous télécharger plein de bouts de codes et librairies PHP, à la demande et créer un fichier "composer.json" ainsi qu'un dossier "vendor" dans votre projet. En vérité, l'outil possède une super documentation et ça vaut le coup de se pencher sur le sujet si vous ne l'avez pas encore fait." Google translation : "Then you have to compose, the "package manager" of PHP. If you do not have it, start by following these instructions. In a nutshell, consider this tool as a gadget that will download you lots of code snippets and PHP libraries, on demand and create a "composer.json" file and a "vendor" folder in your project. In truth, the tool has great documentation and it's worth looking into it if you have not done it yet." So, if I understand well, it says that after installation, I will have a "composer.json" file. I found one composer.json file at /var/www/myproject.loca/ (myproject.local is CI framework) This file is containing : Code: { It does not really sounds like something about Composer ? Or am I wrong ? So, I guess, I need an other composer.json file ? How to make it, and where to install it ? I do not have to do this ? 4 PHP commands to install Composer => https://getcomposer.org/download/ If Composer is already given with CI, I do not have to run, at least, the two last commands ? Code: php composer-setup.php This tutorial also says I will find a "vendor" directory in my project, but I did not find any "vendor" directory in "application" directory, and anywhere else. Thank you for helping and guide me ! Nils
I finaly tryed to execute
Code: composer require cboden/ratchet This let me understand that I need to install Composer. I did that with Code: apt install composer After that step done, Code: composer require cboden/ratchet The tutorial says : Quote:Si votre projet est vierge de tout contexte "Composer", l'outil va vous demander diverses informations pour créer votre fichier "composer.json". Si tel est le cas, exécutez ensuite la commande suivante : Google translation : Quote:If your project is blank of any "Composer" context, the tool will ask you for various information to create your "composer.json" file. If this is the case, then run the following command : composer install I dot not know if my brand new CI is blank or not of any "Composer context", how can I check this ? Do I have to run, or not Code: composer install Note that, the command Code: composer require cboden/ratchet Thank you for helping, Nils
I guess I have to add to CI composer.json file, the code found in composer.json file made by the command "composer require cboden/ratchet" ?
And copy the "vendor" directory made by the command "composer require cboden/ratchet" to CI "application" directory ? Right ? |
Welcome Guest, Not a member yet? Register Sign In |