Skip to content

Commit

Permalink
Declare $containerBuilder global when necessary
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Jul 31, 2019
1 parent 1a06ab1 commit daf7666
Show file tree
Hide file tree
Showing 51 changed files with 91 additions and 20 deletions.
2 changes: 2 additions & 0 deletions ajax.php
Expand Up @@ -17,6 +17,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

$_GET['ajax_request'] = 'true';

require_once ROOT_PATH . 'libraries/common.inc.php';
Expand Down
2 changes: 2 additions & 0 deletions browse_foreigners.php
Expand Up @@ -18,6 +18,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

Util::checkParameters(['db', 'table', 'field'], true);
Expand Down
2 changes: 2 additions & 0 deletions changelog.php
Expand Up @@ -14,6 +14,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

/**
* Gets core libraries and defines some variables
*/
Expand Down
2 changes: 2 additions & 0 deletions chk_rel.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
10 changes: 6 additions & 4 deletions db_central_columns.php
Expand Up @@ -7,16 +7,18 @@
*/
declare(strict_types=1);

if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

use PhpMyAdmin\CentralColumns;
use PhpMyAdmin\Controllers\Database\CentralColumnsController;
use PhpMyAdmin\Core;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;

if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions db_datadict.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

Util::checkParameters(['db']);
Expand Down
2 changes: 1 addition & 1 deletion db_designer.php
Expand Up @@ -16,7 +16,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db;
global $containerBuilder, $db;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 2 additions & 0 deletions db_events.php
Expand Up @@ -17,6 +17,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 1 addition & 1 deletion db_export.php
Expand Up @@ -19,7 +19,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $table, $url_query;
global $containerBuilder, $db, $table, $url_query;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 2 additions & 0 deletions db_multi_table_query.php
Expand Up @@ -16,6 +16,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 1 addition & 1 deletion db_qbe.php
Expand Up @@ -22,7 +22,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $pmaThemeImage, $url_query;
global $containerBuilder, $db, $pmaThemeImage, $url_query;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 2 additions & 0 deletions db_routines.php
Expand Up @@ -18,6 +18,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions db_sql_autocomplete.php
Expand Up @@ -14,6 +14,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions db_triggers.php
Expand Up @@ -17,6 +17,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions error_report.php
Expand Up @@ -17,6 +17,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

if (! isset($_POST['exception_type'])
Expand Down
2 changes: 1 addition & 1 deletion export.php
Expand Up @@ -26,7 +26,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $sql_query;
global $containerBuilder, $db, $sql_query;

include_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 2 additions & 0 deletions gis_data_editor.php
Expand Up @@ -18,6 +18,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Template $template */
Expand Down
2 changes: 1 addition & 1 deletion import.php
Expand Up @@ -30,7 +30,7 @@
define('PMA_ENABLE_LDI', 1);
}

global $db, $pmaThemeImage, $table;
global $containerBuilder, $db, $pmaThemeImage, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 1 addition & 1 deletion libraries/tbl_columns_definition_form.inc.php
Expand Up @@ -38,7 +38,7 @@
]
);

global $db, $table;
global $containerBuilder, $db, $table;

/** @var Relation $relation */
$relation = $containerBuilder->get('relation');
Expand Down
2 changes: 2 additions & 0 deletions navigation.php
Expand Up @@ -19,6 +19,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 1 addition & 1 deletion normalization.php
Expand Up @@ -17,7 +17,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $db, $table;
global $containerBuilder, $db, $table;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
1 change: 0 additions & 1 deletion phpstan.neon.dist
Expand Up @@ -16,7 +16,6 @@ parameters:
- '#Undefined variable: \$(export_type|err_url|collation_connection|filename_template|transform_key|cn|goto|token_mismatch|auth_plugin|username|hostname|display_query)#'#Others
- '#Undefined variable: \$max_upload_size#'#tbl_import.php
- '#Undefined variable: \$(repobase|fullrevision|revision|repobranchbase|branch)#'#Footer.php
- '#Undefined variable: \$(containerBuilder)#'
- '#Variable \$_(REQUEST|GET|POST|COOKIE|SESSION) in isset\(\) always exists and is not nullable#'#Sanitize.php
- '#Variable \$msg1 might not be defined#'#Twig/I18n/NodeTrans.php
- '#Variable \$(foreign_db|foreign_table) might not be defined#'#Relation.php, do while(false) + break
Expand Down
2 changes: 2 additions & 0 deletions prefs_forms.php
Expand Up @@ -22,6 +22,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

/**
* Gets some core libraries and displays a top message if required
*/
Expand Down
2 changes: 2 additions & 0 deletions prefs_manage.php
Expand Up @@ -23,6 +23,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

/**
* Gets some core libraries and displays a top message if required
*/
Expand Down
2 changes: 2 additions & 0 deletions prefs_twofactor.php
Expand Up @@ -17,6 +17,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

/**
* Gets some core libraries and displays a top message if required
*/
Expand Down
2 changes: 2 additions & 0 deletions schema_export.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/**
Expand Down
2 changes: 2 additions & 0 deletions server_binlog.php
Expand Up @@ -14,6 +14,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var BinlogController $controller */
Expand Down
2 changes: 2 additions & 0 deletions server_replication.php
Expand Up @@ -16,6 +16,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/server_common.inc.php';
require_once ROOT_PATH . 'libraries/replication.inc.php';
Expand Down
2 changes: 2 additions & 0 deletions server_sql.php
Expand Up @@ -16,6 +16,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions server_status_advisor.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/replication.inc.php';

Expand Down
2 changes: 2 additions & 0 deletions server_status_monitor.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/server_common.inc.php';
require_once ROOT_PATH . 'libraries/replication.inc.php';
Expand Down
2 changes: 2 additions & 0 deletions server_status_processes.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/server_common.inc.php';
require_once ROOT_PATH . 'libraries/replication.inc.php';
Expand Down
2 changes: 2 additions & 0 deletions server_status_variables.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/server_common.inc.php';
require_once ROOT_PATH . 'libraries/replication.inc.php';
Expand Down
2 changes: 2 additions & 0 deletions server_user_groups.php
Expand Up @@ -17,6 +17,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions tbl_addfield.php
Expand Up @@ -20,6 +20,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions tbl_chart.php
Expand Up @@ -14,6 +14,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/* Define dependencies for the concerned controller */
Expand Down
2 changes: 2 additions & 0 deletions tbl_create.php
Expand Up @@ -20,6 +20,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions tbl_find_replace.php
Expand Up @@ -16,6 +16,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

/** @var string $url_query Overwritten in tbl_common.inc.php */
$url_query = null;

Expand Down
2 changes: 2 additions & 0 deletions tbl_get_field.php
Expand Up @@ -16,6 +16,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var Response $response */
Expand Down
2 changes: 2 additions & 0 deletions tbl_gis_visualization.php
Expand Up @@ -16,6 +16,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

$sqlQuery = null;
Expand Down
2 changes: 2 additions & 0 deletions tbl_indexes.php
Expand Up @@ -15,6 +15,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/** @var DatabaseInterface $dbi */
Expand Down
2 changes: 1 addition & 1 deletion tbl_operations.php
Expand Up @@ -23,7 +23,7 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $url_query;
global $containerBuilder, $url_query;

require_once ROOT_PATH . 'libraries/common.inc.php';

Expand Down
2 changes: 2 additions & 0 deletions tbl_relation.php
Expand Up @@ -26,6 +26,8 @@
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

global $containerBuilder;

require_once ROOT_PATH . 'libraries/common.inc.php';

/* Define dependencies for the concerned controller */
Expand Down

0 comments on commit daf7666

Please sign in to comment.