/** * 单例 * * @return \Lib\Options */ public static function getInstance() { if (!self::$_instance instanceof self) { self::$_instance = new self(); } return self::$_instance; }
<?php ini_set('display_errors', 1); error_reporting(E_ALL && ~E_NOTICE); date_default_timezone_set('Europe/Berlin'); require_once '../lib_helper.php'; require_once '../../config/config.inc.php'; require_once '../lib_mediaobject.php'; require_once '../lib_helper.php'; require_once '../lib_database.php'; require_once '../lib_directory.php'; require_once '../lib_options.php'; $helper = new LibHelper(); $db = new LibDatabase($dbs); $options = new LibOptions(); # 3RD PARTY MODULE SETUP: TVDB ##################################### define('TVDB_URL', $options->get('tvdb_url')); define('TVDB_API_KEY', $options->get('tvdb_api_key')); include __DIR__ . '/../../3rd_party/Moinax/TvDb/CurlException.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Client.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Serie.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Banner.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Episode.php'; use Moinax\TvDb\Client; $tvdb = new Client(TVDB_URL, TVDB_API_KEY); $serverTime = $tvdb->getServerTime(); ##################################################################### $query = $_POST['q']; $theme = $options->get('theme'); $basedir = $options->get('base_directory'); $themepath = $basedir . 'frontend/themes/' . $theme;
<?php ini_set('display_errors', 1); error_reporting(E_ALL && ~E_NOTICE); date_default_timezone_set('Europe/Berlin'); require_once '../../config/config.inc.php'; require_once '../lib_helper.php'; require_once '../lib_database.php'; require_once '../lib_mediaobject.php'; require_once '../lib_options.php'; $helper = new LibHelper(); $db = new LibDatabase($dbs); $options = new LibOptions(); # 3RD PARTY MODULE SETUP: TVDB ##################################### define('TVDB_URL', $options->get('tvdb_url')); define('TVDB_API_KEY', $options->get('tvdb_api_key')); include __DIR__ . '/../../3rd_party/Moinax/TvDb/CurlException.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Client.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Serie.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Banner.php'; include __DIR__ . '/../../3rd_party/Moinax/TvDb/Episode.php'; use Moinax\TvDb\Client; $tvdb = new Client(TVDB_URL, TVDB_API_KEY); $serverTime = $tvdb->getServerTime(); #################################################################### $method = $_POST['m']; $paramString = $_POST['p']; $params = preg_split('/\\*/', $paramString); call_user_func($method, $params[0]); function add_show($showName) {
<?php ini_set('display_errors', 1); error_reporting(E_ALL && ~E_NOTICE); date_default_timezone_set('Europe/Berlin'); require_once 'config/config.inc.php'; require_once 'lib/lib_mediaobject.php'; require_once 'lib/lib_helper.php'; require_once 'lib/lib_database.php'; require_once 'lib/lib_directory.php'; require_once 'lib/lib_options.php'; $helper = new LibHelper(); $db = new LibDatabase($dbs); $options = new LibOptions(); $img_basedir = $options->get('banner_directory'); $tvdb_url = $options->get('tvdb_url'); # GET BANNER FOR SHOW $banner = $tvdb->getBanners($tvshow['tvdb_id'], 'poster'); $tvshow['poster'] = $banner[0]->path; $db->update($tvshow, 'tv_shows'); $db_images = $db->load_all_objects('tv_shows', array('banner')); foreach ($db_images as $image) { $image_path = $img_basedir . $image['banner']; if (!file_exists($image_path)) { $img_url = $tvdb_url . '/banners/_cache/' . $image['banner']; echo $img_url . "\n"; file_put_contents($image_path, fopen($img_url, 'r')); } } ?>
<?php ini_set('display_errors', 1); error_reporting(E_ALL && ~E_NOTICE); date_default_timezone_set('Europe/Berlin'); require_once '../config/config.inc.php'; require_once '../lib/lib_mediaobject.php'; require_once '../lib/lib_helper.php'; require_once '../lib/lib_database.php'; require_once '../lib/lib_directory.php'; require_once '../lib/lib_options.php'; $helper = new LibHelper(); $db = new LibDatabase($dbs); $options = new LibOptions(); # SETUP THEME $theme = $options->get('theme'); if (empty($theme)) { $theme = 'default'; } $themepath = 'themes/' . $theme . '/';
<?php ini_set('display_errors', 1); error_reporting(E_ALL && ~E_NOTICE); date_default_timezone_set('Europe/Berlin'); require_once 'config/config.inc.php'; require_once 'lib/lib_mediaobject.php'; require_once 'lib/lib_helper.php'; require_once 'lib/lib_database.php'; require_once 'lib/lib_directory.php'; require_once 'lib/lib_options.php'; $helper = new LibHelper(); $db = new LibDatabase($dbs); $options = new LibOptions(); # 3RD PARTY MODULE SETUP: TVDB ##################################### define('TVDB_URL', $options->get('tvdb_url')); define('TVDB_API_KEY', $options->get('tvdb_api_key')); include __DIR__ . '/../3rd_party/Moinax/TvDb/CurlException.php'; include __DIR__ . '/../3rd_party/Moinax/TvDb/Client.php'; include __DIR__ . '/../3rd_party/Moinax/TvDb/Serie.php'; include __DIR__ . '/../3rd_party/Moinax/TvDb/Banner.php'; include __DIR__ . '/../3rd_party/Moinax/TvDb/Episode.php'; use Moinax\TvDb\Client; $tvdb = new Client(TVDB_URL, TVDB_API_KEY); $serverTime = $tvdb->getServerTime(); ##################################################################### $img_basedir = $options->get('banner_directory'); $tvdb_url = $options->get('tvdb_url'); $db_images = $db->load_all_objects('tv_shows'); foreach ($db_images as $image) { $banner = $tvdb->getBanners($image['tvdb_id'], 'poster');
<?php ini_set('display_errors', 1); error_reporting(E_ALL); date_default_timezone_set('Europe/Berlin'); $basepath = __DIR__; $param1 = $argv[1]; require_once $basepath . '/../config/config.inc.php'; require_once $basepath . '/../lib/lib_mediaobject.php'; require_once $basepath . '/../lib/lib_helper.php'; require_once $basepath . '/../lib/lib_database.php'; require_once $basepath . '/../lib/lib_directory.php'; require_once $basepath . '/../lib/lib_options.php'; $helper = new LibHelper(); $db = new LibDatabase($dbs); $options = new LibOptions(); $media_objects = array(); $media_directory = $options->get('media_directory'); $md = new LibDirectory($media_directory); $md->add_filetype('avi'); $md->add_filetype('mkv'); $md->load_all_files(); $filelist = $md->get_filelist(); $files_existing = 0; $files_new = 0; foreach ($filelist as $file) { $media_object = new LibMediaObject(); $media_object->set_metadata('filename', $file['basename']); $media_object->set_metadata('filetype', $file['extension']); $media_object->set_metadata('path', $file['dirname']); if ($param1 != 'dryrun') {