Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have you heard of Composer ? #39

Closed
wants to merge 1 commit into from
Closed

Have you heard of Composer ? #39

wants to merge 1 commit into from

Conversation

cyqui
Copy link

@cyqui cyqui commented Jul 9, 2012

Magento is starting to have a lot of dependencies, most of the time heavies dependencies (Zend, etc..) and in real Magento projects we also have dependencies.

Composer is a tool that manage dependencies in PHP. It used in Symfony 2.1 to manage Symfony's dependencies.
Very nice PPT here:
http://slides.seld.be/?file=2012-06-07+Dependency+Management+with+Composer.html

There is already thousands PHP Packages that has a composer.json file (like this one) describing their packages.
For example, one of Magento 2 dependencies already use it :
https://github.com/phpseclib/phpseclib/blob/master/composer.json
If you use it as well you will benefit from it.

Once you will have a composer.json file, your project will be crawlable by "packagist" :
http://packagist.org

My company is using packagist internally to index reusable packages.
It will be awsome if we can use Composer within Magento 2.0.

Thanks in advance

PS:
The composer.json i'm suggesting here is minimalistic, but that's a start, feel free to ask if you need infos :)
(i'm pretty sure that Composer authors will provide supports as well if you need it)

@magento-team
Copy link
Contributor

@cyqui Thanks for the suggestion!
We're asking our product management if it is OK to become early adopters of Composer.

@magento-team
Copy link
Contributor

A basic version of composer.json will be added during next update(s) and will be submitted to http://packagist.org/

@fabian
Copy link

fabian commented Jul 11, 2012

Cool! 👍

@Seldaek
Copy link

Seldaek commented Jul 11, 2012

@mage2-team if you guys need help or want a review of the composer.json before you release it, feel free to get in touch with me. It's easy to get things wrong at first.

magento-team added a commit that referenced this pull request Jul 20, 2012
* Implemented inheritance of locales. Inheritance is declared in `app/locale/<locale_name>/config.xml`
* Moved declaration of modules from `app/etc/modules/<module>.xml` to `app/code/<pool>/<namespace>/<module>/config.xml`
* Implemented ability to match URLs in format `protocol://base_url/area/module/controller/action` (as opposite to only `module/controller/action`), utilized this feature in backend (admin) area
* Added product attribute set "Minimal Attributes", which consists of required system attributes only
* Improved customers import:
  * Implemented "Delete" behavior for importing customers, customer addresses and financial data
  * Implemented "Custom" behavior, which allows to specify behavior for each item directly from the imported file
* Updated performance tests:
  * Enabled Product View, Category View, Add to Cart, Quick Search and Advanced Search scenarios
  * Added ability to specify configuration parameters per scenario and refactored bootstrap of performance tests
* Implemented `mage.js` for base JavaScript initialization of the application
* Implemented new JS translation mechanism. JavaScript translations are loaded by locale code stored in cookies
* Implemented unit tests for JavaScript widgets in Visual Design Editor
* Added jQuery plugins: Cookie, Metadata, Validation, Head JS
* Fixed issues:
  * Impossible to add configurable product to the cart
  * Impossible to apply Shopping Cart Price Rule with any conditions to cart with simple and virtual product
  * Memory leak in email templates
  * Impossible to place order with Multiple Addresses using 3D Secure
  * Required product attributes are not exported
  * "Forgot Your Password" link on checkout page inactive after captcha reloading
  * Validation of "Number of Symbols" field in Captcha configuration doesn't work
  * Other small fixes
* GitHub requests:
  * [#37](#37) -- fixed particular case of "HEADERS ALREADY SENT" error in WYSIWYG thumbnail
  * [#39](#39) -- added `composer.json`
  * [#40](#40) -- fixed generation of "secret key" in backend URLs to honor `_forward` in controllers
@magento-team
Copy link
Contributor

As you can see above, the latest update mentions that composer.json has been added. Unfortunately because of a bug in our publishing scripts, it actually hasn't been published.
We apologize for the mistake and will fix it with next update.

magento-team added a commit that referenced this pull request Jul 26, 2012
* Implemented Magento Validator library in order to have clear solid mechanism and formal rules of input data validation
* Moved translations to module directories, so that it is much more convenient to manage module resources
* Updated inline translation mechanism to support locales inheritance
* Implemented ability to navigate through pending reviews with Prev/Next buttons, no need to switch to grid and back
* Fixed issues:
  * Unable to use shell-installer after changes in Backend area routing process
  * Incorrect redirect after entering wrong captcha on the "Forgot your user name or password?" backend page
  * Translation is absent for several strings in Sales module `guest/form.phtml` template
  * Exception during installation process, when `var` directory is not empty
  * Node `modules` is merged to all modules' config XML-files, although it must be merged to `config.xml` only
* GitHub requests:
  * [#39](#39) -- added `composer.json`, which was announced at previous update, but mistakenly omitted from publishing
@magento-team
Copy link
Contributor

The composer.json was successfully published with the latest update.

@magento-team
Copy link
Contributor

Magento is available at packagist.org: http://packagist.org/packages/magento/community-edition
To try it out, create a composer.json:

{
    "require": {
        "magento/community-edition": "dev-master"
    }
}

Then run the command:

php /path/to/composer.phar install

@cyqui
Copy link
Author

cyqui commented Jul 26, 2012

Good to know.
Thanks :)

@sprankle
Copy link

I love the fact that your using composer, I would be more awesome if you used it to its fullest extent.
If you removed the library portion and inserted composer calls to their dependencies I feel you would be able to update and manage those dependencies more easily. Not to mention the community could update with a simple composer update command. I know the Zend Framework 2 adopted composer.
https://packages.zendframework.com/#composer

@barryvdh
Copy link
Contributor

barryvdh commented Aug 8, 2013

I agree, composer is becoming (or already is) the default way to manage dependencies. And many libraries already support it.
https://packagist.org/packages/zendframework/zendframework1
https://packagist.org/packages/symfony/yaml
https://packagist.org/packages/twig/twig
https://packagist.org/packages/phpseclib/phpseclib
PEAR packages: http://getcomposer.org/doc/05-repositories.md#pear

The Mage/Magento and other library files from Magento itself could be put in a stand-alone repository, so they can be downloaded bij composer also.
This would make easier to update a single library and faster to install/upgrade (but a version with vendors can offcourse be supplied).

If you make a base project (this repo), you can just do composer create-project magento/magento2.
It would be even better of it would also be possible to install extensions/modules by just adding them to the required libs in composer.json.

@jefflyne
Copy link

I would also like dependencies to be managed by composer where possible.

Extensions/Module support would be awesome. Never will I use Connect Manager.

@ArnaudLigny
Copy link

The Mage/Magento and other library files from Magento itself could be put in a stand-alone repository, so they can be downloaded bij composer also.
This would make easier to update a single library and faster to install/upgrade (but a version with vendors can offcourse be supplied).

If you make a base project (this repo), you can just do composer install magento/magento2.
It would be even better of it would also be possible to install extensions/modules by just adding them to the required libs in composer.json.

👍

@real34
Copy link
Member

real34 commented Jan 11, 2014

The topic of having connect packages installable with composer has been discussed at magento-hackathon/composer-repository#31 but would need some help from the Magento connect team.
Who from the Magento team could help with this? (I got redirected on Github from Twitter : https://twitter.com/pierremartin/status/418309405348597761)

@benmarks
Copy link
Contributor

@real34 Doesn't that seem like a different request than what is being asked here?

That said, I've sent a note to the person most directly responsible for managing Connect.

@real34
Copy link
Member

real34 commented Jan 12, 2014

Yes, it is indeed. Should I create an issue in this repository for tracking this? It is not related to code and I did not know the best place to send such a request...

@benmarks
Copy link
Contributor

Magento is working on a community contact point for these types of inquires. Right now they all seem to be heading to Piotr Kaminski via Twitter.

magento-engcom-team pushed a commit that referenced this pull request May 30, 2021
* MC-41987: Fix jQuery.isFunction()
    - Replace isFunction()

* MC-41987: Fix jQuery.isFunction()
    - Replace isFunction()
magento-devops-reposync-svc pushed a commit that referenced this pull request Mar 13, 2024
@FabXav FabXav mentioned this pull request Oct 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants