本文整理汇总了PHP中g函数的典型用法代码示例。如果您正苦于以下问题:PHP g函数的具体用法?PHP g怎么用?PHP g使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了g函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runlog
public static function runlog($message, $level, $repeatcheck = false)
{
$request = \yk::app()->getDispatcher()->getRequest();
$env = array('clientip' => g('_clientip'), 'uid' => g('uid'), 'siteurl' => APP_NAME . '/' . $request->getModuleName() . '/' . $request->getControllerName() . '/' . $request->getActionName());
$log = $env['clientip'] . "\t{$env['uid']}\t{$env['siteurl']}\t" . "\n" . $message;
self::write($log, $level, $repeatcheck);
}
示例2: Main
class P
{
public static function Main()
{
if ($x) {
function g()
{
echo "g1\n";
}
class T
{
function f()
{
echo "T1::f\n";
}
}
} else {
function g()
{
echo "g2\n";
}
class T
{
function f()
{
echo "T2::f\n";
}
}
}
$t = new T();
$t->f();
g();
}
}
示例3: render
function render($data = NULL, $layout = NULL, $sharp = 'default', $pathinfo = false)
{
if ($layout == null) {
if (is_ajax_request()) {
$layout = 'ajax';
} elseif (is_mobile_request()) {
$layout = 'mobile';
} else {
$layout = 'web';
}
}
$GLOBALS['layout'] = $layout;
$GLOBALS['sharp'] = $sharp;
$layout_file = AROOT . 'view/layout/' . $layout . '/' . $sharp . '.tpl.html';
$data = apply_filter('CTRL_' . g('c') . '_' . g('a') . '_RENDER_FILTER', $data);
$GLOBALS['LP_RENDER_DATA'] = $data;
if (file_exists($layout_file)) {
@extract($data);
require $layout_file;
} else {
$layout_file = CROOT . 'view/layout/' . $layout . '/' . $sharp . '.tpl.html';
if (file_exists($layout_file)) {
@extract($data);
require $layout_file;
}
}
}
示例4: decode
public static function decode($str, $key = null)
{
if ($key == null) {
$key = g('_config/security/authkey');
}
return self::rc4($str, self::$_decode, $key);
}
示例5: __construct
function __construct()
{
parent::__construct();
if (strtolower(g('a')) != 'api') {
session_start();
}
}
示例6: test_g
public function test_g()
{
unset($GLOBALS['test']);
$this->assertFalse(g('test'));
$GLOBALS['test'] = 'im';
$this->assertEqual(g('test'), 'im');
}
示例7: f
function f(&$p)
{
echo '$p ' . (isset($p) ? "is set\n" : "is not set\n");
g($p);
echo '$p ' . (isset($p) ? "is set\n" : "is not set\n");
var_dump($p);
}
示例8: g
function g($a = null, $s = 'g')
{
$s .= $a ?: 'o';
return $a ? $s : function ($a = null) use($s) {
return g($a, $s);
};
}
示例9: ajax_render
function ajax_render($dat, $tpl = '', $dir = false, $ret = false)
{
if ($ret) {
return array($dat, $tpl);
}
if (is_array($dat)) {
extract($dat);
} else {
$content = $dat;
$title = '系统消息';
}
header("Content-Type:text/html; charset=utf-8");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if (!$dir) {
$dir = t(g('m'));
}
if ($tpl == 'info') {
$tpl = $tpl = AROOT . 'view/layout/ajax/info.tpl.html';
} elseif ($tpl) {
$tpl = AROOT . 'view/layout/ajax/' . $dir . '/' . $tpl . '.tpl.html';
} else {
$tpl = AROOT . 'view/layout/ajax/' . $dir . '/' . t(g('a')) . '.tpl.html';
}
require_once $tpl;
}
示例10: ListarLocales
function ListarLocales()
{
global $action;
$res = Seleccion("Local", "", "IdLocal ASC", "");
if (!$res) {
echo gas("aviso", "No hay locales disponibles");
} else {
//echo gas("titulo",_("Lista de locales"));
echo "<center>";
echo "<table border=0 class=forma>";
echo "<tr><td class='lh'>Local</td><td class='lh'></td><td class='lh'></td></tr>";
while ($oLocal = LocalFactory($res)) {
$id = $oLocal->getId();
//error("Info: id es '$id'");
$nombre = $oLocal->getNombre();
$linkEdicion = gAccion("editar", _("Modificar"), $id);
$linkborrado = gAccionConfirmada("borrar", _("Eliminar"), $id, _("¿Seguro que quiere borrar?"));
echo "<tr class='f'><td class=nombre>{$nombre}</td><td>{$linkEdicion}</td><td>{$linkborrado}</td></tr>";
}
echo "<tr class='f'><td></td><td></td><td></td></tr>";
echo "<tr class='f'><td></td><td>" . g('center', gAccion('alta', _('Nuevo local'))) . "</td><td></td></tr>";
echo "</table>";
//TODO: debe ser relativo a un parametro: permitealtalocales
//echo g("center",gAccion("alta",_("Nuevo local")));
}
userOperacionesConLocales();
echo "</center>";
}
示例11: f
function f()
{
function g()
{
echo __CLASS__;
}
g();
}
示例12: gt
function gt($param)
{
$val = g($param);
if ($val === false) {
return false;
}
return trim($val);
}
示例13: __construct
function __construct()
{
// load datafunction
$data_function_file = AROOT . 'function/' . g('m') . '.function.php';
if (file_exists($data_function_file)) {
require_once $data_function_file;
}
}
示例14: storyInfo
function storyInfo()
{
$uri = g('uri');
$userId = g('userId');
st_db_object()->rawQuery("CALL MOVESTORIESFORWARD()");
$db_data = st_db_object()->rawQuery("\n SELECT \n (SELECT COUNT(*) FROM `story_user` WHERE `story_user`.`FK_story_id` = `story`.`id`) AS num_players,\n `story`.`time_limit` AS time_limit,\n (CASE\n WHEN `story`.`current_turn` > 0 THEN\n (SELECT MAX(`turn`.`timestamp`) FROM `turn` WHERE `turn`.`FK_story_id` = `story`.`id`)\n ELSE\n `story`.`started_at`\n END) AS turn_start,\n NOW() AS now_time,\n `story`.`current_turn` AS current_turn,\n (SELECT `story_user`.`turn_order` FROM `story_user` WHERE `story_user`.`FK_user_id` = ? AND `story_user`.`FK_story_id` = `story`.`id` LIMIT 1) AS turn_order\n FROM \n `story` \n WHERE \n `story`.`uri` = ?\n ", array($userId, $uri));
echo json_encode($db_data[0]);
}
示例15: f
function f($arg1, $arg2, $arg3)
{
function g($arg4)
{
var_dump(xdebug_get_function_stack());
}
g($arg1 - 2);
}