dirname(__FILE__) -> __DIR__

This commit is contained in:
Andrew Dolgov 2021-02-22 17:38:46 +03:00
parent add6242e51
commit 42173386b3
13 changed files with 19 additions and 19 deletions

View File

@ -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("..");

View File

@ -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"];

View File

@ -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";

View File

@ -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";

View File

@ -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]";

View File

@ -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)";

View File

@ -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";

View File

@ -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");
}

View File

@ -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) {

View File

@ -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")) {

View File

@ -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";

View File

@ -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";

View File

@ -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);