Skip to content

Commit

Permalink
Cleanup root folder (fixes Rudloff#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudloff committed May 15, 2017
1 parent c1c6c2d commit f920370
Show file tree
Hide file tree
Showing 21 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ffmpeg-*/
alltube-*.zip
coverage/
bower_components/
config.yml
config/config.yml
docs/
clover.xml
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -80,7 +80,7 @@ module.exports = function (grunt) {
},
jsonlint: {
manifests: {
src: ['*.json', '*.webapp'],
src: ['*.json', 'resources/*.json'],
options: {
format: true
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions classes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ public function __construct(array $options)
*
* @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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"extra": {
"paas": {
"nginx-includes": [
"nginx.conf"
"resources/nginx.conf"
]
}
},
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion FAQ.md → resources/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion robots.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sitemap: http://alltubedownload.net/sitemap.xml
Sitemap: http://alltubedownload.net/resources/sitemap.xml
2 changes: 1 addition & 1 deletion templates/inc/head.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
4 changes: 2 additions & 2 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ public function testGetInstanceWithEnv()
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');
Expand Down
2 changes: 1 addition & 1 deletion tests/FrontControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function setUp()
$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'])
Expand Down
2 changes: 1 addition & 1 deletion tests/VideoDownloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

/**
Expand Down

0 comments on commit f920370

Please sign in to comment.