October: How to install package use composer?

Created on 27 Apr 2016  路  12Comments  路  Source: octobercms/october

I want to install a PHP SOCKET CLIENT , that name's aysheka/socket to octobercms. but I don't have any idea.

Question

Most helpful comment

@ulaskorpe Use plugins for that. Themes are not meant for complicated PHP functionality, that is meant to be contained with plugins and their components.

As a side note, take a read through https://luketowers.ca/blog/how-to-use-laravel-packages-in-october-cms-plugins/ to see the full process of using Laravel Packages in October plugins.

All 12 comments

There's 2 options. First one is more preferable!

  1. Initiate composer inside your plugin's folder. Put all required service providers in your composer.json require section. Do composer update. And lastly, register particular service provider in your plugin.php like this - Example Plugin - Bedard Debugbar
  2. Install october using Console install, there will be composer.json in your project's root folder, then you can require and use any service provider as you would do it on clean Laravel.

Last thing, always check Documentation before asking, or use October's IRC chat / forum instead. Good luck.

@canthis Thanks a lot, I get It.

i ve installed october , i ve installed composer and i ve downloaded a package - guzzlehttp/guzzle - via composer and set it right
i want to use that package in my theme , but how ?

there s no tutorial or documentation

@ulaskorpe Use plugins for that. Themes are not meant for complicated PHP functionality, that is meant to be contained with plugins and their components.

As a side note, take a read through https://luketowers.ca/blog/how-to-use-laravel-packages-in-october-cms-plugins/ to see the full process of using Laravel Packages in October plugins.

As above. The concept of "packages" are plugins in October, which subsequently do support composer packages in some limited fashion.

there is no composer file in my project root folder. Is that correct? or I deleted it by mistake?

@iamike Did you install via the installer or composer?

from installer

There was an issue I commented on a while back regarding your same issue. The installer installs the "consumer" version, which doesn't include the composer.json file or the tests directory. If you want to use those features, you'll need to copy them from the github into your project.

i installed october via installer,i copy composer.json from october repository into my project root , when i install guzzlehttp/guzzle,it installed failed,with the message

Installation failed, reverting ./composer.json to its original content.
  [RuntimeException]
  Could not scan for classes inside "tests/TestCase.php" which does not appea
  r to be a file nor a folder

qq 20170516114936

did where the problems is?

Yes, you need to copy the tests folder from the github as well.

@LukeTowers OK

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LukeTowers picture LukeTowers  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments

lukaszbanas-extremecoding picture lukaszbanas-extremecoding  路  3Comments

m49n picture m49n  路  3Comments

gergo85 picture gergo85  路  3Comments