summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-22 17:38:46 +0300
committerAndrew Dolgov <[email protected]>2021-02-22 17:38:46 +0300
commit42173386b39bed4b06c5ac6c2fc0da510673b354 (patch)
tree02a71889f4cb0b5874f6307e26352bd7e6772a80
parentadd6242e5148d29be506d753ca4123b900427b7f (diff)
dirname(__FILE__) -> __DIR__
-rw-r--r--api/index.php6
-rw-r--r--backend.php2
-rwxr-xr-xclasses/pluginhost.php4
-rw-r--r--errors.php2
-rw-r--r--include/errorhandler.php4
-rw-r--r--include/functions.php2
-rw-r--r--index.php2
-rw-r--r--plugins/note/init.php2
-rw-r--r--plugins/nsfw/init.php2
-rw-r--r--prefs.php2
-rw-r--r--public.php2
-rwxr-xr-xupdate.php4
-rwxr-xr-xupdate_daemon2.php4
13 files changed, 19 insertions, 19 deletions
diff --git a/api/index.php b/api/index.php
index 1b713d561..6b0071141 100644
--- a/api/index.php
+++ b/api/index.php
@@ -3,9 +3,9 @@
require_once "../config.php";
- set_include_path(dirname(__FILE__) . PATH_SEPARATOR .
- dirname(dirname(__FILE__)) . PATH_SEPARATOR .
- dirname(dirname(__FILE__)) . "/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ . PATH_SEPARATOR .
+ dirname(__DIR__) . PATH_SEPARATOR .
+ dirname(__DIR__) . "/include" . PATH_SEPARATOR .
get_include_path());
chdir("..");
diff --git a/backend.php b/backend.php
index e64c6561f..b6b3e0030 100644
--- a/backend.php
+++ b/backend.php
@@ -1,5 +1,5 @@
<?php
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
$op = $_REQUEST["op"];
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 5121c8491..b6f645a9c 100755
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -274,8 +274,8 @@ class PluginHost {
$class = trim($class);
$class_file = strtolower(basename(clean($class)));
- if (!is_dir(__DIR__."/../plugins/$class_file") &&
- !is_dir(__DIR__."/../plugins.local/$class_file")) continue;
+ if (!is_dir(__DIR__ . "/../plugins/$class_file") &&
+ !is_dir(__DIR__ . "/../plugins.local/$class_file")) continue;
// try system plugin directory first
$file = __DIR__ . "/../plugins/$class_file/init.php";
diff --git a/errors.php b/errors.php
index 597c8429c..3195c4b64 100644
--- a/errors.php
+++ b/errors.php
@@ -1,5 +1,5 @@
<?php
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
require_once "functions.php";
diff --git a/include/errorhandler.php b/include/errorhandler.php
index fab559b76..68e2285c1 100644
--- a/include/errorhandler.php
+++ b/include/errorhandler.php
@@ -48,7 +48,7 @@ function ttrss_error_handler($errno, $errstr, $file, $line) {
if (error_reporting() == 0 || !$errno) return false;
- $file = substr(str_replace(dirname(dirname(__FILE__)), "", $file), 1);
+ $file = substr(str_replace(dirname(__DIR__), "", $file), 1);
$context = format_backtrace(debug_backtrace());
$errstr = truncate_middle($errstr, 16384, " (...) ");
@@ -72,7 +72,7 @@ function ttrss_fatal_handler() {
$context = format_backtrace(debug_backtrace());
- $file = substr(str_replace(dirname(dirname(__FILE__)), "", $file), 1);
+ $file = substr(str_replace(dirname(__DIR__), "", $file), 1);
if ($last_query) $errstr .= " [Last query: $last_query]";
diff --git a/include/functions.php b/include/functions.php
index 1f25f6947..7c4e32963 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -620,7 +620,7 @@
$ttrss_version['version'] = "UNKNOWN (Unsupported)";
date_default_timezone_set('UTC');
- $root_dir = dirname(dirname(__FILE__));
+ $root_dir = dirname(__DIR__);
if (PHP_OS === "Darwin") {
$ttrss_version['version'] = "UNKNOWN (Unsupported, Darwin)";
diff --git a/index.php b/index.php
index 4494082dd..eec54c55b 100644
--- a/index.php
+++ b/index.php
@@ -12,7 +12,7 @@
exit;
}
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
require_once "autoload.php";
diff --git a/plugins/note/init.php b/plugins/note/init.php
index f4bdf45bc..52f7be3eb 100644
--- a/plugins/note/init.php
+++ b/plugins/note/init.php
@@ -17,7 +17,7 @@ class Note extends Plugin {
}
function get_js() {
- return file_get_contents(dirname(__FILE__) . "/note.js");
+ return file_get_contents(__DIR__ . "/note.js");
}
diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php
index 3205b436b..7c5b8d00f 100644
--- a/plugins/nsfw/init.php
+++ b/plugins/nsfw/init.php
@@ -19,7 +19,7 @@ class NSFW extends Plugin {
}
function get_js() {
- return file_get_contents(dirname(__FILE__) . "/init.js");
+ return file_get_contents(__DIR__ . "/init.js");
}
function hook_render_article($article) {
diff --git a/prefs.php b/prefs.php
index d11c6281e..f173d684b 100644
--- a/prefs.php
+++ b/prefs.php
@@ -1,5 +1,5 @@
<?php
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
if (!file_exists("config.php")) {
diff --git a/public.php b/public.php
index fadb2f14d..48fe675f8 100644
--- a/public.php
+++ b/public.php
@@ -1,5 +1,5 @@
<?php
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
require_once "autoload.php";
diff --git a/update.php b/update.php
index 71b8cf76c..ab6272c83 100755
--- a/update.php
+++ b/update.php
@@ -1,11 +1,11 @@
#!/usr/bin/env php
<?php
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
define('DISABLE_SESSIONS', true);
- chdir(dirname(__FILE__));
+ chdir(__DIR__);
require_once "autoload.php";
require_once "functions.php";
diff --git a/update_daemon2.php b/update_daemon2.php
index af4cdedc9..5d4d3759c 100755
--- a/update_daemon2.php
+++ b/update_daemon2.php
@@ -1,10 +1,10 @@
#!/usr/bin/env php
<?php
- set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+ set_include_path(__DIR__ ."/include" . PATH_SEPARATOR .
get_include_path());
declare(ticks = 1);
- chdir(dirname(__FILE__));
+ chdir(__DIR__);
define('DISABLE_SESSIONS', true);