3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Database creating page * * @package PhpMyAdmin */ /** * Gets some core libraries */ require_once 'libraries/common.inc.php'; require_once 'libraries/mysql_charsets.inc.php'; if (! PMA_DRIZZLE) { include_once 'libraries/replication.inc.php'; } require 'libraries/build_html_for_db.lib.php'; /** * Defines the url to return to in case of error in a sql statement */ $err_url = 'index.php?' . PMA_URL_getCommon(); /** * Builds and executes the db creation sql query */ $sql_query = 'CREATE DATABASE ' . PMA_Util::backquote($_POST['new_db']); if (! empty($_POST['db_collation'])) { list($db_charset) = explode('_', $_POST['db_collation']); if (in_array($db_charset, $mysql_charsets) && in_array($_POST['db_collation'], $mysql_collations[$db_charset]) ) { $sql_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($_POST['db_collation']); } $db_collation_for_ajax = $_POST['db_collation']; unset($db_charset); } $sql_query .= ';'; $result = $GLOBALS['dbi']->tryQuery($sql_query); if (! $result) { $message = PMA_Message::rawError($GLOBALS['dbi']->getError()); // avoid displaying the not-created db name in header or navi panel $GLOBALS['db'] = ''; $GLOBALS['table'] = ''; /** * If in an Ajax request, just display the message with {@link PMA_Response} */ if ($GLOBALS['is_ajax_request'] == true) { $response = PMA_Response::getInstance(); $response->isSuccess(false); $response->addJSON('message', $message); } else { include_once 'index.php'; } } else { $message = PMA_Message::success(__('Database %1$s has been created.')); $message->addParam($_POST['new_db']); $GLOBALS['db'] = $_POST['new_db']; /** * If in an Ajax request, build the output and send it */ if ($GLOBALS['is_ajax_request'] == true) { //Construct the html for the new database, so that it can be appended to // the list of databases on server_databases.php /** * Build the array to be passed to {@link PMA_URL_getCommon} * to generate the links * * @global array $GLOBALS['db_url_params'] * @name $db_url_params */ $db_url_params['db'] = $_POST['new_db']; $is_superuser = $GLOBALS['dbi']->isSuperuser(); $column_order = PMA_getColumnOrder(); $url_query = PMA_URL_getCommon($_POST['new_db']); /** * String that will contain the output HTML * @name $new_db_string */ $new_db_string = '<tr>'; if (empty($db_collation_for_ajax)) { $db_collation_for_ajax = PMA_getServerCollation(); } // $dbstats comes from the create table dialog if (! empty($dbstats)) { $current = array( 'SCHEMA_NAME' => $_POST['new_db'], 'DEFAULT_COLLATION_NAME' => $db_collation_for_ajax, 'SCHEMA_TABLES' => '0', 'SCHEMA_TABLE_ROWS' => '0', 'SCHEMA_DATA_LENGTH' => '0', 'SCHEMA_MAX_DATA_LENGTH' => '0', 'SCHEMA_INDEX_LENGTH' => '0', 'SCHEMA_LENGTH' => '0', 'SCHEMA_DATA_FREE' => '0' ); } else { $current = array( 'SCHEMA_NAME' => $_POST['new_db'], 'DEFAULT_COLLATION_NAME' => $db_collation_for_ajax ); } list($column_order, $generated_html) = PMA_buildHtmlForDb( $current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info ); $new_db_string .= $generated_html; $new_db_string .= '</tr>'; $response = PMA_Response::getInstance(); $response->addJSON('message', $message); $response->addJSON('new_db_string', $new_db_string); $response->addJSON( 'sql_query', PMA_Util::getMessage( null, $sql_query, 'success' ) ); } else { include_once '' . $cfg['DefaultTabDatabase']; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 58
Branch analysis from position: 23
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 45
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 54
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 98
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 96
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 205
Branch analysis from position: 205
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 96
1 jumps found. (Code = 42) Position 1 = 205
Branch analysis from position: 205
Branch analysis from position: 98
2 jumps found. (Code = 43) Position 1 = 120, Position 2 = 202
Branch analysis from position: 120
2 jumps found. (Code = 43) Position 1 = 142, Position 2 = 145
Branch analysis from position: 142
2 jumps found. (Code = 43) Position 1 = 148, Position 2 = 161
Branch analysis from position: 148
1 jumps found. (Code = 42) Position 1 = 166
Branch analysis from position: 166
1 jumps found. (Code = 42) Position 1 = 205
Branch analysis from position: 205
Branch analysis from position: 161
1 jumps found. (Code = 42) Position 1 = 205
Branch analysis from position: 205
Branch analysis from position: 145
Branch analysis from position: 202
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 45
Branch analysis from position: 58
Branch analysis from position: 6
filename:       /in/ZdNWP
function name:  (null)
number of ops:  206
compiled vars:  !0 = $err_url, !1 = $sql_query, !2 = $db_charset, !3 = $mysql_charsets, !4 = $mysql_collations, !5 = $db_collation_for_ajax, !6 = $result, !7 = $message, !8 = $response, !9 = $db_url_params, !10 = $is_superuser, !11 = $column_order, !12 = $url_query, !13 = $new_db_string, !14 = $dbstats, !15 = $current, !16 = $replication_types, !17 = $replication_info, !18 = $generated_html, !19 = $cfg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INCLUDE_OR_EVAL                                          'libraries%2Fcommon.inc.php', REQUIRE_ONCE
   14     1        INCLUDE_OR_EVAL                                          'libraries%2Fmysql_charsets.inc.php', REQUIRE_ONCE
   15     2        FETCH_CONSTANT                                   ~22     'PMA_DRIZZLE'
          3        BOOL_NOT                                         ~23     ~22
          4      > JMPZ                                                     ~23, ->6
   16     5    >   INCLUDE_OR_EVAL                                          'libraries%2Freplication.inc.php', INCLUDE_ONCE
   18     6    >   INCLUDE_OR_EVAL                                          'libraries%2Fbuild_html_for_db.lib.php', REQUIRE
   23     7        INIT_FCALL_BY_NAME                                       'PMA_URL_getCommon'
          8        DO_FCALL                                      0  $26     
          9        CONCAT                                           ~27     'index.php%3F', $26
         10        ASSIGN                                                   !0, ~27
   28    11        INIT_STATIC_METHOD_CALL                                  'PMA_Util', 'backquote'
         12        CHECK_FUNC_ARG                                           
         13        FETCH_FUNC_ARG               global              $29     '_POST'
         14        FETCH_DIM_FUNC_ARG                               $30     $29, 'new_db'
         15        SEND_FUNC_ARG                                            $30
         16        DO_FCALL                                      0  $31     
         17        CONCAT                                           ~32     'CREATE+DATABASE+', $31
         18        ASSIGN                                                   !1, ~32
   29    19        FETCH_IS                                         ~34     '_POST'
         20        ISSET_ISEMPTY_DIM_OBJ                         1  ~35     ~34, 'db_collation'
         21        BOOL_NOT                                         ~36     ~35
         22      > JMPZ                                                     ~36, ->58
   30    23    >   INIT_FCALL                                               'explode'
         24        SEND_VAL                                                 '_'
         25        FETCH_R                      global              ~37     '_POST'
         26        FETCH_DIM_R                                      ~38     ~37, 'db_collation'
         27        SEND_VAL                                                 ~38
         28        DO_ICALL                                         $39     
         29        FETCH_LIST_R                                     $40     $39, 0
         30        ASSIGN                                                   !2, $40
         31        FREE                                                     $39
   31    32        INIT_FCALL                                               'in_array'
         33        SEND_VAR                                                 !2
         34        SEND_VAR                                                 !3
         35        DO_ICALL                                         $42     
         36      > JMPZ_EX                                          ~43     $42, ->45
   32    37    >   INIT_FCALL                                               'in_array'
         38        FETCH_R                      global              ~44     '_POST'
         39        FETCH_DIM_R                                      ~45     ~44, 'db_collation'
         40        SEND_VAL                                                 ~45
         41        FETCH_DIM_R                                      ~46     !4, !2
         42        SEND_VAL                                                 ~46
         43        DO_ICALL                                         $47     
         44        BOOL                                             ~43     $47
         45    > > JMPZ                                                     ~43, ->54
   35    46    >   INIT_FCALL_BY_NAME                                       'PMA_generateCharsetQueryPart'
         47        CHECK_FUNC_ARG                                           
         48        FETCH_FUNC_ARG               global              $48     '_POST'
         49        FETCH_DIM_FUNC_ARG                               $49     $48, 'db_collation'
         50        SEND_FUNC_ARG                                            $49
         51        DO_FCALL                                      0  $50     
         52        CONCAT                                           ~51     '+DEFAULT', $50
         53        ASSIGN_OP                                     8          !1, ~51
   37    54    >   FETCH_R                      global              ~53     '_POST'
         55        FETCH_DIM_R                                      ~54     ~53, 'db_collation'
         56        ASSIGN                                                   !5, ~54
   38    57        UNSET_CV                                                 !2
   40    58    >   ASSIGN_OP                                     8          !1, '%3B'
   42    59        FETCH_R                      global              ~57     'GLOBALS'
         60        FETCH_DIM_R                                      ~58     ~57, 'dbi'
         61        INIT_METHOD_CALL                                         ~58, 'tryQuery'
         62        SEND_VAR_EX                                              !1
         63        DO_FCALL                                      0  $59     
         64        ASSIGN                                                   !6, $59
   44    65        BOOL_NOT                                         ~61     !6
         66      > JMPZ                                                     ~61, ->98
   45    67    >   INIT_STATIC_METHOD_CALL                                  'PMA_Message', 'rawError'
         68        FETCH_R                      global              ~62     'GLOBALS'
         69        FETCH_DIM_R                                      ~63     ~62, 'dbi'
         70        INIT_METHOD_CALL                                         ~63, 'getError'
         71        DO_FCALL                                      0  $64     
         72        SEND_VAR_NO_REF_EX                                       $64
         73        DO_FCALL                                      0  $65     
         74        ASSIGN                                                   !7, $65
   47    75        FETCH_W                      global              $67     'GLOBALS'
         76        ASSIGN_DIM                                               $67, 'db'
         77        OP_DATA                                                  ''
   48    78        FETCH_W                      global              $69     'GLOBALS'
         79        ASSIGN_DIM                                               $69, 'table'
         80        OP_DATA                                                  ''
   53    81        FETCH_R                      global              ~71     'GLOBALS'
         82        FETCH_DIM_R                                      ~72     ~71, 'is_ajax_request'
         83        BOOL                                             ~73     ~72
         84      > JMPZ                                                     ~73, ->96
   54    85    >   INIT_STATIC_METHOD_CALL                                  'PMA_Response', 'getInstance'
         86        DO_FCALL                                      0  $74     
         87        ASSIGN                                                   !8, $74
   55    88        INIT_METHOD_CALL                                         !8, 'isSuccess'
         89        SEND_VAL_EX                                              <false>
         90        DO_FCALL                                      0          
   56    91        INIT_METHOD_CALL                                         !8, 'addJSON'
         92        SEND_VAL_EX                                              'message'
         93        SEND_VAR_EX                                              !7
         94        DO_FCALL                                      0          
         95      > JMP                                                      ->97
   58    96    >   INCLUDE_OR_EVAL                                          'index.php', INCLUDE_ONCE
         97    > > JMP                                                      ->205
   61    98    >   INIT_STATIC_METHOD_CALL                                  'PMA_Message', 'success'
         99        INIT_FCALL_BY_NAME                                       '__'
        100        SEND_VAL_EX                                              'Database+%251%24s+has+been+created.'
        101        DO_FCALL                                      0  $79     
        102        SEND_VAR_NO_REF_EX                                       $79
        103        DO_FCALL                                      0  $80     
        104        ASSIGN                                                   !7, $80
   62   105        INIT_METHOD_CALL                                         !7, 'addParam'
        106        CHECK_FUNC_ARG                                           
        107        FETCH_FUNC_ARG               global              $82     '_POST'
        108        FETCH_DIM_FUNC_ARG                               $83     $82, 'new_db'
        109        SEND_FUNC_ARG                                            $83
        110        DO_FCALL                                      0          
   63   111        FETCH_R                      global              ~87     '_POST'
        112        FETCH_DIM_R                                      ~88     ~87, 'new_db'
        113        FETCH_W                      global              $85     'GLOBALS'
        114        ASSIGN_DIM                                               $85, 'db'
        115        OP_DATA                                                  ~88
   68   116        FETCH_R                      global              ~89     'GLOBALS'
        117        FETCH_DIM_R                                      ~90     ~89, 'is_ajax_request'
        118        BOOL                                             ~91     ~90
        119      > JMPZ                                                     ~91, ->202
   79   120    >   FETCH_R                      global              ~93     '_POST'
        121        FETCH_DIM_R                                      ~94     ~93, 'new_db'
        122        ASSIGN_DIM                                               !9, 'db'
        123        OP_DATA                                                  ~94
   81   124        FETCH_R                      global              ~95     'GLOBALS'
        125        FETCH_DIM_R                                      ~96     ~95, 'dbi'
        126        INIT_METHOD_CALL                                         ~96, 'isSuperuser'
        127        DO_FCALL                                      0  $97     
        128        ASSIGN                                                   !10, $97
   82   129        INIT_FCALL_BY_NAME                                       'PMA_getColumnOrder'
        130        DO_FCALL                                      0  $99     
        131        ASSIGN                                                   !11, $99
   83   132        INIT_FCALL_BY_NAME                                       'PMA_URL_getCommon'
        133        CHECK_FUNC_ARG                                           
        134        FETCH_FUNC_ARG               global              $101    '_POST'
        135        FETCH_DIM_FUNC_ARG                               $102    $101, 'new_db'
        136        SEND_FUNC_ARG                                            $102
        137        DO_FCALL                                      0  $103    
        138        ASSIGN                                                   !12, $103
   89   139        ASSIGN                                                   !13, '%3Ctr%3E'
   91   140        ISSET_ISEMPTY_CV                                         !5
        141      > JMPZ                                                     ~106, ->145
   92   142    >   INIT_FCALL_BY_NAME                                       'PMA_getServerCollation'
        143        DO_FCALL                                      0  $107    
        144        ASSIGN                                                   !5, $107
   96   145    >   ISSET_ISEMPTY_CV                                 ~109    !14
        146        BOOL_NOT                                         ~110    ~109
        147      > JMPZ                                                     ~110, ->161
   98   148    >   FETCH_R                      global              ~111    '_POST'
        149        FETCH_DIM_R                                      ~112    ~111, 'new_db'
        150        INIT_ARRAY                                       ~113    ~112, 'SCHEMA_NAME'
   99   151        ADD_ARRAY_ELEMENT                                ~113    !5, 'DEFAULT_COLLATION_NAME'
  100   152        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_TABLES'
  101   153        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_TABLE_ROWS'
  102   154        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_DATA_LENGTH'
  103   155        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_MAX_DATA_LENGTH'
  104   156        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_INDEX_LENGTH'
  105   157        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_LENGTH'
  106   158        ADD_ARRAY_ELEMENT                                ~113    '0', 'SCHEMA_DATA_FREE'
   97   159        ASSIGN                                                   !15, ~113
        160      > JMP                                                      ->166
  110   161    >   FETCH_R                      global              ~115    '_POST'
        162        FETCH_DIM_R                                      ~116    ~115, 'new_db'
        163        INIT_ARRAY                                       ~117    ~116, 'SCHEMA_NAME'
  111   164        ADD_ARRAY_ELEMENT                                ~117    !5, 'DEFAULT_COLLATION_NAME'
  109   165        ASSIGN                                                   !15, ~117
  115   166    >   INIT_FCALL_BY_NAME                                       'PMA_buildHtmlForDb'
  116   167        SEND_VAR_EX                                              !15
        168        SEND_VAR_EX                                              !10
        169        SEND_VAR_EX                                              !12
        170        SEND_VAR_EX                                              !11
        171        SEND_VAR_EX                                              !16
        172        SEND_VAR_EX                                              !17
        173        DO_FCALL                                      0  $119    
        174        FETCH_LIST_R                                     $120    $119, 0
  115   175        ASSIGN                                                   !11, $120
        176        FETCH_LIST_R                                     $122    $119, 1
        177        ASSIGN                                                   !18, $122
        178        FREE                                                     $119
  119   179        ASSIGN_OP                                     8          !13, !18
  121   180        ASSIGN_OP                                     8          !13, '%3C%2Ftr%3E'
  123   181        INIT_STATIC_METHOD_CALL                                  'PMA_Response', 'getInstance'
        182        DO_FCALL                                      0  $126    
        183        ASSIGN                                                   !8, $126
  124   184        INIT_METHOD_CALL                                         !8, 'addJSON'
        185        SEND_VAL_EX                                              'message'
        186        SEND_VAR_EX                                              !7
        187        DO_FCALL                                      0          
  125   188        INIT_METHOD_CALL                                         !8, 'addJSON'
        189        SEND_VAL_EX                                              'new_db_string'
        190        SEND_VAR_EX                                              !13
        191        DO_FCALL                                      0          
  126   192        INIT_METHOD_CALL                                         !8, 'addJSON'
  127   193        SEND_VAL_EX                                              'sql_query'
  128   194        INIT_STATIC_METHOD_CALL                                  'PMA_Util', 'getMessage'
  129   195        SEND_VAL_EX                                              null
        196        SEND_VAR_EX                                              !1
        197        SEND_VAL_EX                                              'success'
        198        DO_FCALL                                      0  $130    
        199        SEND_VAR_NO_REF_EX                                       $130
        200        DO_FCALL                                      0          
        201      > JMP                                                      ->205
  133   202    >   FETCH_DIM_R                                      ~132    !19, 'DefaultTabDatabase'
        203        CONCAT                                           ~133    '', ~132
        204        INCLUDE_OR_EVAL                                          ~133, INCLUDE_ONCE
  136   205    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.82 ms | 1412 KiB | 17 Q