當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。