Cleanup root folder (fixes #110)

This commit is contained in:
Pierre Rudloff 2017-05-15 07:25:14 +02:00
parent c1c6c2dd97
commit f9203706f7
21 changed files with 17 additions and 17 deletions

2
.gitignore vendored
View file

@ -9,6 +9,6 @@ ffmpeg-*/
alltube-*.zip
coverage/
bower_components/
config.yml
config/config.yml
docs/
clover.xml

View file

@ -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**.

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -27,7 +27,7 @@
"extra": {
"paas": {
"nginx-includes": [
"nginx.conf"
"resources/nginx.conf"
]
}
},

View file

@ -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

View file

@ -1 +1 @@
Sitemap: http://alltubedownload.net/sitemap.xml
Sitemap: http://alltubedownload.net/resources/sitemap.xml

View file

@ -20,6 +20,6 @@
<meta name="twitter:creator" content="@Tael67" />
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<meta name="theme-color" content="#4F4F4F">
<link rel="manifest" href="{base_url}/manifest.json" />
<link rel="manifest" href="{base_url}/resources/manifest.json" />
</head>
<body class="{$class}">

View file

@ -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');

View file

@ -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'])

View file

@ -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'));
}
/**