<?php
define('CONFIG_PATH', __DIR__ . '/config.php'); // 可宏定义一个配置文件路径,覆盖原有的config
$hphpPath = realpath(__DIR__ . '/h-php');
require __DIR__ . "/h-php/hHttp.php";
$hphp = new Main();
// 访问 http://127.0.0.1:port/external/helloWorld
$hphp->external('helloWorld', __DIR__ . '/myExternal/helloWorld.php');
$hphp->external('sql', __DIR__ . '/myExternal/sql.php');
$hphp->run();
?>
php ./h-php/hPackage.php -c ./config.php
php ./h-php/hPackage.php -c ./h-php/hPhp.config.php // 默认情况下
php ./h-php/hPackage.php -c ./verdor/hunzsig/h-php/hPhp.config.php // 默认composer情况下
php ./verdor/hunzsig/h-php/hPackage.php -c ./config.php
http://host/external/test 如果不想public接口暴露在scope列表中,函数包含“__”即可 如:edit__ 参考 User\Model\InfoModel
http://host/external/map
http://host/external/sql
select * from "default".system_data where (data#>>'{project_name,name}')::text like '%系统%';
select * from "default".system_data where ("data"->'server_pre_alert_limit'->'value')::text::int > 5;
{project_name,name} % #TT || (({project_name,name} % #系统 || {project_name,name} != #xxx) && {server_pre_alert_limit,value} > #1 && ({server_pre_alert_limit,value} > #0 || {server_pre_alert_limit,value} < #100000000))
[ n ] isNull
{?,?,?} n #
[ !n ] isNotNull
{?,?,?} !n #
[ % ] like
{?,?,?} % #???
[ !% ] notLike
{?,?,?} !% #???
[ = ] equalTo
{?,?,?} = #???
[ > ] greaterThan
{?,?,?} > #???
[ < ] lessThan
{?,?,?} < #???
[ >= ] greaterThanOrEqualTo
{?,?,?} >= #???
[ <= ] lessThanOrEqualTo
{?,?,?} <= #???
[ <> , != ] notEqualTo
{?,?,?} <> #???
{?,?,?} != #???
[ >< ] between
{?,?,?} >< #???,???
[ !>< ] notBetween
{?,?,?} !>< #???,???
[ * ] any
{?,?,?} * #???,???,???...
[ ^ ] in
{?,?,?} ^ #???,???,???...
[ !^ ] notIn
{?,?,?} !^ #???,???,???...
$this->db()->schemas('default')->table('system_data')
->field('key,value')
->in('key', $key)
->multi();
$this->db()->table('test')->equalTo('a',1)
->equalTo('b',1)
->closure('or')
->equalTo('c',1)
->equalTo('d',1)
->equalTo('e',1)
->closure('or');
$this->db()->table('test')
->equalTo('a',1)
->equalTo('b',1)
->closure('or')
->equalTo('c',1)
->equalTo('d',1)
->equalTo('e',1)
->closure('or',true);
try {
$this->db()->schemas('default')->table('system_data')->insert($bean->toArray());
} catch (\Exception $e) {
return $this->error($e->getMessage());
}
try {
$this->db()->schemas('default')->table('system_data')->insert($bean->toArray());
$lastId = $this->db()->lastInsertId();
} catch (\Exception $e) {
return $this->error($e->getMessage());
}