本文整理汇总了PHP中modX::getManager方法的典型用法代码示例。如果您正苦于以下问题:PHP modX::getManager方法的具体用法?PHP modX::getManager怎么用?PHP modX::getManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类modX
的用法示例。
在下文中一共展示了modX::getManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createTables
protected function createTables()
{
if ($this->config->getDatabase() != null) {
$modelPath = $this->packageCorePath . 'model/';
$this->modx->addPackage($this->config->getLowCaseName(), $modelPath, $this->config->getDatabase()->getPrefix());
foreach ($this->config->getDatabase()->getSimpleObjects() as $simpleObject) {
$this->modx->loadClass($simpleObject);
}
$manager = $this->modx->getManager();
foreach ($this->config->getDatabase()->getTables() as $table) {
$manager->createObjectContainer($table);
}
}
}
示例2: dirname
if (!defined('MODX_BASE_PATH')) {
require 'build.config.php';
}
/* define sources */
$root = dirname(dirname(__FILE__)) . '/';
$sources = array('root' => $root, 'build' => $root . '_build/', 'source_core' => $root . 'core/components/' . PKG_NAME_LOWER, 'model' => $root . 'core/components/' . PKG_NAME_LOWER . '/model/', 'schema' => $root . 'core/components/' . PKG_NAME_LOWER . '/model/schema/', 'xml' => $root . 'core/components/' . PKG_NAME_LOWER . '/model/schema/' . PKG_NAME_LOWER . '.mysql.schema.xml');
unset($root);
require MODX_CORE_PATH . 'model/modx/modx.class.php';
require $sources['build'] . '/includes/functions.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->getService('error', 'error.modError');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget('ECHO');
$modx->loadClass('transport.modPackageBuilder', '', false, true);
if (!XPDO_CLI_MODE) {
echo '<pre>';
}
/** @var xPDOManager $manager */
$manager = $modx->getManager();
/** @var xPDOGenerator $generator */
$generator = $manager->getGenerator();
// Remove old model
rrmdir($sources['model'] . PKG_NAME_LOWER . '/mysql');
// Generate a new one
$generator->parseSchema($sources['xml'], $sources['model']);
$modx->log(modX::LOG_LEVEL_INFO, 'Model generated.');
if (!XPDO_CLI_MODE) {
echo '</pre>';
}
示例3: microtime
* @subpackage build
*/
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
set_time_limit(0);
/* initialize xpdo */
require_once dirname(__FILE__) . '/build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->setLogTarget('ECHO');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setPackage('rpx.user', dirname(dirname(__FILE__)) . '/model/');
$modx->getManager();
$generator = $modx->manager->getGenerator();
$generator->classTemplate = <<<EOD
<?php
/**
* [+phpdoc-package+]
* [+phpdoc-subpackage+]
*/
class [+class+] extends [+extends+] {}
?>
EOD;
$generator->platformTemplate = <<<EOD
<?php
/**
* [+phpdoc-package+]
* [+phpdoc-subpackage+]