diff --git a/.gitignore b/.gitignore index 7a3db24..66be2e1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,6 @@ ffmpeg-*/ alltube-*.zip coverage/ bower_components/ -config.yml +config/config.yml docs/ clover.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 898a247..bdf974a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,5 +2,5 @@ Before opening a new issue, make sure that: * It has not already been [reported](https://github.com/Rudloff/alltube/issues). -* You read the [README](README.md) and the [FAQ](FAQ.md). +* You read the [README](README.md) and the [FAQ](resources/FAQ.md). * You can provide **logs**. diff --git a/Dockerfile b/Dockerfile index 211291d..209d2e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN docker-php-ext-install intl RUN docker-php-ext-install zip RUN a2enmod rewrite RUN curl -sS https://getcomposer.org/installer | php -COPY php.ini /usr/local/etc/php/ +COPY resources/php.ini /usr/local/etc/php/ COPY . /var/www/html/ RUN php composer.phar install --prefer-dist RUN npm install diff --git a/Gruntfile.js b/Gruntfile.js index dcc42ff..8f75c48 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -68,7 +68,7 @@ module.exports = function (grunt) { options: { archive: 'alltube-<%= githash.main.tag %>.zip' }, - src: ['*.php', '!config.yml', 'dist/**', '.htaccess', 'img/**', 'LICENSE', 'README.md', 'robots.txt', 'sitemap.xml', 'templates/**', 'templates_c/', 'vendor/**', 'classes/**', 'controllers/**', 'bower_components/**', '!vendor/ffmpeg/**', '!vendor/bin/ffmpeg', '!vendor/phpunit/**', '!vendor/squizlabs/**'] + src: ['*.php', '!config/config.yml', 'dist/**', '.htaccess', 'img/**', 'LICENSE', 'README.md', 'robots.txt', 'resources/sitemap.xml', 'templates/**', 'templates_c/', 'vendor/**', 'classes/**', 'controllers/**', 'bower_components/**', '!vendor/ffmpeg/**', '!vendor/bin/ffmpeg', '!vendor/phpunit/**', '!vendor/squizlabs/**'] } }, phpdocumentor: { @@ -80,7 +80,7 @@ module.exports = function (grunt) { }, jsonlint: { manifests: { - src: ['*.json', '*.webapp'], + src: ['*.json', 'resources/*.json'], options: { format: true } diff --git a/README.md b/README.md index 776aca9..1781fcb 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ composer install If you want to use a custom config, you need to create a config file: ```bash -cp config.example.yml config.yml +cp config/config.example.yml config/config.yml ``` ## PHP requirements @@ -168,7 +168,7 @@ You can also have a look at this [example project](https://github.com/Rudloff/al ## FAQ -Please read the [FAQ](FAQ.md) before reporting any issue. +Please read the [FAQ](resources/FAQ.md) before reporting any issue. ## License diff --git a/classes/Config.php b/classes/Config.php index be22a3e..306c28e 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -126,13 +126,13 @@ class Config * * @return Config */ - public static function getInstance($yamlfile = 'config.yml') + public static function getInstance($yamlfile = 'config/config.yml') { $yamlPath = __DIR__.'/../'.$yamlfile; if (is_null(self::$instance) || self::$instance->file != $yamlfile) { if (is_file($yamlfile)) { $options = Yaml::parse(file_get_contents($yamlPath)); - } elseif ($yamlfile == 'config.yml' || empty($yamlfile)) { + } elseif ($yamlfile == 'config/config.yml' || empty($yamlfile)) { /* Allow for the default file to be missing in order to not surprise users that did not create a config file diff --git a/composer.json b/composer.json index f254ef0..18f4a7b 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "extra": { "paas": { "nginx-includes": [ - "nginx.conf" + "resources/nginx.conf" ] } }, diff --git a/config.example.yml b/config/config.example.yml similarity index 100% rename from config.example.yml rename to config/config.example.yml diff --git a/config_test.yml b/config/config_test.yml similarity index 100% rename from config_test.yml rename to config/config_test.yml diff --git a/FAQ.md b/resources/FAQ.md similarity index 98% rename from FAQ.md rename to resources/FAQ.md index 90e10c7..b5f01bc 100644 --- a/FAQ.md +++ b/resources/FAQ.md @@ -9,7 +9,7 @@ You can ususally download the video by doing *File > Save to* or *ctrl + S*. ## How do I change config parameters? -You need to create a YAML file called `config.yml` at the root of your project. +You need to create a YAML file called `config.yml` in the `config/` folder. Here are the parameters that you can set: * `youtubedl`: path to your youtube-dl binary diff --git a/error.html b/resources/error.html similarity index 100% rename from error.html rename to resources/error.html diff --git a/maintenance.html b/resources/maintenance.html similarity index 100% rename from maintenance.html rename to resources/maintenance.html diff --git a/manifest.json b/resources/manifest.json similarity index 100% rename from manifest.json rename to resources/manifest.json diff --git a/nginx.conf b/resources/nginx.conf similarity index 100% rename from nginx.conf rename to resources/nginx.conf diff --git a/php.ini b/resources/php.ini similarity index 100% rename from php.ini rename to resources/php.ini diff --git a/sitemap.xml b/resources/sitemap.xml similarity index 100% rename from sitemap.xml rename to resources/sitemap.xml diff --git a/robots.txt b/robots.txt index 48fbc65..d645b36 100644 --- a/robots.txt +++ b/robots.txt @@ -1 +1 @@ -Sitemap: http://alltubedownload.net/sitemap.xml +Sitemap: http://alltubedownload.net/resources/sitemap.xml diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl index f32f5bd..392c7c2 100644 --- a/templates/inc/head.tpl +++ b/templates/inc/head.tpl @@ -20,6 +20,6 @@ - + diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index f0ba659..f37935c 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -24,7 +24,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->config = Config::getInstance('config_test.yml'); + $this->config = Config::getInstance('config/config_test.yml'); } /** @@ -83,7 +83,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase Config::destroyInstance(); putenv('CONVERT=1'); putenv('PYTHON=foo'); - $config = Config::getInstance('config_test.yml'); + $config = Config::getInstance('config/config_test.yml'); $this->assertEquals($config->convert, true); $this->assertEquals($config->python, 'foo'); putenv('CONVERT'); diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index a307252..55d1440 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -55,7 +55,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase $this->request = Request::createFromEnvironment(Environment::mock()); $this->response = new Response(); $this->container['view'] = ViewFactory::create($this->container, $this->request); - $this->controller = new FrontController($this->container, Config::getInstance('config_test.yml')); + $this->controller = new FrontController($this->container, Config::getInstance('config/config_test.yml')); $this->container['router']->map(['GET'], '/', [$this->controller, 'index']) ->setName('index'); $this->container['router']->map(['GET'], '/video', [$this->controller, 'video']) diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index 60d7f0f..5227da1 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -25,7 +25,7 @@ class VideoDownloadTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->download = new VideoDownload(Config::getInstance('config_test.yml')); + $this->download = new VideoDownload(Config::getInstance('config/config_test.yml')); } /**