本文整理汇总了PHP中Engine::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine::init方法的具体用法?PHP Engine::init怎么用?PHP Engine::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public static function run()
{
require_once 'Database.php';
require_once 'Route.php';
require_once 'Load.php';
require_once 'Engine.php';
DB::init('localhost', 'icourse', 'root', '');
Route::init();
Load::$path = OBJ_ROOT . Route::$class . '.php';
Load::init();
foreach ($_REQUEST as $key => $val) {
Engine::$oil[$key] = $val;
}
Engine::$class = Route::$class;
Engine::$function = Route::$function;
Engine::init();
}
示例2: date_default_timezone_set
<?php
date_default_timezone_set('Europe/Kiev');
require_once __DIR__ . '/../vendor/autoload.php';
$appConf = (require_once __DIR__ . '/../etc/app-conf.php');
Engine::init($appConf['dbConfig']['main']);
AppFactory::create($appConf)->add(new \Slim\Middleware\SessionCookie(['expires' => '1 day']));
AppFactory::$slimInstance->run();
示例3: error_reporting
<?php
error_reporting(-1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '1512M');
date_default_timezone_set('Europe/Kiev');
require_once __DIR__ . '/../vendor/autoload.php';
$appConf = (require_once __DIR__ . '/../etc/app-conf.php');
Engine::init($appConf['dbConfig']['test']);
require_once 'TestHelper.php';
require_once 'LocalWebTestCase.php';
\Validator\LIVR::registerDefaultRules(['equals' => function ($expected) {
return function ($got) use($expected) {
if ($got != $expected) {
return 'NOT_EQUILAS';
}
};
}, 'strict_equals' => function ($expected) {
return function ($got) use($expected) {
if ($got !== $expected) {
return 'NOT_EQUILAS';
}
};
}, 'empty_array' => function () {
return function ($got) {
if (!is_array($got) || count($got)) {
return 'NOT_EMPTY_ARRAY';
}
};
}, 'array' => function () {
示例4: index
/*
index() wrapper
Engine->Module_Handling
@author cwade12c
@copyright HaxMe
@package haXMS
@link https://haxme.org/haxms
@version 1.0.0 Beta (Pre-Release)
fjh
*/
#####################
DEFINE('haXMS_HERE', '');
//Grant access to engine.php
require_once './engine.php';
/*Start Block*/
Engine::init();
//Initialize
$engine = new Engine();
//Create object
/*Everything below is e.g. of manual handling*/
#$mod = $engine->loadMod('login','login.class.php','Login');
#$mod->fetchtemplate('login','index.php');
#$mod->news(10); //Load the latest 10 articles
/*End Block*/
?>
示例5: joinFilter
private function joinFilter($className, $property, $object, $classAlias, $alias = '')
{
$auxClass = $property['itemClass'];
if ($alias == '') {
$alias = $className . '_';
}
$alias .= $property['var'] . '_';
$last = null;
$i = 0;
while ($auxClass != 'Hypersistence') {
Engine::init($auxClass);
$auxClass = ltrim($auxClass, '\\');
$table = '`' . Engine::$map[$auxClass]['table'] . '`';
$char = $this->chars[$i];
$pk = Engine::getPk($auxClass);
if ($property['relType'] == Engine::MANY_TO_ONE) {
$join = 'left join ' . $table . ' ' . $alias . $char . ' on(' . $alias . $char . '.' . $pk['column'] . ' = ' . $classAlias . '.' . $property['column'] . ')';
} else {
if ($property['relType'] == Engine::ONE_TO_MANY) {
$join = 'left join ' . $table . ' ' . $alias . $char . ' on(' . $alias . $char . '.' . $property['joinColumn'] . ' = ' . $classAlias . '.' . $pk['column'] . ')';
} else {
if ($property['relType'] == Engine::MANY_TO_MANY) {
$joinTable = '`' . $property['joinTable'] . '`';
$joinPk = Engine::getPk($property['itemClass']);
$join = 'left join ' . $joinTable . ' ' . $alias . $char . '_j' . ' on(' . $alias . $char . '_j' . '.' . $property['joinColumn'] . ' = ' . $classAlias . '.' . $pk['column'] . ')' . ' left join ' . $table . ' ' . $alias . $char . ' on(' . $alias . $char . '.' . $joinPk['column'] . ' = ' . $alias . $char . '_j' . '.' . $property['inverseJoinColumn'] . ')';
} else {
if ($property['relType'] == 0) {
$join = 'left join ' . $table . ' ' . $alias . $char . ' on(' . $alias . $char . '.' . $pk['column'] . ' = ' . $classAlias . '.' . $last['joinColumn'] . ')';
}
}
}
}
$this->joins[md5($join)] = $join;
$classAlias = $alias . $char;
$property = $pk;
$last = Engine::$map[$auxClass];
foreach (Engine::$map[$auxClass]['properties'] as $p) {
$get = 'get' . $p['var'];
$value = $object->{$get}();
if (!is_null($value) && !$value instanceof QueryBuilder) {
$p['i'] = $i;
if ($p['relType'] == Engine::MANY_TO_ONE || $p['relType'] == Engine::ONE_TO_MANY) {
$this->joinFilter($auxClass, $p, $value, $classAlias, $alias);
} else {
if ($p['relType'] != Engine::MANY_TO_MANY && $p['relType'] != Engine::ONE_TO_MANY) {
if (is_numeric($value)) {
$filter = $alias . $char . '.' . $p['column'] . ' = :' . $alias . $char . '_' . $p['column'];
$this->filters[md5($filter)] = $filter;
$this->bounds[':' . $alias . $char . '_' . $p['column']] = $value;
} else {
$filter = $alias . $char . '.' . $p['column'] . ' like :' . $alias . $char . '_' . $p['column'];
$this->filters[md5($filter)] = $filter;
$this->bounds[':' . $alias . $char . '_' . $p['column']] = '%' . preg_replace('/[ \\t]/', '%', trim($value)) . '%';
}
if ($p['primaryKey']) {
return;
}
}
}
}
}
$auxClass = Engine::$map[$auxClass]['parent'];
$i++;
}
}