diff --git a/Makefile b/Makefile index 8c5dcfbf6..325d034be 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +PHPCS_BIN := $(HOME)/.composer/vendor/bin/phpcs +PHPCBF_BIN := $(HOME)/.composer/vendor/bin/phpcbf + ROOT_DIRECTORY = $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))") PHP := $(shell which php) PORT := 8000 @@ -37,3 +40,16 @@ clean: .PHONY: clean.all clean.all: clean + +.PHONY: get-phpcs +get-phpcs: + @echo "Global PHPCS path: $(PHPCS_BIN)" + @$(PHPCS_BIN) --version || echo "PHPCS not installed globally" + +.PHONY: phpcs +phpcs: + $(PHPCS_BIN) $(ROOT_DIRECTORY) --standard=$(ROOT_DIRECTORY)/phpcs.xml --report=full + +.PHONY: phpcbf +phpcbf: + $(PHPCBF_BIN) $(ROOT_DIRECTORY) --standard=$(ROOT_DIRECTORY)/phpcs.xml diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 4658e6619..bbedb3882 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -1,4 +1,5 @@ "MySQL / MariaDB") + SqlDriver::$drivers; diff --git a/adminer/drivers/oracle.inc.php b/adminer/drivers/oracle.inc.php index 831effc9d..45a682240 100644 --- a/adminer/drivers/oracle.inc.php +++ b/adminer/drivers/oracle.inc.php @@ -1,4 +1,5 @@ css(); if (is_int(key($css))) { // legacy return value - $css = array_fill_keys($css, 'light'); + $css = array_fill_keys($css, 'light'); } $has_light = in_array('light', $css) || in_array('', $css); $has_dark = in_array('dark', $css) || in_array('', $css); @@ -40,7 +41,7 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s ); $media = " media='(prefers-color-scheme: dark)'"; if ($dark !== false) { - echo "\n"; + echo "\n"; } echo "\n"; @@ -48,23 +49,23 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s echo script_src("../adminer/static/functions.js"); echo script_src("static/editing.js"); if (adminer()->head($dark)) { - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; } foreach ($css as $url => $mode) { - $attrs = ($mode == 'dark' && !$dark - ? $media - : ($mode == 'light' && $has_dark ? " media='(prefers-color-scheme: light)'" : "") - ); - echo "\n"; + $attrs = ($mode == 'dark' && !$dark + ? $media + : ($mode == 'light' && $has_dark ? " media='(prefers-color-scheme: light)'" : "") +); +echo "\n"; } echo "\n
bodyClass(); echo "'>\n"; $filename = get_temp_dir() . "/adminer.version"; if (!$_COOKIE["adminer_version"] && function_exists('openssl_verify') && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds - $version = unserialize(file_get_contents($filename)); - $public = "-----BEGIN PUBLIC KEY----- + $version = unserialize(file_get_contents($filename)); + $public = "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqWOVuF5uw7/+Z70djoK RlHIZFZPO0uYRezq90+7Amk+FDNd7KkL5eDve+vHRJBLAszF/7XKXe11xwliIsFs DFWQlsABVZB3oisKCBEuI71J4kPH8dKGEWR9jDHFw3cWmoH3PmqImX6FISWbG3B8 @@ -74,9 +75,9 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s fQIDAQAB -----END PUBLIC KEY----- "; - if (openssl_verify($version["version"], base64_decode($version["signature"]), $public) == 1) { - $_COOKIE["adminer_version"] = $version["version"]; // doesn't need to send to the browser - } + if (openssl_verify($version["version"], base64_decode($version["signature"]), $public) == 1) { + $_COOKIE["adminer_version"] = $version["version"]; // doesn't need to send to the browser + } } echo script("mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick" . (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '" . VERSION . "', '" . js_escape(ME) . "', '" . get_token() . "')") @@ -90,31 +91,31 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s echo "