]> git.joonet.de Git - adminer.git/commitdiff
uses PHP 5 constructors
authorDavid Grudl <david@grudl.com>
Sat, 15 Aug 2015 15:04:21 +0000 (17:04 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 1 Nov 2015 19:08:46 +0000 (11:08 -0800)
25 files changed:
adminer/drivers/elastic.inc.php
adminer/drivers/firebird.inc.php
adminer/drivers/mongo.inc.php
adminer/drivers/mssql.inc.php
adminer/drivers/mysql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/simpledb.inc.php
adminer/drivers/sqlite.inc.php
adminer/include/driver.inc.php
adminer/include/tmpfile.inc.php
plugins/database-hide.php
plugins/edit-calendar.php
plugins/edit-foreign.php
plugins/email-table.php
plugins/file-upload.php
plugins/frames.php
plugins/login-servers.php
plugins/login-table.php
plugins/master-slave.php
plugins/plugin.php
plugins/slugify.php
plugins/sql-log.php
plugins/tinymce.php
plugins/wymeditor.php

index 2028ba3aa152973ba7f5de5348e1c22772b234f9..4ab29c227425e6f0f0fa54be10ce985dbeecd8cd 100644 (file)
@@ -81,7 +81,7 @@ if (isset($_GET["elastic"])) {
                class Min_Result {
                        var $num_rows, $_rows;
 
-                       function Min_Result($rows) {
+                       function __construct($rows) {
                                $this->num_rows = count($this->_rows);
                                $this->_rows = $rows;
                                reset($this->_rows);
index 696ecff8e50d54cd9c1f01a565f036986a883d2f..68f983207a4155080413ceea6d12c7876c37eac5 100644 (file)
@@ -81,7 +81,7 @@ if (isset($_GET["firebird"])) {
                class Min_Result {
                        var $num_rows, $_result, $_offset = 0;
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                $this->_result = $result;
                                // $this->num_rows = ibase_num_rows($result);
                        }
index 2f152c293443001d97800940798b7e83488d88c3..f05ba571b3d708c4b15b1d4d189c19ae469561e5 100644 (file)
@@ -52,7 +52,7 @@ if (isset($_GET["mongo"])) {
                class Min_Result {
                        var $num_rows, $_rows = array(), $_offset = 0, $_charset = array();
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                foreach ($result as $item) {
                                        $row = array();
                                        foreach ($item as $key => $val) {
index 8a8f62065760aec2f8e1c9c8d92d3ad1f40ea937..790ac3f3f66f493f4f05d9c9b5e8a94f2440e3a5 100644 (file)
@@ -93,7 +93,7 @@ if (isset($_GET["mssql"])) {
                class Min_Result {
                        var $_result, $_offset = 0, $_fields, $num_rows;
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                $this->_result = $result;
                                // $this->num_rows = sqlsrv_num_rows($result); // available only in scrollable results
                        }
@@ -201,7 +201,7 @@ if (isset($_GET["mssql"])) {
                class Min_Result {
                        var $_result, $_offset = 0, $_fields, $num_rows;
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                $this->_result = $result;
                                $this->num_rows = mssql_num_rows($result);
                        }
index 47f22a2ad1895f65721ea47308e86cee9fce2e43..51aa407284eebd0b083563196aa3ba801c28d473 100644 (file)
@@ -9,7 +9,7 @@ if (!defined("DRIVER")) {
                class Min_DB extends MySQLi {
                        var $extension = "MySQLi";
 
-                       function Min_DB() {
+                       function __construct() {
                                parent::init();
                        }
 
@@ -181,7 +181,7 @@ if (!defined("DRIVER")) {
                        /** Constructor
                        * @param resource
                        */
-                       function Min_Result($result) {
+                       function __construct($result) {
                                $this->_result = $result;
                                $this->num_rows = mysql_num_rows($result);
                        }
index c26c0d25262291fff61a427d51a2e438371bd7e8..363481f6dac45259a179c850a3060beea07bef15 100644 (file)
@@ -80,7 +80,7 @@ if (isset($_GET["oracle"])) {
                class Min_Result {
                        var $_result, $_offset = 1, $num_rows;
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                $this->_result = $result;
                        }
 
index f8c51be832ba020e10b71e53a1fb3a10223b4289..22c9142d36c2323f4007272d9fa5a818d8ec2d42 100644 (file)
@@ -94,7 +94,7 @@ if (isset($_GET["pgsql"])) {
                class Min_Result {
                        var $_result, $_offset = 0, $num_rows;
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                $this->_result = $result;
                                $this->num_rows = pg_num_rows($result);
                        }
index be1c28bb1d01df825653bf4e4a7eeeb071ed07dc..d2c805dd3de02f0fd515f8f35454af7ac4bc7ff3 100644 (file)
@@ -56,7 +56,7 @@ if (isset($_GET["simpledb"])) {
                class Min_Result {
                        var $num_rows, $_rows = array(), $_offset = 0;
 
-                       function Min_Result($result) {
+                       function __construct($result) {
                                foreach ($result as $item) {
                                        $row = array();
                                        if ($item->Name != '') { // SELECT COUNT(*)
index 4b1d9aa2aea5c69f4e6db90029704240dccfd60c..ab018e3f2819c40556a6ce251b615ed0becb7397 100644 (file)
@@ -11,7 +11,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                        class Min_SQLite {
                                var $extension = "SQLite3", $server_info, $affected_rows, $errno, $error, $_link;
 
-                               function Min_SQLite($filename) {
+                               function __construct($filename) {
                                        $this->_link = new SQLite3($filename);
                                        $version = $this->_link->version();
                                        $this->server_info = $version["versionString"];
@@ -55,7 +55,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                        class Min_Result {
                                var $_result, $_offset = 0, $num_rows;
 
-                               function Min_Result($result) {
+                               function __construct($result) {
                                        $this->_result = $result;
                                }
 
@@ -87,7 +87,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                        class Min_SQLite {
                                var $extension = "SQLite", $server_info, $affected_rows, $error, $_link;
 
-                               function Min_SQLite($filename) {
+                               function __construct($filename) {
                                        $this->server_info = sqlite_libversion();
                                        $this->_link = new SQLiteDatabase($filename);
                                }
@@ -127,7 +127,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                        class Min_Result {
                                var $_result, $_offset = 0, $num_rows;
 
-                               function Min_Result($result) {
+                               function __construct($result) {
                                        $this->_result = $result;
                                        if (method_exists($result, 'numRows')) { // not available in unbuffered query
                                                $this->num_rows = $result->numRows();
@@ -172,7 +172,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                class Min_SQLite extends Min_PDO {
                        var $extension = "PDO_SQLite";
 
-                       function Min_SQLite($filename) {
+                       function __construct($filename) {
                                $this->dsn(DRIVER . ":$filename", "", "");
                        }
                }
@@ -182,13 +182,13 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
        if (class_exists("Min_SQLite")) {
                class Min_DB extends Min_SQLite {
 
-                       function Min_DB() {
-                               $this->Min_SQLite(":memory:");
+                       function __construct() {
+                               parent::__construct(":memory:");
                        }
 
                        function select_db($filename) {
                                if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
-                                       $this->Min_SQLite($filename);
+                                       parent::__construct($filename);
                                        return true;
                                }
                                return false;
@@ -440,7 +440,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
 
        function drop_databases($databases) {
                global $connection;
-               $connection->Min_SQLite(":memory:"); // to unlock file, doesn't work in PDO on Windows
+               $connection->__construct(":memory:"); // to unlock file, doesn't work in PDO on Windows
                foreach ($databases as $db) {
                        if (!@unlink($db)) {
                                $connection->error = lang('File exists.');
@@ -455,7 +455,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                if (!check_sqlite_name($name)) {
                        return false;
                }
-               $connection->Min_SQLite(":memory:");
+               $connection->__construct(":memory:");
                $connection->error = lang('File exists.');
                return @rename(DB, $name);
        }
index 2b06e90a546b936d2a4afa13e00e018ffadca677..ba4c1ef0b632d16d3397cef9c1d2de1c088dc657 100644 (file)
@@ -6,7 +6,7 @@
        /** Create object for performing database operations
        * @param Min_DB
        */
-       function Min_SQL($connection) {
+       function __construct($connection) {
                $this->_conn = $connection;
        }
        
index 2038868e8c00c78ec5f5ee4fb278495f955fe570..a7ca9164261e72d7dae47a33e999fda1a5f20019 100644 (file)
@@ -4,7 +4,7 @@ class TmpFile {
        var $handler;
        var $size;
        
-       function TmpFile() {
+       function __construct() {
                $this->handler = tmpfile();
        }
        
index 314dc4a3f7678803e29696c81467a07fcd0692c3..17e648c031cc6648e0cf3c1a5197d3e5c1cdbe6e 100644 (file)
@@ -12,7 +12,7 @@ class AdminerDatabaseHide {
        /**
        * @param array case insensitive database names in values
        */
-       function AdminerDatabaseHide($disabled) {
+       function __construct($disabled) {
                $this->disabled = array_map('strtolower', $disabled);
        }
        
index f664213a4501f9db92354b1a44885cb690b4f2f5..ea8dd11c9d32f07a03f23684eeeee45c9ae16b16 100644 (file)
@@ -16,7 +16,7 @@ class AdminerEditCalendar {
        * @param string text to append before first calendar usage
        * @param string path to language file, %s stands for language code
        */
-       function AdminerEditCalendar($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") {
+       function __construct($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") {
                $this->prepend = $prepend;
                $this->langPath = $langPath;
        }
index 98a0be5fd1543e0584426fb80133da069ae057b4..4b78c43c347754264571fae2e4294cbf47397f89 100644 (file)
@@ -9,7 +9,7 @@
 class AdminerEditForeign {
        var $_limit;
        
-       function AdminerEditForeign($limit = 0) {
+       function __construct($limit = 0) {
                $this->_limit = $limit;
        }
        
index f7e1d10e37c5ebe2cdf825569c488ce6f5654b64..d57130d0bc0fa04e3f9721114fc5bbe3aaa9b298 100644 (file)
@@ -17,7 +17,7 @@ class AdminerEmailTable {
        * @param string quoted column name
        * @param string quoted column name
        */
-       function AdminerEmailTable($table = "email", $id = "id", $title = "subject", $subject = "subject", $message = "message") {
+       function __construct($table = "email", $id = "id", $title = "subject", $subject = "subject", $message = "message") {
                $this->table = $table;
                $this->id = $id;
                $this->title = $title;
index c96cb6a7981bc412bc13fa67fb30722f2006e262..939412d2b9586a6517d937733cba567ed80910ef 100644 (file)
@@ -16,7 +16,7 @@ class AdminerFileUpload {
        * @param string prefix for displaying data, null stands for $uploadPath
        * @param string regular expression with allowed file extensions
        */
-       function AdminerFileUpload($uploadPath = "../static/data/", $displayPath = null, $extensions = "[a-zA-Z0-9]+") {
+       function __construct($uploadPath = "../static/data/", $displayPath = null, $extensions = "[a-zA-Z0-9]+") {
                $this->uploadPath = $uploadPath;
                $this->displayPath = ($displayPath !== null ? $displayPath : $uploadPath);
                $this->extensions = $extensions;
index 4520220047fe536574f12d05f80f083aa5a406f2..2eaad2956ddb3f3a550678c3224e5e69cb566e63 100644 (file)
@@ -13,7 +13,7 @@ class AdminerFrames {
        /**
        * @param bool allow running from the same origin only
        */
-       function AdminerFrames($sameOrigin = false) {
+       function __construct($sameOrigin = false) {
                $this->sameOrigin = $sameOrigin;
        }
        
index ce85b58d046bcde0aee90983fb60fa9eb4df0750..d0e2c2083f86b0da5b0e13196646fd31d981b858 100644 (file)
@@ -14,7 +14,7 @@ class AdminerLoginServers {
        * @param array array($domain) or array($domain => $description) or array($category => array())
        * @param string
        */
-       function AdminerLoginServers($servers, $driver = "server") {
+       function __construct($servers, $driver = "server") {
                $this->servers = $servers;
                $this->driver = $driver;
        }
index 11b1e0155b5215971cbcf597a62ec26efb2d235b..32a97fc7ca95ca2b273fda85471dae889385c218 100644 (file)
@@ -22,7 +22,7 @@ class AdminerLoginTable {
        /** Set database of login table
        * @param string
        */
-       function AdminerLoginTable($database) {
+       function __construct($database) {
                $this->database = $database;
        }
        
index 10c545494b44df35499de61ba8ce2a6d4da5f253..29f739d1591a395b251c5dd341617330beafdd69 100644 (file)
@@ -12,7 +12,7 @@ class AdminerMasterSlave {
        /**
        * @param array ($slave => $master)
        */
-       function AdminerMasterSlave($masters) {
+       function __construct($masters) {
                $this->masters = $masters;
        }
        
index 62ee7c4b78d53f9681c75b77a8f14035248f3daf..38e7b36ddfa508496e89f967be469e35a9dac992 100644 (file)
@@ -20,7 +20,7 @@ class AdminerPlugin extends Adminer {
        /** Register plugins
        * @param array object instances or null to register all classes starting by 'Adminer'
        */
-       function AdminerPlugin($plugins) {
+       function __construct($plugins) {
                if ($plugins === null) {
                        $plugins = array();
                        foreach (get_declared_classes() as $class) {
index 3c4b43055ff9302ef4bac8942359ea3eff7968b0..b753b69bebc49c48d9fdb4beee9cf5a0f5660c99 100644 (file)
@@ -14,7 +14,7 @@ class AdminerSlugify {
        * @param string find these characters ...
        * @param string ... and replace them by these
        */
-       function AdminerSlugify($from = 'áčďéěíňóřšťúůýž', $to = 'acdeeinorstuuyz') {
+       function __construct($from = 'áčďéěíňóřšťúůýž', $to = 'acdeeinorstuuyz') {
                $this->from = $from;
                $this->to = $to;
        }
index f962083f6e4500ab921892071cb50a4970328fcf..2c5f2d5fbbfc9081b7123e87cf7463252bf58aab 100644 (file)
@@ -13,7 +13,7 @@ class AdminerSqlLog {
        /**
        * @param string defaults to "$database.sql"
        */
-       function AdminerSqlLog($filename = "") {
+       function __construct($filename = "") {
                $this->filename = $filename;
        }
        
index 4a547c94b1dc0da307f05970f6ce2648cfaa3e6b..e5bedb62d4ae85c04de690a0fe7d1634538dcaf5 100644 (file)
@@ -14,7 +14,7 @@ class AdminerTinymce {
        /**
        * @param string
        */
-       function AdminerTinymce($path = "tiny_mce/tiny_mce.js") {
+       function __construct($path = "tiny_mce/tiny_mce.js") {
                $this->path = $path;
        }
 
index 8185fdb79c436c9a9abc7a221fbca9639f1d5335..20d25afd2371c5b0799cc825494caccf3e4a2ac7 100644 (file)
@@ -15,7 +15,7 @@ class AdminerWymeditor {
        * @param array
        * @param string in format "skin: 'custom', preInit: function () { }"
        */
-       function AdminerWymeditor($scripts = array("jquery/jquery.js", "wymeditor/jquery.wymeditor.min.js"), $options = "") {
+       function __construct($scripts = array("jquery/jquery.js", "wymeditor/jquery.wymeditor.min.js"), $options = "") {
                $this->scripts = $scripts;
                $this->options = $options;
        }