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:
@@ -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 {
|
||||
|
@@ -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);
|
||||
|
@@ -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";
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
if (isset($_GET["status"])) {
|
||||
$_GET["variables"] = $_GET["status"];
|
||||
}
|
||||
|
@@ -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() {
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
if (!ob_get_level()) {
|
||||
ob_start(null, 4096);
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$drivers = array();
|
||||
|
||||
/** Add a driver
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// This file is not used in Adminer Editor.
|
||||
|
||||
/** Print select result
|
||||
|
@@ -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);
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// This file is used both in Adminer and Adminer Editor.
|
||||
|
||||
/** Get database connection
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// not used in a single language version
|
||||
|
||||
$langs = array(
|
||||
|
@@ -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() {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
class TmpFile {
|
||||
var $handler;
|
||||
|
@@ -1,2 +1,4 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$VERSION = "5.0.0-dev";
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user