mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Replaced some file exists to is file (#1276)
* Replaced some file_exists to is_file * Update functions_thumbs.php * Updated * Update CronHelper.php * Updated * Update IPHelper.php * Updated * Update update_forums_atom.php * Update functions.php * Update Validate.php
This commit is contained in:
parent
e8a90b025c
commit
3626143879
24 changed files with 107 additions and 89 deletions
10
common.php
10
common.php
|
@ -49,7 +49,7 @@ if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
|
|||
require_once BB_PATH . '/library/defines.php';
|
||||
|
||||
// Composer
|
||||
if (!file_exists(BB_PATH . '/vendor/autoload.php')) {
|
||||
if (!is_file(BB_PATH . '/vendor/autoload.php')) {
|
||||
die('Please <a href="https://getcomposer.org/download/" target="_blank" rel="noreferrer" style="color:#0a25bb;">install composer</a> and run <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">composer install</code>');
|
||||
}
|
||||
require_once BB_PATH . '/vendor/autoload.php';
|
||||
|
@ -58,10 +58,10 @@ require_once BB_PATH . '/vendor/autoload.php';
|
|||
* Gets the value of an environment variable.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @param mixed|null $default
|
||||
* @return mixed
|
||||
*/
|
||||
function env(string $key, $default = null)
|
||||
function env(string $key, mixed $default = null): mixed
|
||||
{
|
||||
return \TorrentPier\Env::get($key, $default);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ try {
|
|||
require_once BB_PATH . '/library/config.php';
|
||||
|
||||
// Local config
|
||||
if (file_exists(BB_PATH . '/library/config.local.php')) {
|
||||
if (is_file(BB_PATH . '/library/config.local.php')) {
|
||||
require_once BB_PATH . '/library/config.local.php';
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ if (!defined('IN_TRACKER')) {
|
|||
|
||||
if (!defined('IN_ADMIN')) {
|
||||
// Exit if tracker is disabled via ON/OFF trigger
|
||||
if (file_exists(BB_DISABLED)) {
|
||||
if (is_file(BB_DISABLED)) {
|
||||
dummy_exit(random_int(60, 2400));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue