當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。