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


PHP PMA_RTN_setGlobals函数代码示例

本文整理汇总了PHP中PMA_RTN_setGlobals函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_RTN_setGlobals函数的具体用法?PHP PMA_RTN_setGlobals怎么用?PHP PMA_RTN_setGlobals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_RTN_setGlobals函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_RTN_main

/**
 * Main function for the routines functionality
 *
 * @param string $type 'FUNCTION' for functions,
 *                     'PROCEDURE' for procedures,
 *                     null for both
 *
 * @return void
 */
function PMA_RTN_main($type)
{
    global $db;
    PMA_RTN_setGlobals();
    /**
     * Process all requests
     */
    PMA_RTN_handleEditor();
    PMA_RTN_handleExecute();
    PMA_RTN_handleExport();
    /**
     * Display a list of available routines
     */
    if (!PMA_isValid($type, array('FUNCTION', 'PROCEDURE'))) {
        $type = null;
    }
    $items = $GLOBALS['dbi']->getRoutines($db, $type);
    echo PMA_RTE_getList('routine', $items);
    /**
     * Display the form for adding a new routine, if the user has the privileges.
     */
    echo PMA_RTN_getFooterLinks();
    /**
     * Display a warning for users with PHP's old "mysql" extension.
     */
    if (!PMA\libraries\DatabaseInterface::checkDbExtension('mysqli')) {
        trigger_error(__('You are using PHP\'s deprecated \'mysql\' extension, ' . 'which is not capable of handling multi queries. ' . '[strong]The execution of some stored routines may fail![/strong] ' . 'Please use the improved \'mysqli\' extension to ' . 'avoid any problems.'), E_USER_WARNING);
    }
}
开发者ID:wp-cloud,项目名称:phpmyadmin,代码行数:38,代码来源:rte_routines.lib.php

示例2: PMA_RTN_main

/**
 * Main function for the routines functionality
 *
 * @param string $type 'FUNCTION' for functions,
 *                     'PROCEDURE' for procedures,
 *                     null for both
 *
 * @return void
 */
function PMA_RTN_main($type)
{
    global $db;
    PMA_RTN_setGlobals();
    /**
     * Process all requests
     */
    PMA_RTN_handleEditor();
    PMA_RTN_handleExecute();
    PMA_RTN_handleExport();
    /**
     * Display a list of available routines
     */
    $columns = "`SPECIFIC_NAME`, `ROUTINE_NAME`, `ROUTINE_TYPE`, ";
    $columns .= "`DTD_IDENTIFIER`, `ROUTINE_DEFINITION`";
    $where = "ROUTINE_SCHEMA " . PMA_Util::getCollateForIS() . "=" . "'" . PMA_Util::sqlAddSlashes($db) . "'";
    if (PMA_isValid($type, array('FUNCTION', 'PROCEDURE'))) {
        $where .= " AND `ROUTINE_TYPE`='" . $type . "'";
    }
    $items = $GLOBALS['dbi']->fetchResult("SELECT {$columns} FROM `INFORMATION_SCHEMA`.`ROUTINES` WHERE {$where};");
    echo PMA_RTE_getList('routine', $items);
    /**
     * Display the form for adding a new routine, if the user has the privileges.
     */
    echo PMA_RTN_getFooterLinks();
    /**
     * Display a warning for users with PHP's old "mysql" extension.
     */
    if (!PMA_DatabaseInterface::checkDbExtension('mysqli')) {
        trigger_error(__('You are using PHP\'s deprecated \'mysql\' extension, ' . 'which is not capable of handling multi queries. ' . '[strong]The execution of some stored routines may fail![/strong] ' . 'Please use the improved \'mysqli\' extension to ' . 'avoid any problems.'), E_USER_WARNING);
    }
}
开发者ID:Sorekk,项目名称:cvillecouncilus,代码行数:41,代码来源:rte_routines.lib.php

示例3: PMA_RTN_main

/**
 * Main function for the routines functionality
 *
 * @return nothing
 */
function PMA_RTN_main()
{
    global $db;
    PMA_RTN_setGlobals();
    /**
     * Process all requests
     */
    PMA_RTN_handleEditor();
    PMA_RTN_handleExecute();
    PMA_RTN_handleExport();
    /**
     * Display a list of available routines
     */
    $columns = "`SPECIFIC_NAME`, `ROUTINE_NAME`, `ROUTINE_TYPE`, ";
    $columns .= "`DTD_IDENTIFIER`, `ROUTINE_DEFINITION`";
    $where = "ROUTINE_SCHEMA='" . PMA_Util::sqlAddSlashes($db) . "'";
    $items = PMA_DBI_fetch_result("SELECT {$columns} FROM `INFORMATION_SCHEMA`.`ROUTINES` WHERE {$where};");
    echo PMA_RTE_getList('routine', $items);
    /**
     * Display the form for adding a new routine, if the user has the privileges.
     */
    echo PMA_RTN_getFooterLinks();
    /**
     * Display a warning for users with PHP's old "mysql" extension.
     */
    if ($GLOBALS['cfg']['Server']['extension'] === 'mysql') {
        trigger_error(__('You are using PHP\'s deprecated \'mysql\' extension, ' . 'which is not capable of handling multi queries. ' . '[strong]The execution of some stored routines may fail![/strong] ' . 'Please use the improved \'mysqli\' extension to ' . 'avoid any problems.'), E_USER_WARNING);
    }
}
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:34,代码来源:rte_routines.lib.php

示例4: testgetDataFromRequest

 /**
  * Test for PMA_RTN_getDataFromRequest
  *
  * @param array $in  Input
  * @param array $out Expected output
  *
  * @return void
  *
  * @dataProvider provider
  */
 public function testgetDataFromRequest($in, $out)
 {
     global $cfg, $_REQUEST;
     unset($_REQUEST);
     foreach ($in as $key => $value) {
         if ($value !== '') {
             $_REQUEST[$key] = $value;
         }
     }
     PMA_RTN_setGlobals();
     $this->assertEquals($out, PMA_RTN_getDataFromRequest());
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:22,代码来源:PMA_RTN_getDataFromRequest_test.php

示例5: testgetQueryFromRequest

 /**
  * Test for PMA_RTN_getQueryFromRequest
  *
  * @param array  $request Request
  * @param string $query   Query
  * @param int    $num_err Error number
  *
  * @return void
  *
  * @dataProvider provider
  */
 public function testgetQueryFromRequest($request, $query, $num_err)
 {
     global $_REQUEST, $errors, $cfg;
     $cfg['ShowFunctionFields'] = false;
     $GLOBALS['PMA_Types'] = new PMA_Types_MySQL();
     $errors = array();
     PMA_RTN_setGlobals();
     unset($_REQUEST);
     $_REQUEST = $request;
     $this->assertEquals($query, PMA_RTN_getQueryFromRequest());
     $this->assertEquals($num_err, count($errors));
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:23,代码来源:PMA_RTN_getQueryFromRequest_test.php

示例6: testgetQueryFromRequest

 /**
  * Test for PMA_RTN_getQueryFromRequest
  *
  * @param array  $request Request
  * @param string $query   Query
  * @param int    $num_err Error number
  *
  * @return void
  *
  * @dataProvider provider
  */
 public function testgetQueryFromRequest($request, $query, $num_err)
 {
     global $_REQUEST, $errors, $cfg;
     $cfg['ShowFunctionFields'] = false;
     $GLOBALS['PMA_Types'] = new TypesMySQL();
     $errors = array();
     PMA_RTN_setGlobals();
     $old_dbi = isset($GLOBALS['dbi']) ? $GLOBALS['dbi'] : null;
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->any())->method('escapeString')->will($this->returnValueMap(array(array('foo', null, 'foo'), array("foo's bar", null, "foo\\'s bar"), array('', null, ''))));
     $GLOBALS['dbi'] = $dbi;
     unset($_REQUEST);
     $_REQUEST = $request;
     $this->assertEquals($query, PMA_RTN_getQueryFromRequest());
     $this->assertEquals($num_err, count($errors));
     // reset
     $GLOBALS['dbi'] = $old_dbi;
 }
开发者ID:phpmyadmin,项目名称:phpmyadmin,代码行数:29,代码来源:PMA_RTN_getQueryFromRequest_test.php

示例7: testgetEditorForm_4

 /**
  * @depends testgetParameterRow_ajax
  * @dataProvider provider_editor_4
  */
 public function testgetEditorForm_4($data, $matcher)
 {
     $GLOBALS['is_ajax_request'] = false;
     PMA_RTN_setGlobals();
     $this->assertTag($matcher, PMA_RTN_getEditorForm('edit', 'change', $data), false);
 }
开发者ID:rajatsinghal,项目名称:phpmyadmin,代码行数:10,代码来源:PMA_RTN_getEditorForm_test.php

示例8: testgetExecuteForm_2

 /**
  * Test for PMA_RTN_getExecuteForm
  *
  * @param array $data    Data for routine
  * @param array $matcher Matcher
  *
  * @return void
  *
  * @dataProvider provider_2
  */
 public function testgetExecuteForm_2($data, $matcher)
 {
     $GLOBALS['is_ajax_request'] = true;
     PMA_RTN_setGlobals();
     $this->assertContains($matcher, PMA_RTN_getExecuteForm($data));
 }
开发者ID:elenacaseyroby,项目名称:MetaphoricalFruit,代码行数:16,代码来源:PMA_RTN_getExecuteForm_test.php

示例9: testgetEditorForm4

 /**
  * Test for PMA_RTN_getEditorForm
  *
  * @param array $data    Data for routine
  * @param array $matcher Matcher
  *
  * @return void
  *
  * @depends testgetParameterRowAjax
  * @dataProvider providerEditor4
  */
 public function testgetEditorForm4($data, $matcher)
 {
     PMA_RTN_setGlobals();
     $this->assertContains(
         $matcher,
         PMA_RTN_getEditorForm('edit', 'change', $data)
     );
 }
开发者ID:nijel,项目名称:phpmyadmin,代码行数:19,代码来源:PMA_RTN_getEditorForm_test.php

示例10: test_parseAllParameters

 /**
  * @depends test_parseOneParameter
  * @dataProvider query_provider
  */
 public function test_parseAllParameters($query, $type, $target)
 {
     PMA_RTN_setGlobals();
     $this->assertEquals($target, PMA_RTN_parseAllParameters(PMA_SQP_parse($query), $type));
 }
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:9,代码来源:PMA_RTN_ParameterParser_test.php

示例11: testgetExecuteForm2

 /**
  * Test for PMA_RTN_getExecuteForm
  *
  * @param array $data    Data for routine
  * @param array $matcher Matcher
  *
  * @return void
  *
  * @dataProvider provider2
  */
 public function testgetExecuteForm2($data, $matcher)
 {
     Response::getInstance()->setAjax(true);
     PMA_RTN_setGlobals();
     $this->assertContains(
         $matcher,
         PMA_RTN_getExecuteForm($data)
     );
     Response::getInstance()->setAjax(false);
 }
开发者ID:nijel,项目名称:phpmyadmin,代码行数:20,代码来源:PMA_RTN_getExecuteForm_test.php


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