Last active
December 1, 2016 15:48
-
-
Save alanpich/5759560 to your computer and use it in GitHub Desktop.
Rough outline of installing transport packages via the CLI
This file contains 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 | |
$path_to_modx = '/var/www/modx'; | |
define('MODX_API_MODE',true); | |
require $path_to_modx."/index.php"; | |
/** @var \modX $modx */ | |
// Download Details | |
/** @var string $package_url - URL from the orange 'Download' button on the MODx Extras website */ | |
$package_url = 'http://modx.com/extras/download/?id=512403a2f245547611000025' | |
$package_signature = 'getresources-1.6.0-pl' | |
// Download the package | |
$modx->runProcessor('workspace/packages/rest/download',array( | |
'info' => $package_url.'::'.$package_signature | |
)); | |
// Create modTransportPackage object in new modx install | |
$scan = $modx->runProcessor('workspace/packages/scanlocal'); | |
// Run install command | |
$response = $modx->runProcessor('workspace/packages/install',array( | |
'signature' => $package_signature | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @alanpich, thx for that snippet of code, it was useful ;)