1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 20:31:19 +02:00

PHP: Use namespace

This commit is contained in:
Jakub Vrana
2025-03-05 11:28:53 +01:00
parent 5a708df6ca
commit 52c5392089
111 changed files with 230 additions and 20 deletions

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
// any method change in this file should be transferred to editor/include/adminer.inc.php and plugins/plugin.php
class Adminer {

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
$connection = '';
$has_token = $_SESSION["token"];
@@ -144,7 +146,7 @@ function auth_error($error) {
exit;
}
if (isset($_GET["username"]) && !class_exists("Min_DB")) {
if (isset($_GET["username"]) && !class_exists('Adminer\Min_DB')) {
unset($_SESSION["pwds"][DRIVER]);
unset_permanent();
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
include "../adminer/include/version.inc.php";
include "../adminer/include/errors.inc.php";
include "../adminer/include/coverage.inc.php";

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
if (isset($_GET["status"])) {
$_GET["variables"] = $_GET["status"];
}

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
// coverage is used in tests and removed in compilation
if (extension_loaded("xdebug") && file_exists(sys_get_temp_dir() . "/adminer_coverage.ser")) {
function save_coverage() {

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
if (!ob_get_level()) {
ob_start(null, 4096);
}

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
$drivers = array();
/** Add a driver

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
// This file is not used in Adminer Editor.
/** Print select result

View File

@@ -1,7 +1,9 @@
<?php
namespace Adminer;
function adminer_errors($errno, $errstr) {
return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined (array key|property))~', $errstr);
}
error_reporting(6135); // errors and warnings
set_error_handler('adminer_errors', E_WARNING);
set_error_handler('Adminer\adminer_errors', E_WARNING);

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
// This file is used both in Adminer and Adminer Editor.
/** Get database connection

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
// not used in a single language version
$langs = array(

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
// PDO can be used in several database drivers
if (extension_loaded('pdo')) {
/*abstract*/ class Min_PDO {
@@ -80,7 +82,7 @@ if (extension_loaded('pdo')) {
}
}
class Min_PDOStatement extends PDOStatement {
class Min_PDOStatement extends \PDOStatement {
var $_offset = 0, $num_rows;
function fetch_assoc() {

View File

@@ -1,4 +1,5 @@
<?php
namespace Adminer;
class TmpFile {
var $handler;

View File

@@ -1,2 +1,4 @@
<?php
namespace Adminer;
$VERSION = "5.0.0-dev";

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
/** PHP implementation of XXTEA encryption algorithm
* @author Ma Bingyao <andot@ujn.edu.cn>
* @link http://www.coolcode.cn/?action=show&id=128