forked from modxcms/TinyMCE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Tagging 4.0.0 release
- Loading branch information
Showing
310 changed files
with
42,956 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
// define the MODX path constants necessary for core installation | ||
define('MODX_BASE_PATH', dirname(dirname(dirname(dirname(__FILE__)))) . '/modx097/'); | ||
define('MODX_CORE_PATH', MODX_BASE_PATH . 'core/'); | ||
define('MODX_MANAGER_PATH', MODX_BASE_PATH . 'manager/'); | ||
define('MODX_CONNECTORS_PATH', MODX_BASE_PATH . 'connectors/'); | ||
define('MODX_ASSETS_PATH', MODX_BASE_PATH . 'assets/'); | ||
?> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?php | ||
/** | ||
* TinyMCE build script | ||
* | ||
* @package tinymce | ||
* @subpackage build | ||
*/ | ||
$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/', | ||
'resolvers' => $root . '_build/resolvers/', | ||
'data' => $root . '_build/data/', | ||
'docs' => $root . 'core/components/tinymce/docs/', | ||
'lexicon' => $root . 'core/components/tinymce/lexicon/', | ||
'source_assets' => $root . 'assets/components/tinymce', | ||
'source_core' => $root . 'core/components/tinymce', | ||
); | ||
|
||
define('PKG_NAME','TinyMCE'); | ||
define('PKG_NAMESPACE',strtolower(PKG_NAME)); | ||
define('PKG_VERSION','4.0.0'); | ||
define('PKG_RELEASE','rc1'); | ||
|
||
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); | ||
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', file_get_contents($sources['source_core'] . '/tinymce.plugin.php')); | ||
$plugin->set('category', 0); | ||
|
||
/* add plugin events */ | ||
$modx->log(xPDO::LOG_LEVEL_INFO,'Packaging in Plugin Events...'); flush(); | ||
$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!'); | ||
} | ||
|
||
/* load plugin properties */ | ||
$modx->log(xPDO::LOG_LEVEL_INFO,'Setting Plugin Properties...'); flush(); | ||
$properties = include $sources['data'].'properties.inc.php'; | ||
$plugin->setProperties($properties); | ||
|
||
$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'), | ||
), | ||
), | ||
); | ||
$vehicle = $builder->createVehicle($plugin, $attributes); | ||
$vehicle->resolve('file',array( | ||
'source' => $sources['source_assets'], | ||
'target' => "return MODX_ASSETS_PATH . 'components/';", | ||
)); | ||
$vehicle->resolve('file',array( | ||
'source' => $sources['source_core'], | ||
'target' => "return MODX_CORE_PATH . 'components/';", | ||
)); | ||
$vehicle->resolve('php',array( | ||
'source' => $sources['resolvers'] . 'resolve.whicheditor.php', | ||
)); | ||
$builder->putVehicle($vehicle); | ||
|
||
/* load system settings */ | ||
$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); | ||
} | ||
|
||
/* now pack in the license file, readme and setup options */ | ||
$modx->log(xPDO::LOG_LEVEL_INFO,'Setting Package Attributes...'); flush(); | ||
$builder->setPackageAttributes(array( | ||
'license' => file_get_contents($sources['docs'] . 'license.txt'), | ||
'readme' => file_get_contents($sources['docs'] . 'readme.txt'), | ||
)); | ||
|
||
$modx->log(xPDO::LOG_LEVEL_INFO,'Zipping up package...'); flush(); | ||
$builder->pack(); | ||
|
||
$mtime= microtime(); | ||
$mtime= explode(" ", $mtime); | ||
$mtime= $mtime[1] + $mtime[0]; | ||
$tend= $mtime; | ||
$totalTime= ($tend - $tstart); | ||
$totalTime= sprintf("%2.4f s", $totalTime); | ||
|
||
$modx->log(modX::LOG_LEVEL_INFO,"\n<br />Package Built.<br />\nExecution time: {$totalTime}\n"); | ||
|
||
exit (); |
Oops, something went wrong.