当前位置: 首页>>代码示例>>PHP>>正文


PHP modX::getManager方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:pixelfanatiker,项目名称:Git-Package-Management,代码行数:14,代码来源:Install.php

示例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>';
}
开发者ID:bendasvadim,项目名称:VoteForms,代码行数:30,代码来源:build.model.php

示例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+]
开发者ID:enminc,项目名称:engaged,代码行数:31,代码来源:schema.build.php


注:本文中的modX::getManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。