wa0x6e / Cake-Resque

Resque plugin for CakePHP : for creating background jobs that can be processed offline later
MIT License
159 stars 56 forks source link

Composer.phar installation breaks all the things #13

Closed josegonzalez closed 12 years ago

josegonzalez commented 12 years ago

If I already have a deploy strategy that does not involve composer - like git subtrees or git submodules - then your alternative method breaks all the things for me.

Composer is great and all, but honest you should also allow me to store my dependencies however I want.

wa0x6e commented 12 years ago

CakeResque requires only one dependency : php-resque-ex

The code can be easily edited to use your own php-resque-ex installation, and you could get rid of Composer. Problem is that php-resque-ex also requires composer, so you can't be totally free of composer.

What are you seeking ? Did you installed php-resque somewhere, and you want want CakeResque to use it, without installing it in vendor ? Or you want an alternative solution to Composer, to install all submodules, like git submodule ? (and keep all libraries in vendor)

josegonzalez commented 12 years ago

So I am using an older version of CakeResque, which works great, since it used an internal version of Resque. All I needed to do was add 1 submodule and I was done.

With the new version, composer handles it, which is fine I guess, except there is no way for me to hook into my deploy process cleanly. I can run composer on the composer.json file, but then you are using your .gitignore so I can't add those deps to my project using git submodules.

Now, I know composer is a step forward, but this seems to be a step-backwards. Your project should simply check to see if Resque is loaded somehow - perhaps let me define my own autoloader for example, or let me require it in advance - before requiring me to shit composer stuff all over a gitignore'd directory.

Just my two cents - sorry for being a bit blunt.

I got around this in another project by using git subtrees, then removing your gitignore file and manually adding the internal stuff to the repo. Not really possible with git submodules.

wa0x6e commented 12 years ago

I see your point.

That's easily solved if you're using the original php-resque library, but not if you're using the forked php-resque-ex library. php-resque-ex requires 2 other dependencies via Composer.

What I could do is add another setting in bootstrap, where you define the path of your php-resque library. That way, you can install it as a submodule wherever you want (but vendor), and it doesn't require Composer.

The other option is the one I am using for my deploy : run composer update on the staging server with a git post-hook.

josegonzalez commented 12 years ago

I think in general, dependencies should be specified for the application, or at least installable in the application, not in a subcontext for a vendor. That leads to issues where multiple versions of a library can be enabled etc.

If you could make it a bootstrap option, that would be lovely.

wa0x6e commented 12 years ago

Version 1.2.6 should take care of that.

Use the already existing CakeResque.Resque.lib option in bootstrap to point to your php-resque library.

For the multiple versions of library issues, Composer handle it perfectly by creating a composer.lock file, shared among everyone working on the same project. I've removed it from .gitignore.