magento-hackathon / magento-composer-installer

Composer installer for Magento modules
210 stars 154 forks source link

API available? #82

Closed peterukena closed 10 years ago

peterukena commented 10 years ago

Is there an API available for asking questions to the repo like which version a module currently has?

Flyingmana commented 10 years ago

composer.phar show --installed gives the following output in my test repositorys:

magento:
connect20/Cm_RedisSession 1.8.0.0 Redis session connect20/Interface_Adminhtml_Default 1.8.1.0 Default interface for Adminhtml connect20/Interface_Frontend_Base_Default 1.8.1.0 This is a Magento themes base connect20/Interface_Frontend_Default 1.8.1.0 Default interface for Frontend connect20/Interface_Install_Default 1.8.0.0 Default interface for Install connect20/Lib_Cm 1.8.0.0 Redis adapter for Zend_Cache connect20/Lib_Credis 1.8.0.0 Credis Library connect20/Lib_Google_Checkout 1.8.1.0 Google Checkout Library connect20/Lib_Js_Calendar 1.51.1.1 Javascript Calendar for Magento connect20/Lib_Js_Ext 1.7.0.0 Extjs Javascript Libraries for Magento connect20/Lib_Js_Mage 1.8.1.0 Javascript Libraries for Magento connect20/Lib_Js_Prototype 1.7.0.04 Prototype and Scriptaculous Javascript Libraries for Magento connect20/Lib_Js_TinyMCE 3.4.7.0 TinyMCE Javascript Libraries for Magento connect20/Lib_LinLibertineFont 2.8.14.1 Libertine Open Fonts Project fonts for PDF print-outs connect20/Lib_Mage 1.8.0.0 Mage Library connect20/Lib_Magento 1.8.0.0 Magento Library connect20/lib_phpseclib 1.5.0.0 connect20/Lib_Varien 1.8.1.0 Varien Library connect20/lib_zf 1.11.1.0 connect20/lib_zf_locale 1.11.1.0 connect20/Mage_All_Latest 1.8.1.0 Metapackage for latest Magento 1.8.1.0 release connect20/Mage_Centinel 1.8.0.0 3D Secure Card Validation connect20/Mage_Compiler 1.8.1.0 This module compiles all files of a Magento installation and creates a single include path to increase performance connect20/Mage_Core_Adminhtml 1.8.1.0 Magento Administration Panel connect20/Mage_Core_Modules 1.8.1.0 Collection of Magento Core Modules connect20/Mage_Downloader 1.8.1.0 Magento Downloader connect20/Mage_Locale_en_US 1.8.1.0 en_US locale connect20/Magento_Mobile 1.8.0.0231 Magento Mobile Xml Interface connect20/Phoenix_Moneybookers 1.3.2 Moneybookers payment gateway integration magento-hackathon/magento-composer-installer dev-master cafb486 Composer installer for Magento modules

modules:
fbrnc/Aoe_Profiler v0.3.0 Magento Profiler fbrnc/Aoe_TemplateHints v0.4.0 Advanced Template Hints for Magento firegento/magesetup 2.1.1 <p>Central features of MageSetup are:</p><ul><li>Setting of important configuration settings</li><li>Predefined tax settings... firegento/psr0autoloader dev-master 61be255 This extension adds a PSR-0 autoloader before the Varien autoloader magento-hackathon/magento-composer-installer dev-master cafb486 Composer installer for Magento modules

Is this what you are asking for? Or did you mean something like this? https://www.versioneye.com/user/projects/530dd574ec137541840003ed

peterukena commented 10 years ago

More like the first thing - I want to do a check (for HealthCheck or MageMonitoring ;) ) in which I take every installed module identifier, get the installed version from etc/config.xml and ask the composer-repository about the current version of the module identifier to tell the user if some of his installed extensions are out of date. ;)

Flyingmana commented 10 years ago

Ok, then you need the second thing :D

versionEye offers a (paid) API to get the informations you need, like most upToDate Version and if it needs to get updated.

For the Case you dont want to use their service, you could still use the dry-run feature of composer to see what would get updated. But, there are some major problems with memory and time needed for dependencies with a lot of versions. (the version matching is still inefficient)

So in the end it could happen, that you need to provide an own API/Service for this. Because the package.json of packagist is already 17MB big and sure will only get bigger. Nothing for a short lookup.

Oh, and the informations of currently installed versions, I would suggest to use the magento functionality here, way less problems for alien directory constructs (which I already had used during development)

peterukena commented 10 years ago

Oh okay. I don´t think I want to use a paid service yet. I ´ll have a look into it, how hard it will be to implement an API-sort-of-thing to serve, what I want.

And by the way - I wont read xml-files directly - Mage::getConfig is sufficient I think - I only wanted to point out the source I want to use in comparison to lets say core_ressource ;)