Reorganised code layout
Separated class library and web interface code Added a common config/database config to be referenced by all subprojects Fixed previous commit
5
.gitignore
vendored
@@ -2,6 +2,7 @@
|
|||||||
.buildpath
|
.buildpath
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
.htaccess
|
/config.php
|
||||||
/dbconfig.conf
|
/dbconfig.conf
|
||||||
tmp/*
|
/webui/.htaccess
|
||||||
|
/webui/tmp/*
|
||||||
|
|||||||
23
config.php.dist
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HandBrakeCluster Library path
|
||||||
|
*
|
||||||
|
* Specifies the absolute or relative path to the HandBrakeCluster library directory, relative to the webui root directory.
|
||||||
|
* Path must end with a trailing slash.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
define('HandBrakeCluster_Lib', '../lib/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HandBrakeCluster Database Configuration
|
||||||
|
*
|
||||||
|
* Specifies the absolute or relative path to the HandBrakeCluster database configuration file.
|
||||||
|
* This is a standard ini type file, containing the config required to connect to the database.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
define('HandBrakeCluster_DBConfig', '../dbconfig.conf');
|
||||||
|
|
||||||
|
?>
|
||||||
5
dbconfig.conf.dist
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
hostname = localhost
|
||||||
|
username = handbrake
|
||||||
|
password = handbrake
|
||||||
|
dbname = handbrake_cluster
|
||||||
|
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
<Files dbconfig.conf>
|
||||||
|
Order Allow,Deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
|
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
@@ -9,8 +9,8 @@ class HandBrakeCluster_Cache {
|
|||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->cache_dir = $config->get('cache.base_dir');
|
$this->cache_dir = $config->get('cache.base_dir');
|
||||||
|
|
||||||
if (is_dir($cache_dir)) {
|
if (is_dir($this->cache_dir)) {
|
||||||
if ( ! is_writeable($cache_dir)) {
|
if ( ! is_writeable($this->cache_dir)) {
|
||||||
throw new HandBrakeCluster_Exception_InvalidCacheDir();
|
throw new HandBrakeCluster_Exception_InvalidCacheDir();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -52,7 +52,7 @@ class HandBrakeCluster_Job {
|
|||||||
|
|
||||||
public static function fromDatabaseRow($row) {
|
public static function fromDatabaseRow($row) {
|
||||||
return new HandBrakeCluster_Job(
|
return new HandBrakeCluster_Job(
|
||||||
HandBrakeCluster_Rips_Source::load($rips['source']),
|
HandBrakeCluster_Rips_Source::load($row['source']),
|
||||||
$row['id'],
|
$row['id'],
|
||||||
$row['name'],
|
$row['name'],
|
||||||
$row['source'],
|
$row['source'],
|
||||||
@@ -18,7 +18,7 @@ class HandBrakeCluster_Main {
|
|||||||
private function __construct() {
|
private function __construct() {
|
||||||
$request_string = isset($_GET['l']) ? $_GET['l'] : '';
|
$request_string = isset($_GET['l']) ? $_GET['l'] : '';
|
||||||
|
|
||||||
$this->config = new HandBrakeCluster_Config("dbconfig.conf");
|
$this->config = new HandBrakeCluster_Config(HandBrakeCluster_DBConfig);
|
||||||
$this->database = new HandBrakeCluster_Database($this->config);
|
$this->database = new HandBrakeCluster_Database($this->config);
|
||||||
$this->config->setDatabase($this->database);
|
$this->config->setDatabase($this->database);
|
||||||
|
|
||||||
@@ -126,12 +126,12 @@ class HandBrakeCluster_Main {
|
|||||||
|
|
||||||
// Special case: All exceptions are stored in the same file
|
// Special case: All exceptions are stored in the same file
|
||||||
if (preg_match('/^HandBrakeCluster_Exception/', $classname)) {
|
if (preg_match('/^HandBrakeCluster_Exception/', $classname)) {
|
||||||
require_once('HandBrakeCluster/Exceptions.class.php');
|
require_once(HandBrakeCluster_Lib . 'HandBrakeCluster/Exceptions.class.php');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace any underscores with directory separators
|
// Replace any underscores with directory separators
|
||||||
$filename = preg_replace('/_/', '/', $classname);
|
$filename = HandBrakeCluster_Lib . preg_replace('/_/', '/', $classname);
|
||||||
|
|
||||||
// Tack on the class file suffix
|
// Tack on the class file suffix
|
||||||
$filename .= '.class.php';
|
$filename .= '.class.php';
|
||||||
6
webui/_inc.php
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../config.php';
|
||||||
|
require_once HandBrakeCluster_Lib . 'HandBrakeCluster/Main.class.php';
|
||||||
|
|
||||||
|
?>
|
||||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'HandBrakeCluster/Main.class.php';
|
define('HBCFile', 'index');
|
||||||
|
|
||||||
|
require '_inc.php';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$main = HandBrakeCluster_Main::instance();
|
$main = HandBrakeCluster_Main::instance();
|
||||||
$smarty = $main->smarty();
|
$smarty = $main->smarty();
|
||||||
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |