public function pack()
 {
     $this->builder->pack();
     if ($this->modx->gitpackagemanagement->getOption('remove_extracted_package')) {
         $this->modx->gitpackagemanagement->deleteDir($this->builder->directory . $this->builder->signature . '/');
     }
 }
Пример #2
0
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
// Prevent global PHP settings from interrupting
set_time_limit(0);
echo 'Creating Package...';
// fire up MODX
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modx();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
echo '<pre>';
flush();
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
//------------------------------------------------------------------------------
//! Categories
//------------------------------------------------------------------------------
$cat_attributes = array(xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => false, xPDOTransport::UNIQUE_KEY => array('category'), xPDOTransport::RELATED_OBJECTS => true, xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array('Snippets' => array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'name'), 'Chunks' => array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'name'), 'Plugins' => array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'name', xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array('PluginEvents' => array(xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => false, xPDOTransport::UNIQUE_KEY => array('pluginid', 'event'))))));
$Category = $modx->newObject('modCategory');
$Category->set('category', PKG_NAME);
$vehicle = $builder->createVehicle($Category, $cat_attributes);
$builder->putVehicle($vehicle);
//------------------------------------------------------------------------------
//! Snippets
//------------------------------------------------------------------------------
// Not used: see $cat_attributes
$attributes = array(xPDOTransport::UNIQUE_KEY => 'name', xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::RELATED_OBJECTS => true, xPDOTransport::RELATED_OBJECT_ATTRIBUTES => $cat_attributes);
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/chunks/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'pages' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/pages/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->getService('error', 'error.modError');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
if (!XPDO_CLI_MODE) {
    echo '<pre>';
}
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, PKG_NAMESPACE_PATH);
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
/* load system settings */
if (defined('BUILD_SETTING_UPDATE')) {
    $settings = (include $sources['data'] . 'transport.settings.php');
    if (!is_array($settings)) {
        $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
    } else {
        $attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => BUILD_SETTING_UPDATE);
        foreach ($settings as $setting) {
            $vehicle = $builder->createVehicle($setting, $attributes);
            $builder->putVehicle($vehicle);
        }
        $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings.');
Пример #4
0
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
print '<pre>';
require_once dirname(__FILE__) . '/build.config.php';
/*
 * Set log Params
 */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
echo '<pre>';
flush();
/*
 * Create Builder
 */
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
/*
 * Create Package
 */
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
/*
 * Load lexicon
 */
# include_once $sources['builder_includes'] . 'lexicon.php';
/*
 * Add Namespace
 */
include_once $sources['builder_includes'] . 'namespace.php';
/*
 * Add mediasources
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER, 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'resolvers' => $root . '_build/resolvers/', 'validators' => $root . '_build/validators/', 'data' => $root . '_build/data/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'install_options' => $root . '_build/install.options/', 'packages' => $root . 'core/packages');
unset($root);
/* Instantiate MODx -- if this require fails, check your
 * _build/build.config.php file
 */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
/* load builder */
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_CATEGORY, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
/* Transport Resources */
if ($hasResources) {
    $resources = (include $sources['data'] . 'transport.resources.php');
    if (!is_array($resources)) {
        $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in resources.');
    } else {
        $attributes = array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'pagetitle', xPDOTransport::RELATED_OBJECTS => true, xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array('ContentType' => array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'name')));
        foreach ($resources as $resource) {
            $vehicle = $builder->createVehicle($resource, $attributes);
            $builder->putVehicle($vehicle);
        }
        $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($resources) . ' resources.');
    }
Пример #6
0
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
set_time_limit(0);
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'elements' => $root . 'core/components/debugtoolbar/elements/', 'data' => $root . '_build/data/', 'source_core' => $root . 'core/components/debugtoolbar', 'source_assets' => $root . 'assets/components/debugtoolbar');
unset($root);
require_once dirname(__FILE__) . '/build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage('debugtoolbar', '0.1', 'alpha');
$builder->registerNamespace('debugtoolbar', false, true, '{core_path}components/debugtoolbar/');
$settings = (include $sources['data'] . 'transport.settings.php');
$attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => false);
foreach ($settings as $setting) {
    $vehicle = $builder->createVehicle($setting, $attributes);
    $builder->putVehicle($vehicle);
}
unset($settings, $setting, $attributes);
$category = $modx->newObject('modCategory');
$category->set('category', 'DebugToolbar');
$plugins = (include $sources['data'] . 'transport.plugins.php');
if (!is_array($plugins)) {
    $modx->log(modX::LOG_LEVEL_FATAL, 'Adding plugins failed.');
}
Пример #7
0
require_once dirname(__FILE__) . '/build.config.php';
/* define sources */
$root = MODX_ADDON_PATH;
$build = MODX_ADDON_PATH . '_build/';
$sources = array('root' => $root, 'build' => $build, 'data' => $build . 'data/', 'resolvers' => $build . 'resolvers/', 'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/chunks/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'pages' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/pages/', 'templates' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/templates/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER, 'model' => $root . 'core/components/' . PKG_NAME_LOWER . '/model/');
unset($root);
unset($build);
/* override with your own defines here (see build.config.sample.php) */
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/', '{assets_path}components/' . PKG_NAME_LOWER . '/');
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
// Create category
$category = $modx->newObject('modCategory');
$category->set('id', 1);
$category->set('category', PKG_NAME);
$modx->log(modX::LOG_LEVEL_INFO, 'Packaged in "' . PKG_NAME . '" category.');
flush();
// Add Elements to Category
foreach (array('Snippets', 'Chunks', 'TemplateVars', 'Plugins') as $mycat) {
    $c_file = $sources['data'] . 'transport.' . strtolower($mycat) . '.php';
    if (file_exists($c_file)) {
        $cat_element = (include $c_file);
        if (is_array($cat_element)) {
Пример #8
0
 $modx->setLogLevel($options['log_level']);
 $modx->setOption(xPDO::OPT_CACHE_DB, false);
 $modx->setOption(xPDO::OPT_SETUP, true);
 $modx->setDebug(-1);
 $modxDatabase = $modx->getOption('dbname', $options, $modx->getOption('database', $options));
 $modxTablePrefix = $modx->getOption('table_prefix', $options, '');
 $core_path = realpath($modx->getOption('core_path', $options, MODX_CORE_PATH)) . '/';
 $assets_path = realpath($modx->getOption('assets_path', $options, MODX_ASSETS_PATH)) . '/';
 $manager_path = realpath($modx->getOption('manager_path', $options, MODX_MANAGER_PATH)) . '/';
 $base_path = realpath($modx->getOption('base_path', $options, MODX_BASE_PATH)) . '/';
 $modx->log(modX::LOG_LEVEL_INFO, "core_path=" . $core_path);
 $modx->log(modX::LOG_LEVEL_INFO, "assets_path=" . $assets_path);
 $modx->log(modX::LOG_LEVEL_INFO, "manager_path=" . $manager_path);
 $modx->log(modX::LOG_LEVEL_INFO, "base_path=" . $base_path);
 $modx->loadClass('transport.modPackageBuilder', '', false, true);
 $builder = new modPackageBuilder($modx);
 /** @var modWorkspace $workspace */
 $workspace = $modx->getObject('modWorkspace', 1);
 if (!$workspace) {
     $modx->log(modX::LOG_LEVEL_FATAL, "no workspace!");
 }
 if (!defined('PKG_NAME')) {
     define('PKG_NAME', $modx->getOption('http_host', $options, 'cloud_import'));
 }
 define('PKG_VERSION', strftime("%y%m%d.%H%M.%S", $startTime));
 define('PKG_RELEASE', $modxVersion);
 $package = $builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
 /* Defines the classes to extract (also used for truncation) */
 $classes = array('modAccessAction', 'modAccessActionDom', 'modAccessCategory', 'modAccessContext', 'modAccessElement', 'modAccessMenu', 'modAccessPermission', 'modAccessPolicy', 'modAccessPolicyTemplate', 'modAccessPolicyTemplateGroup', 'modAccessResource', 'modAccessResourceGroup', 'modAccessTemplateVar', 'modAction', 'modActionDom', 'modActionField', 'modActiveUser', 'modCategory', 'modCategoryClosure', 'modChunk', 'modClassMap', 'modContentType', 'modContext', 'modContextResource', 'modContextSetting', 'modElementPropertySet', 'modEvent', 'modFormCustomizationProfile', 'modFormCustomizationProfileUserGroup', 'modFormCustomizationSet', 'modLexiconEntry', 'modManagerLog', 'modMenu', 'modNamespace', 'modPlugin', 'modPluginEvent', 'modPropertySet', 'modResource', 'modResourceGroup', 'modResourceGroupResource', 'modSession', 'modSnippet', 'modSystemSetting', 'modTemplate', 'modTemplateVar', 'modTemplateVarResource', 'modTemplateVarResourceGroup', 'modTemplateVarTemplate', 'modUser', 'modUserProfile', 'modUserGroup', 'modUserGroupMember', 'modUserGroupRole', 'modUserMessage', 'modUserSetting', 'modWorkspace', 'registry.db.modDbRegisterMessage', 'registry.db.modDbRegisterTopic', 'registry.db.modDbRegisterQueue', 'transport.modTransportProvider', 'transport.modTransportPackage');
 if (version_compare($modxVersion, '2.2.0', '>=')) {
     array_push($classes, 'modDashboard', 'modDashboardWidget', 'modDashboardWidgetPlacement', 'sources.modAccessMediaSource', 'sources.modMediaSource', 'sources.modMediaSourceElement', 'sources.modMediaSourceContext');
Пример #9
0
set_time_limit(0);
require_once dirname(__FILE__) . '/build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setDebug(false);
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
echo '<pre>';
$modx->setLogTarget('ECHO');
error_reporting(E_ALL);
ini_set('display_errors', true);
$name = 'provisioner';
$version = '1.1.0';
$release = 'pl';
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage($name, $version, $release);
$builder->registerNamespace('provisioner', false, true, '{core_path}components/provisioner/');
$base = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $base, 'assets' => $base . 'assets/components/provisioner/', 'docs' => $base . 'assets/components/provisioner/docs/', 'core' => $base . 'core/components/provisioner/', 'lexicon' => $base . 'core/components/provisioner/lexicon/', 'model' => $base . 'core/components/provisioner/model/', 'templates' => $base . 'core/components/provisioner/templates/', 'build' => $base . '_build/', 'data' => $base . '_build/data/', 'resolvers' => $base . '_build/resolvers/', 'source_core' => $base . 'core/components/provisioner', 'source_assets' => $base . 'assets/components/provisioner');
unset($base);
$vehicles = array();
/* ACTIONS */
$menu = (require_once $sources['data'] . 'actions.data.php');
if (!$menu) {
    $modx->log(xPDO::LOG_LEVEL_FATAL, 'Menu not found!');
}
$attr = array(xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'text', xPDOTransport::RELATED_OBJECTS => true, xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array('Action' => array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => array('namespace', 'controller'))));
$vehicle = $builder->createVehicle($menu, $attr);
$vehicles[] = $vehicle;
/* SETTINGS */
Пример #10
0
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
set_time_limit(0);
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'lexicon' => $root . '_build/lexicon/', 'resolvers' => $root . '_build/resolvers/', 'data' => $root . '_build/data/', 'source_core' => $root . 'core/components/xflickr', 'source_assets' => $root . 'assets/components/xflickr', 'docs' => $root . 'core/components/xflickr/docs/');
unset($root);
/* override with your own defines here (see build.config.sample.php) */
require_once dirname(__FILE__) . '/build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(MODX_LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage('xflickr', '0.1', 'alpha1');
$builder->registerNamespace('xflickr', false, true, '{core_path}components/xflickr/');
/* load action/menu */
$menu = (include $sources['data'] . 'transport.menu.php');
$vehicle = $builder->createVehicle($menu, array(XPDO_TRANSPORT_PRESERVE_KEYS => true, XPDO_TRANSPORT_UPDATE_OBJECT => true, XPDO_TRANSPORT_UNIQUE_KEY => 'text', XPDO_TRANSPORT_RELATED_OBJECTS => true, XPDO_TRANSPORT_RELATED_OBJECT_ATTRIBUTES => array('Action' => array(XPDO_TRANSPORT_PRESERVE_KEYS => false, XPDO_TRANSPORT_UPDATE_OBJECT => true, XPDO_TRANSPORT_UNIQUE_KEY => array('namespace', 'controller')))));
$builder->putVehicle($vehicle);
unset($vehicle, $action);
/* load system settings */
$settings = array();
include_once $sources['data'] . 'transport.settings.php';
$attributes = array(XPDO_TRANSPORT_UNIQUE_KEY => 'key', XPDO_TRANSPORT_PRESERVE_KEYS => true, XPDO_TRANSPORT_UPDATE_OBJECT => false);
foreach ($settings as $setting) {
    $vehicle = $builder->createVehicle($setting, $attributes);
    $builder->putVehicle($vehicle);
}
Пример #11
0
define('PKG_VERSION', '4.1.2');
define('PKG_RELEASE', 'rc1');
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'resolvers' => $root . '_build/resolvers/', 'data' => $root . '_build/data/', 'docs' => $root . 'core/components/' . PKG_NAMESPACE . '/docs/', 'lexicon' => $root . 'core/components/' . PKG_NAMESPACE . '/lexicon/', 'source_assets' => $root . 'assets/components/' . PKG_NAMESPACE, 'source_core' => $root . 'core/components/' . PKG_NAMESPACE);
/* load modx */
require_once dirname(__FILE__) . '/build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
echo XPDO_CLI_MODE ? '' : '<pre>';
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAMESPACE, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAMESPACE, false, true, '{core_path}components/' . PKG_NAMESPACE . '/');
/* create the plugin object */
$plugin = $modx->newObject('modPlugin');
$plugin->set('id', 1);
$plugin->set('name', PKG_NAME);
$plugin->set('description', PKG_NAME . ' ' . PKG_VERSION . '-' . PKG_RELEASE . ' plugin for MODx Revolution');
$plugin->set('plugincode', getSnippetContent($sources['source_core'] . '/tinymce.plugin.php'));
$plugin->set('category', 0);
/* add plugin events */
$events = (include $sources['data'] . 'transport.plugin.events.php');
if (is_array($events) && !empty($events)) {
    $plugin->addMany($events);
    $modx->log(xPDO::LOG_LEVEL_INFO, 'Packaged in ' . count($events) . ' Plugin Events.');
    flush();
Пример #12
0
/* Definire i nomi */
define('PKG_NAME', 'HTML-Library');
define('PKG_NAME_LOWER', 'html-library');
define('PKG_VERSION', '1.0');
define('PKG_RELEASE', 'beta');
/* Definire i percorsi */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/chunks/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'elements' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
/* override with your own defines here (see build.config.sample.php) */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
/* Comprimere il package */
$modx->log(modX::LOG_LEVEL_INFO, 'Packing up transport package zip...');
$builder->pack();
$tend = explode(" ", microtime());
$tend = $tend[1] + $tend[0];
$totalTime = sprintf("%2.4f s", $tend - $tstart);
$modx->log(modX::LOG_LEVEL_INFO, "\n<br />Package Built.<br />\nExecution time: {$totalTime}\n");
session_write_close();
exit;
Пример #13
0
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'properties' => $root . '_build/properties/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->getService('error', 'error.modError');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
if (!XPDO_CLI_MODE) {
    echo '<pre>';
}
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, PKG_NAMESPACE_PATH);
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
/* create snippet object */
$snippet = $modx->newObject('modSnippet');
$snippet->fromArray(array('name' => PKG_NAME, 'description' => 'Markdown for MODX Revolution', 'category' => 0, 'snippet' => file_get_contents($sources['source_core'] . '/elements/snippets/snippet.' . PKG_NAME_LOWER . '.php'), 'source' => 1, 'static' => 0, 'static_file' => 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/snippet.' . PKG_NAME_LOWER . '.php'));
$properties = (include $sources['properties'] . 'properties.' . PKG_NAME_LOWER . '.php');
$snippet->setProperties($properties);
/* package in snippet */
$attributes = array(xPDOTransport::UNIQUE_KEY => 'name', xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true);
$vehicle = $builder->createVehicle($snippet, $attributes);
$vehicle->resolve('file', array('source' => $sources['source_core'], 'target' => "return MODX_CORE_PATH . 'components/';"));
$builder->putVehicle($vehicle);
unset($properties, $snippet, $vehicle);
/* now pack in the license file, readme and setup options */
Пример #14
0
define('MODX_ASSETS_URL', '');
define('MODX_CONNECTORS_URL', '');
/* instantiate MODx */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
/* set package info */
define('PKG_NAME', 'Personalize');
define('PKG_VERSION', '3.7.0');
define('PKG_RELEASE', 'pl');
/* load builder */
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace('personalize', false, true, '{core_path}components/personalize/');
/* create snippet objects */
/* create category */
$category = $modx->newObject('modCategory');
$category->set('id', 1);
$category->set('category', 'personalize');
/* add snippets */
$modx->log(modX::LOG_LEVEL_INFO, 'Adding in snippets.');
$snippets = (include $sources['data'] . 'transport.snippets.php');
if (is_array($snippets)) {
    $category->addMany($snippets);
} else {
    $modx->log(modX::LOG_LEVEL_FATAL, 'Adding snippets failed.');
}
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'pages' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/pages/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->getService('error', 'error.modError');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
if (!XPDO_CLI_MODE) {
    echo '<pre>';
}
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
//$builder->registerNamespace(PKG_NAME_LOWER, false, true, PKG_NAMESPACE_PATH);
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
$attr = array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'name');
$snippet = $modx->newObject('modSnippet');
$snippet->fromArray(array('name' => "extLinkRedirector", 'description' => '', 'snippet' => getSnippetContent($sources['source_core'] . '/elements/snippets/snippet.extlinkredirector.php')), '', true, true);
$vehicle = $builder->createVehicle($snippet, $attr);
flush();
$builder->putVehicle($vehicle);
/* create the plugin object */
$plugin = $modx->newObject('modPlugin');
$plugin->set('id', 1);
$plugin->set('name', 'extLinkRedirector');
$plugin->set('description', 'External Link Redirector plugin');
$plugin->set('plugincode', getSnippetContent($sources['source_core'] . '/elements/plugins/plugin.extlinkredirector.php'));
Пример #16
0
$tstart = $mtime;
/* get rid of time limit */
set_time_limit(0);
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'docs' => $root . 'core/components/wayfinder/docs/', 'source_core' => $root . 'core/components/wayfinder');
/* override with your own defines here (see build.config.sample.php) */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage('wayfinder', '2.1.1', 'rc1');
$builder->registerNamespace('wayfinder', false, true, '{core_path}components/wayfinder/');
/* get the source from the actual snippet in your database
 * [alternative] you could also manually create the object, grabbing the source
 * from a file
 */
$c = $modx->newObject('modSnippet');
$c->set('id', 1);
$c->set('name', 'Wayfinder');
$c->set('description', 'Wayfinder for MODx Revolution 2.0.0-beta-5 and later.');
$c->set('snippet', file_get_contents($sources['source_core'] . '/wayfinder.snippet.php'));
$c->set('category', 0);
$properties = (include $sources['data'] . 'properties.inc.php');
$c->setProperties($properties, true);
$attributes = array(xPDOTransport::UNIQUE_KEY => 'name', xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true);
Пример #17
0
<?php

require_once 'tools/build.tools.php';
require_once 'build.config.php';
Tools::startTimer();
$modx = Tools::loadModxInstance();
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
// Register namespace for this extra -------------------------------------------------
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
// Create the plugin object ----------------------------------------------------------
$plugin = $modx->newObject('modPlugin');
$plugin->set('id', 1);
$plugin->set('name', 'FastUploadTV');
$plugin->set('description', PKG_NAME . ' ' . PKG_VERSION . '-' . PKG_RELEASE . ' plugin for MODx Revolution');
$plugin->set('plugincode', file_get_contents($sources['source_core'] . '/elements/plugins/plugin.FastUploadTV.php'));
$plugin->set('category', 0);
// Add plugin events -----------------------------------------------------------------
$events = (include $sources['data'] . 'transport.plugin.events.php');
if (is_array($events) && !empty($events)) {
    $plugin->addMany($events);
} else {
    $modx->log(xPDO::LOG_LEVEL_ERROR, 'Could not find plugin events!');
}
$modx->log(xPDO::LOG_LEVEL_INFO, 'Packaged in ' . count($events) . ' Plugin Events.');
flush();
unset($events);
// Define vehicle attributes ----------------------------------------------------------
$attributes = array(xPDOTransport::UNIQUE_KEY => 'name', xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::RELATED_OBJECTS => true, xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array('PluginEvents' => array(xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => false, xPDOTransport::UNIQUE_KEY => array('pluginid', 'event'))));
// Create transport vehicle ------------------------------------------------------------
$vehicle = $builder->createVehicle($plugin, $attributes);
Пример #18
0
    require_once 'build.model.php';
}
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/chunks/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'templates' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/templates/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'pages' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/pages/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER . '/', 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER . '/');
unset($root);
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, PKG_NAMESPACE_PATH, PKG_NAMESPACE_ASSETS_PATH);
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
/* load system settings */
if (defined('BUILD_SETTING_UPDATE')) {
    $settings = (include $sources['data'] . 'transport.settings.php');
    if (!is_array($settings)) {
        $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
    } else {
        $attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => BUILD_SETTING_UPDATE);
        foreach ($settings as $setting) {
            $vehicle = $builder->createVehicle($setting, $attributes);
            $builder->putVehicle($vehicle);
        }
        $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings.');
Пример #19
0
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'resolvers' => $root . '_build/resolvers/', 'data' => $root . '_build/data/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
/* instantiate MODx */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/data/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
echo "<pre>\n";
/* load builder */
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
/* create plugin object */
$modx->log(xPDO::LOG_LEVEL_INFO, 'Adding in snippet.');
flush();
$object = $modx->newObject('modSnippet');
$object->set('name', PKG_NAME);
$object->set('description', '<strong>' . PKG_VERSION . '-' . PKG_RELEASE . '</strong> Basic snippet for ' . PKG_NAME . '.');
$object->set('category', 0);
$object->set('snippet', getSnippetContent($sources['snippets'] . 'snippet.multimedialibrary.php'));
$properties = (include $sources['data'] . 'snippet.multimedialibrary.properties.php');
$object->setProperties($properties);
unset($properties);
/* create a transport vehicle for the data object */
$vehicle = $builder->createVehicle($object, array(xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'name'));
Пример #20
0
<?php

/**
 * @package modx
 * @subpackage processors.workspace.builder
 */
$modx->lexicon->load('workspace', 'package_builder');
if (!$modx->hasPermission('package_builder')) {
    return $modx->error->failure($modx->lexicon('permission_denied'));
}
$_PACKAGE =& $_SESSION['modx.pb'];
/* load the modPackageBuilder class and get an instance */
$modx->log(MODX_LOG_LEVEL_INFO, 'Loading package builder.');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
/* create a new package */
$modx->log(MODX_LOG_LEVEL_INFO, 'Creating a new package: ' . $_PACKAGE['name'] . '-' . $_PACKAGE['version'] . '-' . $_PACKAGE['release']);
$builder->createPackage($_PACKAGE['name'], $_PACKAGE['version'], $_PACKAGE['release']);
$builder->registerNamespace($_PACKAGE['namespace'], $_PACKAGE['autoselects']);
/* define some locations for file resources */
$sources = array('root' => dirname(dirname(__FILE__)) . '/', 'assets' => dirname(dirname(__FILE__)) . '/assets/');
/* set up some default attributes that define install behavior */
$attributes = array(xPDOTransport::UNIQUE_KEY => 'name', xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::RESOLVE_FILES => true, xPDOTransport::RESOLVE_PHP => true);
$modx->log(modX::LOG_LEVEL_INFO, 'Loading vehicles into package.');
foreach ($_PACKAGE['vehicles'] as $vehicle) {
    $c = $modx->getObject($vehicle['class_key'], $vehicle['object']);
    if ($c == null) {
        continue;
    }
    if (!isset($vehicle['attributes'])) {
        $vehicle['attributes'] = array();
Пример #21
0
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'resolvers' => $root . '_build/resolvers/', 'data' => $root . '_build/data/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
/* instantiate MODx */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
/* load builder */
$modx->log(xPDO::LOG_LEVEL_INFO, 'Creating package builder');
flush();
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/', '{assets_path}components/' . PKG_NAME_LOWER . '/');
$builder->registerNamespace('modldapuser', false, true, '{core_path}components/' . PKG_NAME_LOWER . '/', '{assets_path}components/' . PKG_NAME_LOWER . '/');
/* PLUGINS */
/* ------------------------------------------------------ */
$modx->log(xPDO::LOG_LEVEL_INFO, 'Adding in plugin.');
flush();
$plugin = $modx->newObject('modPlugin');
$plugin->set('name', PKG_NAME);
$plugin->set('description', '<strong>' . PKG_VERSION . '-' . PKG_RELEASE . '</strong> This plugin is part of ModLDAP packages: handling LDAP-User authentication.');
$plugin->set('category', 0);
$plugin->set('plugincode', getSnippetContent($sources['plugins'] . 'plugin.modldap.php'));
//add properties to plugin
$properties = (include $sources['data'] . 'plugin.modldap.properties.php');
$plugin->setProperties($properties);
Пример #22
0
$sources = array('root' => $root, 'build' => $root . '_build/', 'settings' => $root . '_build/settings/', 'source_core' => $root . 'core/components/modfire');
unset($root);
/* instantiate MODx */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
/* set package info */
define('PKG_NAME', 'modfire');
define('PKG_VERSION', '0.1.0');
define('PKG_RELEASE', 'rc');
/* load builder */
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$package = $builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
//$builder->registerNamespace('modfire',false,true,'{core_path}components/modfire/');
$sourcePath = $sources['source_core'];
$targetPath = "return MODX_CORE_PATH . 'components/';";
$obj = array('source' => $sourcePath, 'target' => $targetPath);
$attributes = array('vehicle_class' => 'xPDOFileVehicle');
$package->put($obj, $attributes);
/* load system settings */
$modx->log(modX::LOG_LEVEL_INFO, 'Packaging in System Settings...');
$settings = (include $sources['settings'] . 'system.settings.php');
if (!is_array($settings)) {
    $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
}
$attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => false);
foreach ($settings as $setting) {
Пример #23
0
);
unset($root); /* save memory */

require_once dirname(dirname(dirname(__FILE__))) . '/core/config/config.inc.php';

define('MODX_CONFIG_KEY','config');

require_once MODX_CORE_PATH . 'model/modx/modx.class.php';

$modx= new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');

$modx->loadClass('transport.modPackageBuilder','',false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage('visioncart', '0.6.1', 'rc4');
$builder->registerNamespace('visioncart', false, true, '{core_path}components/visioncart/');
 
// Add system settings
require_once(dirname(__FILE__).'/builder.systemsettings.php');

// Add system settings
require_once(dirname(__FILE__).'/builder.plugins.php');

// Add categories+snippets+chunks and create file vehicle
require_once(dirname(__FILE__).'/builder.categories.php');

// Add files to the category vehicle and put the category vehicle into the builder
require_once(dirname(__FILE__).'/builder.files.php');
Пример #24
0
define('PKG_NAME_LOWER_MINISHOP', 'minishop2');
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'docs' => $root . 'docs/', 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'source_assets' => array('components/' . PKG_NAME_LOWER_MINISHOP . '/payment/platron.php'), 'source_core' => array('components/' . PKG_NAME_LOWER_MINISHOP . '/custom/payment/platron.class.php', 'components/' . PKG_NAME_LOWER_MINISHOP . '/lexicon/en/msp.platron.inc.php', 'components/' . PKG_NAME_LOWER_MINISHOP . '/lexicon/ru/msp.platron.inc.php'));
/* override with your own defines here (see build.config.sample.php) */
require_once $sources['build'] . '/build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
//$builder->registerNamespace(PKG_NAME_LOWER,false,true,'{core_path}components/'.PKG_NAME_LOWER.'/');
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package.');
/* load system settings */
$settings = (include $sources['data'] . 'transport.settings.php');
if (!is_array($settings)) {
    $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
} else {
    $attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => false);
    foreach ($settings as $setting) {
        $vehicle = $builder->createVehicle($setting, $attributes);
        $builder->putVehicle($vehicle);
    }
    $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings.');
}
Пример #25
0
$sources = array('root' => $root, 'build' => $root . '_build/', 'source_core' => $root . 'core/components/newspublisher', 'source_assets' => $root . 'assets/components/newspublisher', 'data' => $root . '_build/data/', 'docs' => $root . 'core/components/newspublisher/docs/', 'resolvers' => $root . '_build/resolvers/');
unset($root);
/* instantiate MODx */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
/* set package info */
define('PKG_NAME', 'newspublisher');
define('PKG_VERSION', '2.1.0');
define('PKG_RELEASE', 'pl');
/* load builder */
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace('newspublisher', false, true, '{core_path}components/newspublisher/');
/* create snippet objects */
/* create category */
/* @var $category modCategory */
$category = $modx->newObject('modCategory');
$category->set('id', 1);
$category->set('category', 'NewsPublisher');
/* add snippets */
$modx->log(modX::LOG_LEVEL_INFO, 'Adding in snippets.');
$snippets = (include $sources['data'] . 'newspublisher/transport.snippets.php');
if (is_array($snippets)) {
    $category->addMany($snippets);
} else {
    $modx->log(modX::LOG_LEVEL_FATAL, 'Adding snippets failed.');
Пример #26
0
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/chunks/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'pages' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/pages/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
/* override with your own defines here (see build.config.sample.php) */
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->getService('error', 'error.modError');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
/* load system settings */
if (defined('BUILD_SETTING_UPDATE')) {
    $settings = (include $sources['data'] . 'transport.settings.php');
    if (!is_array($settings)) {
        $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
    } else {
        $attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => BUILD_SETTING_UPDATE);
        foreach ($settings as $setting) {
            $vehicle = $builder->createVehicle($setting, $attributes);
            $builder->putVehicle($vehicle);
        }
        $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings.');
Пример #27
0
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER, 'resolvers' => $root . '_build/resolvers/');
unset($root);
/* override with your own defines here (see build.config.sample.php) */
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
require_once $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->getService('error', 'error.modError');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
$modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.');
/* load system settings */
if (defined('BUILD_SETTING_UPDATE')) {
    $settings = (include $sources['data'] . 'transport.settings.php');
    if (!is_array($settings)) {
        $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
    } else {
        $attributes = array(xPDOTransport::UNIQUE_KEY => 'key', xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => BUILD_SETTING_UPDATE);
        foreach ($settings as $setting) {
            $vehicle = $builder->createVehicle($setting, $attributes);
            $builder->putVehicle($vehicle);
        }
        $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings.');
Пример #28
0
/* instantiate MODx */
require_once $sources['build'].'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx= new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');

/* set package info */
define('PKG_NAME','getresources');
define('PKG_VERSION','1.3.0');
define('PKG_RELEASE','pl');

/* load builder */
$modx->loadClass('transport.modPackageBuilder','',false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAME, PKG_VERSION, PKG_RELEASE);
//$builder->registerNamespace('getresources',false,true,'{core_path}components/getresources/');

/* create snippet object */
$modx->log(xPDO::LOG_LEVEL_INFO,'Adding in snippet.'); flush();
$snippet= $modx->newObject('modSnippet');
$snippet->set('name', 'getResources');
$snippet->set('description', '<strong>'.PKG_VERSION.'-'.PKG_RELEASE.'</strong> A general purpose Resource listing and summarization snippet for MODx Revolution');
$snippet->set('category', 0);
$snippet->set('snippet', file_get_contents($sources['source_core'] . '/snippet.getresources.php'));
$properties = include $sources['build'].'properties.inc.php';
$snippet->setProperties($properties);
unset($properties);

Пример #29
0
define('PKG_RELEASE', 'pl');
/* define build paths */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'data' => $root . '_build/data/', 'resolvers' => $root . '_build/resolvers/', 'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/chunks/', 'lexicon' => $root . 'core/components/' . PKG_NAME_LOWER . '/lexicon/', 'docs' => $root . 'core/components/' . PKG_NAME_LOWER . '/docs/', 'elements' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/', 'source_assets' => $root . 'assets/components/' . PKG_NAME_LOWER, 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER);
unset($root);
/* override with your own defines here (see build.config.sample.php) */
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
echo '<pre>';
/* used for nice formatting of log messages */
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
$builder = new modPackageBuilder($modx);
$builder->directory = dirname(dirname(__FILE__)) . '/_package/';
$builder->createPackage(PKG_EXTRA_NAME, PKG_VERSION, PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
//-- CREATE THE CATEGORY OBJECT
$category = $modx->newObject('modCategory');
$category->set('id', 1);
$category->set('category', PKG_NAME);
/* add snippets */
$modx->log(modX::LOG_LEVEL_INFO, 'Packaging in snippets...');
$snippets = (include $sources['data'] . 'transport.snippets.php');
if (empty($snippets)) {
    $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in snippets.');
}
$category->addMany($snippets);
/* add chunks */
 public function __construct($builder, $smarty, $object, $attributes)
 {
     $this->builder = $builder;
     $this->smarty = $smarty;
     $this->vehicle = $this->builder->createVehicle($object, $attributes);
 }