简体   繁体   中英

PHP framework AMPHP/THREAD used with SYMFONY - Where does it have to be installed?

I am looking to implement the framework amphp/thread , with Symfony3, which I ve read about in this article ( https://www.mullie.eu/parallel-processing-multi-tasking-php/ ).

I'd looked at the setting process on the git page: https://github.com/amphp/thread .

I've followed the checklist:

  • PHP5.5+ = OK Php 5.5.12
  • pecl/pthread = OK I did install it as explained on Windows8

Now, 3rd task on the checklist , I have the installation of the framework itself (amphp/thread) left to do.

I am a bit confuse, because it is not an "official" Symfony bundle. So I don't think I can put it under [my_symfony_project]/vendor/ and refer to it in the file [my_symfony_project]/app/AppKernel.php. So how do one do in this case:

  • Do one put the directory of the library under the root directory [my_symfony_project]?
  • And afterwards, how can one refer to it in the Symphony class/file, should I write: "use amphp/thread" between the namespace declaration of my Symfony file and the class code itself?

You can simply install the library with composer, as example launching this command from the root of your project:

>php composer.phar require amphp/thread

And use it in your code directly: the composer process generate the correct autoloader for you. No necessary add to the list of the Symfony2 bundle (is not a bundle).

Hope this help

You will need to install the package by adding the following to your composer.json file:

"require": {
    "amphp/thread": "0.8.1"
}

Then run "composer install" on your server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM