mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
no message
This commit is contained in:
parent
ad3990f9bb
commit
4ba0d52456
2573 changed files with 52 additions and 73 deletions
30
common.php
30
common.php
|
@ -17,23 +17,11 @@ header('X-Frame-Options: SAMEORIGIN');
|
||||||
|
|
||||||
// Get initial config
|
// Get initial config
|
||||||
require(BB_ROOT . 'library/config.php');
|
require(BB_ROOT . 'library/config.php');
|
||||||
|
require(TP_DIR . 'Autoloader.php');
|
||||||
$fileDir = dirname(__FILE__);
|
TorrentPier_Autoloader::getInstance()->setupAutoloader(TP_DIR);
|
||||||
|
|
||||||
require($fileDir . '/library/TorrentPier/Autoloader.php');
|
|
||||||
TorrentPier_Autoloader::getInstance()->setupAutoloader($fileDir . '/library/TorrentPier');
|
|
||||||
|
|
||||||
// Load Zend Framework
|
|
||||||
use Zend\Loader\StandardAutoloader;
|
|
||||||
require(BB_ROOT . 'library/Zend/Loader/StandardAutoloader.php');
|
|
||||||
$loader = new StandardAutoloader(array('autoregister_zf' => true));
|
|
||||||
$loader->register();
|
|
||||||
|
|
||||||
// ZF global use
|
|
||||||
use Zend\Json;
|
|
||||||
|
|
||||||
$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';
|
$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';
|
||||||
$server_port = (in_array($bb_cfg['server_port'], array(80, 443))) ? '' : ':' . $bb_cfg['server_port'];
|
$server_port = (in_array($bb_cfg['server_port'], [80, 443])) ? '' : ':' . $bb_cfg['server_port'];
|
||||||
define('FORUM_PATH', $bb_cfg['script_path']);
|
define('FORUM_PATH', $bb_cfg['script_path']);
|
||||||
define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']);
|
define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']);
|
||||||
unset($server_protocol, $server_port);
|
unset($server_protocol, $server_port);
|
||||||
|
@ -124,11 +112,11 @@ switch ($bb_cfg['datastore_type'])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
$default_cfg = array(
|
$default_cfg = [
|
||||||
'db_file_path' => $bb_cfg['cache']['db_dir'] .'datastore.sqlite.db',
|
'db_file_path' => $bb_cfg['cache']['db_dir'] .'datastore.sqlite.db',
|
||||||
'pconnect' => true,
|
'pconnect' => true,
|
||||||
'con_required' => true,
|
'con_required' => true,
|
||||||
);
|
];
|
||||||
$datastore = new datastore_sqlite($default_cfg, $bb_cfg['cache']['prefix']);
|
$datastore = new datastore_sqlite($default_cfg, $bb_cfg['cache']['prefix']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -255,7 +243,7 @@ function verify_id ($id, $length)
|
||||||
|
|
||||||
function clean_filename ($fname)
|
function clean_filename ($fname)
|
||||||
{
|
{
|
||||||
static $s = array('\\', '/', ':', '*', '?', '"', '<', '>', '|', ' ');
|
static $s = ['\\', '/', ':', '*', '?', '"', '<', '>', '|', ' '];
|
||||||
return str_replace($s, '_', str_compact($fname));
|
return str_replace($s, '_', str_compact($fname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,7 +446,7 @@ function log_request ($file = '', $prepend_str = false, $add_post = true)
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$file = ($file) ? $file : 'req/'. date('m-d');
|
$file = ($file) ? $file : 'req/'. date('m-d');
|
||||||
$str = array();
|
$str = [];
|
||||||
$str[] = date('m-d H:i:s');
|
$str[] = date('m-d H:i:s');
|
||||||
if ($prepend_str !== false) $str[] = $prepend_str;
|
if ($prepend_str !== false) $str[] = $prepend_str;
|
||||||
if (!empty($user->data)) $str[] = $user->id ."\t". html_entity_decode($user->name);
|
if (!empty($user->data)) $str[] = $user->id ."\t". html_entity_decode($user->name);
|
||||||
|
@ -491,11 +479,11 @@ else if (defined('IN_TRACKER'))
|
||||||
|
|
||||||
function dummy_exit ($interval = 1800)
|
function dummy_exit ($interval = 1800)
|
||||||
{
|
{
|
||||||
$output = bencode(array(
|
$output = bencode([
|
||||||
'interval' => (int) $interval,
|
'interval' => (int) $interval,
|
||||||
'min interval' => (int) $interval,
|
'min interval' => (int) $interval,
|
||||||
'peers' => (string) DUMMY_PEER,
|
'peers' => (string) DUMMY_PEER,
|
||||||
));
|
]);
|
||||||
|
|
||||||
die($output);
|
die($output);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A constant that must be made available for any other XenForo class to be included.
|
* Class TorrentPier_Autoloader
|
||||||
*
|
|
||||||
* @var boolean
|
|
||||||
*/
|
|
||||||
define('XENFORO_AUTOLOADER_SETUP', true);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base XenForo autoloader class. This must be the first class loaded and setup as the
|
|
||||||
* application/registry depends on it for loading classes.
|
|
||||||
*
|
|
||||||
* @package XenForo_Core
|
|
||||||
*/
|
*/
|
||||||
class TorrentPier_Autoloader
|
class TorrentPier_Autoloader
|
||||||
{
|
{
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue