- OR just rename config.php.modxReady to config.php -in this file, define('MODX_CORE_PATH', '/path/to/your/site/core/'); -Extensive configurations can be done in the original config.php, which you should back up before upgrading. */ //initialize MODx stuff here if (!defined('MODX_CORE_PATH')) { define('MODX_CORE_PATH', '/path/to/your/site/core/'); //path to your core folder } if (!defined('MODX_CONFIG_KEY')) { define('MODX_CONFIG_KEY', 'config'); } require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; $modx = new modx(); $modx->initialize('web'); // or $modx->initialize('mgr'); //limit access to File Manager, by usergroup or any other criterion you like if ($modx->user->isMember('Administrator')) { } else { die('<div style="position: fixed; margin: auto;width: 400px;height:200px;text-align:center;top:0;bottom:0;left:0;right:0;"><h1>IT SEEMS YOU DO NOT HAVE PERMISSION TO USE THIS COOL MANAGER</h1></div>'); } /* -Make sure your upload media folder already exists; for this sample we will use one already in this plugin's folder (assets/components/tinymcewrapper/uploadMedia/) -Now calculate how to get to your folder from tinymcewrapper/responsivefilemanager/filemanager/ -When using MODxs Media Sources and all, and not sure how your client does stuff, use PHP's realpath to auto calculate this relationship -At this time I am not certain RFM wll work outside public_html. ------TO USE OUTSIDE ASSETS FOLDER, CHANGE ACCORDINGLY ------------------------------------------- $absolutePathtoUploadFolder = '/assets/my_media_folder/'; //can also use MODX_BASE_URL . 'my_media_folder/'; $relativePathToUploadFolder = '../../../../my_media_folder/';
} if (!defined('MODX_CONFIG_KEY')) { define('MODX_CONFIG_KEY', 'config'); } // Start the stopwatch... $mtime = microtime(); $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);