diff --git a/.gitignore b/.gitignore index 39592c6..f658d81 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .buildpath .project .settings -.htaccess +/config.php /dbconfig.conf -tmp/* +/webui/.htaccess +/webui/tmp/* diff --git a/config.php.dist b/config.php.dist new file mode 100644 index 0000000..8d7857d --- /dev/null +++ b/config.php.dist @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/dbconfig.conf.dist b/dbconfig.conf.dist new file mode 100644 index 0000000..5bc9cce --- /dev/null +++ b/dbconfig.conf.dist @@ -0,0 +1,5 @@ +hostname = localhost +username = handbrake +password = handbrake +dbname = handbrake_cluster + diff --git a/.htaccess.dist b/htaccess.dist similarity index 75% rename from .htaccess.dist rename to htaccess.dist index e6e06cc..bcaef13 100644 --- a/.htaccess.dist +++ b/htaccess.dist @@ -1,3 +1,8 @@ + + Order Allow,Deny + Deny from all + + RewriteEngine on diff --git a/HandBrakeCluster/BackgroundTask.class.php b/lib/HandBrakeCluster/BackgroundTask.class.php similarity index 100% rename from HandBrakeCluster/BackgroundTask.class.php rename to lib/HandBrakeCluster/BackgroundTask.class.php diff --git a/HandBrakeCluster/Cache.class.php b/lib/HandBrakeCluster/Cache.class.php similarity index 94% rename from HandBrakeCluster/Cache.class.php rename to lib/HandBrakeCluster/Cache.class.php index 79ca03c..00db080 100644 --- a/HandBrakeCluster/Cache.class.php +++ b/lib/HandBrakeCluster/Cache.class.php @@ -9,8 +9,8 @@ class HandBrakeCluster_Cache { $this->config = $config; $this->cache_dir = $config->get('cache.base_dir'); - if (is_dir($cache_dir)) { - if ( ! is_writeable($cache_dir)) { + if (is_dir($this->cache_dir)) { + if ( ! is_writeable($this->cache_dir)) { throw new HandBrakeCluster_Exception_InvalidCacheDir(); } } else { diff --git a/HandBrakeCluster/ClientLogEntry.class.php b/lib/HandBrakeCluster/ClientLogEntry.class.php similarity index 100% rename from HandBrakeCluster/ClientLogEntry.class.php rename to lib/HandBrakeCluster/ClientLogEntry.class.php diff --git a/HandBrakeCluster/Config.class.php b/lib/HandBrakeCluster/Config.class.php similarity index 100% rename from HandBrakeCluster/Config.class.php rename to lib/HandBrakeCluster/Config.class.php diff --git a/HandBrakeCluster/Database.class.php b/lib/HandBrakeCluster/Database.class.php similarity index 100% rename from HandBrakeCluster/Database.class.php rename to lib/HandBrakeCluster/Database.class.php diff --git a/HandBrakeCluster/Exceptions.class.php b/lib/HandBrakeCluster/Exceptions.class.php similarity index 100% rename from HandBrakeCluster/Exceptions.class.php rename to lib/HandBrakeCluster/Exceptions.class.php diff --git a/HandBrakeCluster/Job.class.php b/lib/HandBrakeCluster/Job.class.php similarity index 99% rename from HandBrakeCluster/Job.class.php rename to lib/HandBrakeCluster/Job.class.php index 940bf0f..f1ef451 100644 --- a/HandBrakeCluster/Job.class.php +++ b/lib/HandBrakeCluster/Job.class.php @@ -52,7 +52,7 @@ class HandBrakeCluster_Job { public static function fromDatabaseRow($row) { return new HandBrakeCluster_Job( - HandBrakeCluster_Rips_Source::load($rips['source']), + HandBrakeCluster_Rips_Source::load($row['source']), $row['id'], $row['name'], $row['source'], diff --git a/HandBrakeCluster/JobStatus.class.php b/lib/HandBrakeCluster/JobStatus.class.php similarity index 100% rename from HandBrakeCluster/JobStatus.class.php rename to lib/HandBrakeCluster/JobStatus.class.php diff --git a/HandBrakeCluster/Log.class.php b/lib/HandBrakeCluster/Log.class.php similarity index 100% rename from HandBrakeCluster/Log.class.php rename to lib/HandBrakeCluster/Log.class.php diff --git a/HandBrakeCluster/LogEntry.class.php b/lib/HandBrakeCluster/LogEntry.class.php similarity index 100% rename from HandBrakeCluster/LogEntry.class.php rename to lib/HandBrakeCluster/LogEntry.class.php diff --git a/HandBrakeCluster/Main.class.php b/lib/HandBrakeCluster/Main.class.php similarity index 95% rename from HandBrakeCluster/Main.class.php rename to lib/HandBrakeCluster/Main.class.php index b68e018..e4c7146 100644 --- a/HandBrakeCluster/Main.class.php +++ b/lib/HandBrakeCluster/Main.class.php @@ -18,7 +18,7 @@ class HandBrakeCluster_Main { private function __construct() { $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->config->setDatabase($this->database); @@ -126,12 +126,12 @@ class HandBrakeCluster_Main { // Special case: All exceptions are stored in the same file if (preg_match('/^HandBrakeCluster_Exception/', $classname)) { - require_once('HandBrakeCluster/Exceptions.class.php'); + require_once(HandBrakeCluster_Lib . 'HandBrakeCluster/Exceptions.class.php'); return; } // Replace any underscores with directory separators - $filename = preg_replace('/_/', '/', $classname); + $filename = HandBrakeCluster_Lib . preg_replace('/_/', '/', $classname); // Tack on the class file suffix $filename .= '.class.php'; diff --git a/HandBrakeCluster/Page.class.php b/lib/HandBrakeCluster/Page.class.php similarity index 100% rename from HandBrakeCluster/Page.class.php rename to lib/HandBrakeCluster/Page.class.php diff --git a/HandBrakeCluster/RequestParser.class.php b/lib/HandBrakeCluster/RequestParser.class.php similarity index 100% rename from HandBrakeCluster/RequestParser.class.php rename to lib/HandBrakeCluster/RequestParser.class.php diff --git a/HandBrakeCluster/Rips/Source.class.php b/lib/HandBrakeCluster/Rips/Source.class.php similarity index 100% rename from HandBrakeCluster/Rips/Source.class.php rename to lib/HandBrakeCluster/Rips/Source.class.php diff --git a/HandBrakeCluster/Rips/SourceAudioTrack.class.php b/lib/HandBrakeCluster/Rips/SourceAudioTrack.class.php similarity index 100% rename from HandBrakeCluster/Rips/SourceAudioTrack.class.php rename to lib/HandBrakeCluster/Rips/SourceAudioTrack.class.php diff --git a/HandBrakeCluster/Rips/SourceLister.class.php b/lib/HandBrakeCluster/Rips/SourceLister.class.php similarity index 100% rename from HandBrakeCluster/Rips/SourceLister.class.php rename to lib/HandBrakeCluster/Rips/SourceLister.class.php diff --git a/HandBrakeCluster/Rips/SourceSubtitleTrack.class.php b/lib/HandBrakeCluster/Rips/SourceSubtitleTrack.class.php similarity index 100% rename from HandBrakeCluster/Rips/SourceSubtitleTrack.class.php rename to lib/HandBrakeCluster/Rips/SourceSubtitleTrack.class.php diff --git a/HandBrakeCluster/Rips/SourceTitle.class.php b/lib/HandBrakeCluster/Rips/SourceTitle.class.php similarity index 100% rename from HandBrakeCluster/Rips/SourceTitle.class.php rename to lib/HandBrakeCluster/Rips/SourceTitle.class.php diff --git a/HandBrakeCluster/WorkerLogEntry.class.php b/lib/HandBrakeCluster/WorkerLogEntry.class.php similarity index 100% rename from HandBrakeCluster/WorkerLogEntry.class.php rename to lib/HandBrakeCluster/WorkerLogEntry.class.php diff --git a/webui/_inc.php b/webui/_inc.php new file mode 100644 index 0000000..a13ff22 --- /dev/null +++ b/webui/_inc.php @@ -0,0 +1,6 @@ + diff --git a/images/caution.png b/webui/images/caution.png similarity index 100% rename from images/caution.png rename to webui/images/caution.png diff --git a/images/redo.png b/webui/images/redo.png similarity index 100% rename from images/redo.png rename to webui/images/redo.png diff --git a/images/trash.png b/webui/images/trash.png similarity index 100% rename from images/trash.png rename to webui/images/trash.png diff --git a/index.php b/webui/index.php similarity index 87% rename from index.php rename to webui/index.php index 5bf9ccb..a55125d 100644 --- a/index.php +++ b/webui/index.php @@ -1,6 +1,9 @@ smarty(); diff --git a/pages/errors/404.php b/webui/pages/errors/404.php similarity index 100% rename from pages/errors/404.php rename to webui/pages/errors/404.php diff --git a/pages/errors/unhandled-exception.php b/webui/pages/errors/unhandled-exception.php similarity index 100% rename from pages/errors/unhandled-exception.php rename to webui/pages/errors/unhandled-exception.php diff --git a/pages/home.php b/webui/pages/home.php similarity index 100% rename from pages/home.php rename to webui/pages/home.php diff --git a/pages/job-details.php b/webui/pages/job-details.php similarity index 100% rename from pages/job-details.php rename to webui/pages/job-details.php diff --git a/pages/jobs.php b/webui/pages/jobs.php similarity index 100% rename from pages/jobs.php rename to webui/pages/jobs.php diff --git a/pages/logs.php b/webui/pages/logs.php similarity index 100% rename from pages/logs.php rename to webui/pages/logs.php diff --git a/pages/rips/setup-rip.php b/webui/pages/rips/setup-rip.php similarity index 100% rename from pages/rips/setup-rip.php rename to webui/pages/rips/setup-rip.php diff --git a/pages/rips/source-details.php b/webui/pages/rips/source-details.php similarity index 100% rename from pages/rips/source-details.php rename to webui/pages/rips/source-details.php diff --git a/pages/rips/sources.php b/webui/pages/rips/sources.php similarity index 100% rename from pages/rips/sources.php rename to webui/pages/rips/sources.php diff --git a/run-jobs.php b/webui/run-jobs.php similarity index 100% rename from run-jobs.php rename to webui/run-jobs.php diff --git a/scripts/3rdparty/jquery-1.4.2.js b/webui/scripts/3rdparty/jquery-1.4.2.js similarity index 100% rename from scripts/3rdparty/jquery-1.4.2.js rename to webui/scripts/3rdparty/jquery-1.4.2.js diff --git a/scripts/3rdparty/jquery-ui-1.8.custom.min.js b/webui/scripts/3rdparty/jquery-ui-1.8.custom.min.js similarity index 100% rename from scripts/3rdparty/jquery-ui-1.8.custom.min.js rename to webui/scripts/3rdparty/jquery-ui-1.8.custom.min.js diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_222222_256x240.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_454545_256x240.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_888888_256x240.png diff --git a/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png b/webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png rename to webui/styles/3rdparty/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png diff --git a/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css b/webui/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css similarity index 100% rename from styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css rename to webui/styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css diff --git a/styles/normal.css b/webui/styles/normal.css similarity index 100% rename from styles/normal.css rename to webui/styles/normal.css diff --git a/templates/admin/settings.tpl b/webui/templates/admin/settings.tpl similarity index 100% rename from templates/admin/settings.tpl rename to webui/templates/admin/settings.tpl diff --git a/templates/errors/404.tpl b/webui/templates/errors/404.tpl similarity index 100% rename from templates/errors/404.tpl rename to webui/templates/errors/404.tpl diff --git a/templates/errors/unhandled-exception.tpl b/webui/templates/errors/unhandled-exception.tpl similarity index 100% rename from templates/errors/unhandled-exception.tpl rename to webui/templates/errors/unhandled-exception.tpl diff --git a/templates/home.tpl b/webui/templates/home.tpl similarity index 100% rename from templates/home.tpl rename to webui/templates/home.tpl diff --git a/templates/index.tpl b/webui/templates/index.tpl similarity index 100% rename from templates/index.tpl rename to webui/templates/index.tpl diff --git a/templates/job-details.tpl b/webui/templates/job-details.tpl similarity index 100% rename from templates/job-details.tpl rename to webui/templates/job-details.tpl diff --git a/templates/jobs.tpl b/webui/templates/jobs.tpl similarity index 100% rename from templates/jobs.tpl rename to webui/templates/jobs.tpl diff --git a/templates/logs.tpl b/webui/templates/logs.tpl similarity index 100% rename from templates/logs.tpl rename to webui/templates/logs.tpl diff --git a/templates/navigation.tpl b/webui/templates/navigation.tpl similarity index 100% rename from templates/navigation.tpl rename to webui/templates/navigation.tpl diff --git a/templates/rips/setup-rip.tpl b/webui/templates/rips/setup-rip.tpl similarity index 100% rename from templates/rips/setup-rip.tpl rename to webui/templates/rips/setup-rip.tpl diff --git a/templates/rips/source-details.tpl b/webui/templates/rips/source-details.tpl similarity index 100% rename from templates/rips/source-details.tpl rename to webui/templates/rips/source-details.tpl diff --git a/templates/rips/sources.tpl b/webui/templates/rips/sources.tpl similarity index 100% rename from templates/rips/sources.tpl rename to webui/templates/rips/sources.tpl diff --git a/templates/sidebar.tpl b/webui/templates/sidebar.tpl similarity index 100% rename from templates/sidebar.tpl rename to webui/templates/sidebar.tpl diff --git a/tmp/cache/.gitignore b/webui/tmp/cache/.gitignore similarity index 100% rename from tmp/cache/.gitignore rename to webui/tmp/cache/.gitignore diff --git a/tmp/templates/.gitignore b/webui/tmp/templates/.gitignore similarity index 100% rename from tmp/templates/.gitignore rename to webui/tmp/templates/.gitignore