Last active
December 28, 2015 13:09
-
-
Save vdubyna/7505588 to your computer and use it in GitHub Desktop.
Create magento package based on simple json object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "file_name": "Speroteck_Tabmenu", | |
| "name": "Speroteck_Tabmenu", | |
| "channel": "community", | |
| "version_ids": ["2"], | |
| "summary": "sdfsdfds", | |
| "description": "dsfsdfdsfdsf", | |
| "license": "OSC v3.0", | |
| "license_uri": "", | |
| "version": "0.1.1", | |
| "stability": "devel", | |
| "notes": "sdfdsfsdf", | |
| "authors": { | |
| "name": ["Volodymyr Dubyna"], | |
| "user": ["vdubyna"], | |
| "email": ["vovikha@gmail.com"] | |
| }, | |
| "depends_php_min": "5.3.2", | |
| "depends_php_max": "5.4.0", | |
| "depends": { | |
| "package": { | |
| "name": [""], | |
| "channel": [""], | |
| "min": [""], | |
| "max": [""], | |
| "files": [" "] | |
| }, | |
| "extension": { | |
| "name": ["Core"], | |
| "min": [""], | |
| "max": [""] | |
| } | |
| }, | |
| "contents": { | |
| "target": [ | |
| "magelocal", | |
| "magelocal", | |
| "mageetc" | |
| ], | |
| "path": [ | |
| "", | |
| "Speroteck\/Crawler", | |
| "modules\/Speroteck_Crawler.xml" | |
| ], | |
| "type": [ | |
| "file", | |
| "dir", | |
| "file" | |
| ], | |
| "include": ["", "", ""], | |
| "ignore": ["", "", ""] | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require 'app/Mage.php'; | |
| if (!Mage::isInstalled()) { | |
| echo "Application is not installed yet, please complete install wizard first."; | |
| exit; | |
| } | |
| Mage::app('admin')->setUseSessionInUrl(false); | |
| Mage::register('isSecureArea', 1); | |
| Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
| umask(0); | |
| try { | |
| $p = Zend_Json::decode(file_get_contents('package.json')); | |
| $ext = Mage::getModel('connect/extension'); | |
| /** @var $ext Mage_Connect_Model_Extension */ | |
| $ext->setData($p); | |
| $ext->createPackage(); | |
| echo "Package was successfully generated"; | |
| } catch (Exception $e) { | |
| Mage::printException($e); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment