本文整理汇总了PHP中MetaModel::Startup方法的典型用法代码示例。如果您正苦于以下问题:PHP MetaModel::Startup方法的具体用法?PHP MetaModel::Startup怎么用?PHP MetaModel::Startup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaModel
的用法示例。
在下文中一共展示了MetaModel::Startup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InitDataModel
/**
* Helper function to initialize the ORM and load the data model
* from the given file
* @param $oConfig object The configuration (volatile, not necessarily already on disk)
* @param $bModelOnly boolean Whether or not to allow loading a data model with no corresponding DB
* @return none
*/
public function InitDataModel($oConfig, $bModelOnly = true, $bUseCache = false)
{
require_once APPROOT . '/core/log.class.inc.php';
require_once APPROOT . '/core/kpi.class.inc.php';
require_once APPROOT . '/core/coreexception.class.inc.php';
require_once APPROOT . '/core/dict.class.inc.php';
require_once APPROOT . '/core/attributedef.class.inc.php';
require_once APPROOT . '/core/filterdef.class.inc.php';
require_once APPROOT . '/core/stimulus.class.inc.php';
require_once APPROOT . '/core/MyHelpers.class.inc.php';
require_once APPROOT . '/core/expression.class.inc.php';
require_once APPROOT . '/core/cmdbsource.class.inc.php';
require_once APPROOT . '/core/sqlquery.class.inc.php';
require_once APPROOT . '/core/dbobject.class.php';
require_once APPROOT . '/core/dbobjectsearch.class.php';
require_once APPROOT . '/core/dbobjectset.class.php';
require_once APPROOT . '/application/cmdbabstract.class.inc.php';
require_once APPROOT . '/core/userrights.class.inc.php';
require_once APPROOT . '/setup/moduleinstallation.class.inc.php';
$sConfigFile = $oConfig->GetLoadedFile();
if (strlen($sConfigFile) > 0) {
$this->log_info("MetaModel::Startup from {$sConfigFile} (ModelOnly = {$bModelOnly})");
} else {
$this->log_info("MetaModel::Startup (ModelOnly = {$bModelOnly})");
}
if (!$bUseCache) {
// Reset the cache for the first use !
MetaModel::ResetCache(md5(APPROOT) . '-' . $this->sTargetEnv);
}
MetaModel::Startup($oConfig, $bModelOnly, $bUseCache);
}
示例2: session_name
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* File to include to initialize the datamodel in memory
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once APPROOT . '/core/cmdbobject.class.inc.php';
require_once APPROOT . '/application/utils.inc.php';
session_name('itop-' . md5(APPROOT));
session_start();
if (isset($_REQUEST['switch_env'])) {
$sEnv = $_REQUEST['switch_env'];
$_SESSION['itop_env'] = $sEnv;
// TODO: reset the credentials as well ??
} else {
if (isset($_SESSION['itop_env'])) {
$sEnv = $_SESSION['itop_env'];
} else {
$sEnv = ITOP_DEFAULT_ENV;
$_SESSION['itop_env'] = ITOP_DEFAULT_ENV;
}
}
$sConfigFile = APPCONF . $sEnv . '/' . ITOP_CONFIG_FILE;
MetaModel::Startup($sConfigFile);
示例3: InitDataModel
function InitDataModel($sConfigFileName, $bModelOnly = true)
{
require_once APPROOT . '/core/log.class.inc.php';
require_once APPROOT . '/core/kpi.class.inc.php';
require_once APPROOT . '/core/coreexception.class.inc.php';
require_once APPROOT . '/core/dict.class.inc.php';
require_once APPROOT . '/core/attributedef.class.inc.php';
require_once APPROOT . '/core/filterdef.class.inc.php';
require_once APPROOT . '/core/stimulus.class.inc.php';
require_once APPROOT . '/core/MyHelpers.class.inc.php';
require_once APPROOT . '/core/expression.class.inc.php';
require_once APPROOT . '/core/cmdbsource.class.inc.php';
require_once APPROOT . '/core/sqlquery.class.inc.php';
require_once APPROOT . '/core/dbobject.class.php';
if (file_exists(APPROOT . '/core/dbsearch.class.php')) {
// iTop 2.2.0 or newer
require_once APPROOT . '/core/dbsearch.class.php';
} else {
// Pre 2.2
require_once APPROOT . '/core/dbobjectsearch.class.php';
}
require_once APPROOT . '/core/dbobjectset.class.php';
require_once APPROOT . '/application/cmdbabstract.class.inc.php';
require_once APPROOT . '/core/userrights.class.inc.php';
require_once APPROOT . '/setup/moduleinstallation.class.inc.php';
MetaModel::ResetCache();
MetaModel::Startup($sConfigFileName, $bModelOnly, false);
}
示例4: DoPrepare
public function DoPrepare()
{
parent::DoPrepare();
MetaModel::Startup('../config-test-itopv06.php');
}
示例5: DoPrepare
protected function DoPrepare()
{
$sConfigFile = APPROOT . $this->GetConfigFile();
MetaModel::Startup($sConfigFile);
// #@# Temporary disabled by Romain
// MetaModel::CheckDefinitions();
// something here to create records... but that's another story
}