Skip to content
Permalink
Browse files
Stop using grunt and use grumphp and robo instead
  • Loading branch information
Rudloff committed Nov 30, 2019
1 parent b7fc304 commit 2f3ab77e8bbecd153137225d879ce787415c7727
Show file tree
Hide file tree
Showing 16 changed files with 3,167 additions and 4,007 deletions.
@@ -5,9 +5,7 @@ addons:
apt:
packages:
- language-pack-fr
install:
- composer install --no-progress
- yarn install
install: composer install --no-progress
script:
- grunt lint
- grunt test
- composer lint
- composer test
@@ -1,21 +1,14 @@
FROM php:7.3-apache
RUN apt-get update && apt-get install -my gnupg
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update
RUN apt-get install -y libicu-dev xz-utils git zlib1g-dev python nodejs libgmp-dev gettext yarn libxslt1-dev libzip-dev
RUN apt-get install -y libicu-dev xz-utils git zlib1g-dev python libgmp-dev gettext libzip-dev
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install intl
RUN docker-php-ext-install zip
RUN docker-php-ext-install gmp
RUN docker-php-ext-install gettext
RUN docker-php-ext-install xsl
RUN a2enmod rewrite
RUN curl -sS https://getcomposer.org/installer | php
COPY resources/php.ini /usr/local/etc/php/
COPY . /var/www/html/
RUN php composer.phar install --prefer-dist --no-progress
RUN yarn install --prod
RUN yarn grunt
ENV CONVERT=1

This file was deleted.

@@ -17,10 +17,9 @@ You just have to unzip it on your server and it should be ready to use.
### From Git

In order to get AllTube working,
you need to use [Yarn](https://yarnpkg.com/) and [Composer](https://getcomposer.org/):
you need to use [Composer](https://getcomposer.org/):

```bash
yarn install
composer install
```

@@ -44,11 +43,10 @@ you need to set the `AllowOverride` setting to `All` or `FileInfo`.

#### Update

When updating from Git, you need to run yarn and Composer again:
When updating from Git, you need to run Composer again:

```bash
git pull
yarn install --prod
composer install
```

@@ -66,7 +64,7 @@ cp config/config.example.yml config/config.yml

## PHP requirements

You will need PHP 5.5 (or higher) and the following PHP modules:
You will need PHP 7.1 (or higher) and the following PHP modules:

* fileinfo
* intl
@@ -0,0 +1,64 @@
<?php

use Robo\Tasks;
use Symfony\Component\Finder\Finder;

/**
* Manage robo tasks.
*/
class RoboFile extends Tasks
{

/**
* Create release archive
* @return void
*/
public function release()
{
$result = $this->taskExec('git')
->args('describe')
->printOutput(false)
->run();
$result->provideOutputdata();
$tag = $result->getOutputData();

// We don't want the whole vendor directory.
$finder = new Finder();
$finder->files()
->in(__DIR__ . '/vendor/')
->exclude(
[
'ffmpeg/',
'bin/',
'anam/phantomjs-linux-x86-binary/',
'phpunit/',
'squizlabs/',
'rinvex/countries/resources/geodata/',
'rinvex/countries/resources/flags/'
]
);

$zipTask = $this->taskPack('alltube-' . $tag . '.zip')
->add('index.php')
->add('config/config.example.yml')
->add('.htaccess')
->add('img')
->add('LICENSE')
->add('README.md')
->add('robots.txt')
->add('resources')
->add('templates')
->add('templates_c/')
->add('classes')
->add('controllers')
->add('i18n');

foreach ($finder as $file) {
if ($path = $file->getRelativePathname()) {
$zipTask->add('vendor/' . $path);
}
}

$zipTask->run();
}
}
@@ -14,9 +14,6 @@
{
"url": "heroku/php"
},
{
"url": "heroku/nodejs"
},
{
"url": "heroku/python"
}
@@ -9,7 +9,7 @@
use Aura\Session\Segment;
use Symfony\Component\Process\Process;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\Loader\MoFileLoader;
use Symfony\Component\Translation\Loader\PoFileLoader;

/**
* Class used to manage locales.
@@ -72,11 +72,11 @@ private function __construct()
$this->setLocale(new Locale($cookieLocale));
}

$this->translator->addLoader('gettext', new MoFileLoader());
$this->translator->addLoader('gettext', new PoFileLoader());
foreach ($this->getSupportedLocales() as $locale) {
$this->translator->addResource(
'gettext',
__DIR__ . '/../i18n/' . $locale->getIso15897() . '/LC_MESSAGES/Alltube.mo',
__DIR__ . '/../i18n/' . $locale->getIso15897() . '/LC_MESSAGES/Alltube.po',
$locale->getIso15897()
);
}
@@ -10,26 +10,29 @@
"guzzlehttp/guzzle": "~6.3.0",
"jawira/case-converter": "^1.2",
"mathmarques/smarty-view": "~1.1.0",
"npm-asset/open-sans-fontface": "^1.4",
"rinvex/countries": "~3.1.0",
"slim/slim": "~3.12.1",
"symfony/process": "^5.0",
"symfony/translation": "^5.0",
"symfony/yaml": "^5.0",
"symfony/process": "^4.0",
"symfony/translation": "^4.0",
"symfony/yaml": "^4.0",
"zonuexe/http-accept-language": "~0.4.1"
},
"require-dev": {
"anam/phantomjs-linux-x86-binary": "~2.1.1",
"consolidation/robo": "^2.0",
"ffmpeg/ffmpeg": "^4.1",
"heroku/heroku-buildpack-php": "^162.0",
"php-mock/php-mock-mockery": "^1.3",
"phpro/grumphp": "^0.17.0",
"phpstan/phpstan": "~0.9.2",
"phpunit/phpunit": "^8.4",
"rg3/youtube-dl": "^2019.09",
"roave/security-advisories": "dev-master",
"smarty-gettext/smarty-gettext": "^1.6",
"squizlabs/php_codesniffer": "^3.5",
"symfony/debug": "^4.4",
"symfony/var-dumper": "^5.0"
"symfony/debug": "^4.0",
"symfony/var-dumper": "^4.0"
},
"extra": {
"paas": {
@@ -39,6 +42,10 @@
}
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
},
{
"type": "package",
"package": {
@@ -90,6 +97,9 @@
},
"scripts": {
"compile": "composer install --ignore-platform-reqs",
"lint": "grumphp run --ansi",
"test": "phpunit",
"release": "robo release",
"update-locales": [
"tsmarty2c.php templates > i18n/template.pot",
"xgettext --omit-header -kt -j -o i18n/template.pot classes/*.php classes/*/*.php controllers/*"

0 comments on commit 2f3ab77

Please sign in to comment.