当前位置: 首页>>代码示例>>PHP>>正文


PHP g函数代码示例

本文整理汇总了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);
 }
开发者ID:xiaoniainiu,项目名称:php-yaf-yk,代码行数:7,代码来源:log.php

示例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();
    }
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:34,代码来源:ConditionalDecls.php

示例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;
        }
    }
}
开发者ID:xianliflc,项目名称:teamirr,代码行数:27,代码来源:core.function.php

示例4: decode

 public static function decode($str, $key = null)
 {
     if ($key == null) {
         $key = g('_config/security/authkey');
     }
     return self::rc4($str, self::$_decode, $key);
 }
开发者ID:xiaoniainiu,项目名称:php-yaf-yk,代码行数:7,代码来源:auth.php

示例5: __construct

 function __construct()
 {
     parent::__construct();
     if (strtolower(g('a')) != 'api') {
         session_start();
     }
 }
开发者ID:oxmcvusd,项目名称:nowboard,代码行数:7,代码来源:default.class.php

示例6: test_g

 public function test_g()
 {
     unset($GLOBALS['test']);
     $this->assertFalse(g('test'));
     $GLOBALS['test'] = 'im';
     $this->assertEqual(g('test'), 'im');
 }
开发者ID:jfojfo,项目名称:LazyPHP,代码行数:7,代码来源:fast.test.php

示例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);
}
开发者ID:jeremyadoux,项目名称:hhvm,代码行数:7,代码来源:using_byrefs_to_undefined_variables.php

示例8: g

function g($a = null, $s = 'g')
{
    $s .= $a ?: 'o';
    return $a ? $s : function ($a = null) use($s) {
        return g($a, $s);
    };
}
开发者ID:noscripter,项目名称:goal,代码行数:7,代码来源:goal.php

示例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;
}
开发者ID:adamchau,项目名称:teamdisk,代码行数:27,代码来源:core.function.php

示例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>";
}
开发者ID:klich3,项目名称:gPOS,代码行数:28,代码来源:modlocal.php

示例11: f

 function f()
 {
     function g()
     {
         echo __CLASS__;
     }
     g();
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:8,代码来源:_class_.php

示例12: gt

function gt($param)
{
    $val = g($param);
    if ($val === false) {
        return false;
    }
    return trim($val);
}
开发者ID:shaq147,项目名称:ocarina_technologies,代码行数:8,代码来源:functions.php

示例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;
     }
 }
开发者ID:jfojfo,项目名称:LazyREST,代码行数:8,代码来源:core.class.php

示例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]);
}
开发者ID:aliwebir,项目名称:ocarina_technologies,代码行数:8,代码来源:Story.php

示例15: f

function f($arg1, $arg2, $arg3)
{
    function g($arg4)
    {
        var_dump(xdebug_get_function_stack());
    }
    g($arg1 - 2);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:8,代码来源:get_function_stack_noparams.php


注:本文中的g函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。