diff --git a/.gitignore b/.gitignore index f959fc6..c8153b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -.DS_Store -system/modules/theme_external_js/vendor/leafo/scssphp/tests -system/modules/theme_external_js/vendor/leafo/scssphp/site +/composer.lock +/vendor/ diff --git a/README.md b/README.md index 9ec6a5d..1cb436c 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ SuperTheme is a Contao module to add SCSS, JS, CoffeeScript to a page layout eas ## Installation -**Step 1:** +### 1. Install with composer ```bash -cd contao_4; # Your Contao 4 root directory -composer.phar require comolo/contao-supertheme +composer require comolo/contao-supertheme ``` -**Step 2:** +### 2. Activation (only Contao <= 4.3) Register the SuperTheme bundle in the AppKernel. +If you are using Contao 4.4 or above the plugin will automatically registered by the Contao Manager Plugin. ```php // app/AppKernel.php @@ -33,10 +33,11 @@ $bundles = [ // ... ``` -**Step 3:** +### 3. Clear your cache Clear your internal cache and update your database with the InstallTool. ## Release notes +* SuperTheme now supports Contao 4.4 and the Contao Manager Plugin. Installing SuperTheme is now super easy ;) * To make SuperTheme incredibly fast, scss-files won´t get checked for changes anymore, if Contao runs in productive mode (entry point web/app.php). I recommend to run Contao in dev mode while programming the layout of a new website. diff --git a/composer.json b/composer.json index 02cca01..132fad9 100644 --- a/composer.json +++ b/composer.json @@ -13,19 +13,27 @@ } ], "require": { - "php":">=5.4.0", - "contao/contao": "~4.2", + "php": ">=5.6.0", + "symfony/framework-bundle": "^3.3", + "contao/core-bundle": "^4.4", "leafo/scssphp": "~0.1", "comolo/php-scssphp-compass": "~0.1", - "coffeescript/coffeescript": ">=1.3,<2.0", + "coffeescript/coffeescript": "~1.3", "matthiasmullie/minify": "^1.3" }, + "require-dev": { + "contao/manager-plugin": "^2.0" + }, "conflict": { - "contao/core": "*" + "contao/core": "*", + "contao/manager-plugin": "<2.0 || >=3.0" }, "autoload":{ "psr-4": { "Comolo\\SuperThemeBundle\\": "src/" } + }, + "extra": { + "contao-manager-plugin": "Comolo\\SuperThemeBundle\\ContaoManager\\Plugin" } } diff --git a/src/ComoloSuperThemeBundle.php b/src/ComoloSuperThemeBundle.php index a98f7cf..4c4be81 100644 --- a/src/ComoloSuperThemeBundle.php +++ b/src/ComoloSuperThemeBundle.php @@ -1,15 +1,13 @@ - * @copyright 2015 - Hendrik Obermayer - Comolo GmbH + * @author Hendrik Obermayer + * @copyright 2017 Comolo GmbH * @license LGPL */ - namespace Comolo\SuperThemeBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; diff --git a/src/ContaoManager/Plugin.php b/src/ContaoManager/Plugin.php new file mode 100644 index 0000000..6a13d90 --- /dev/null +++ b/src/ContaoManager/Plugin.php @@ -0,0 +1,37 @@ + + * @copyright 2017 Comolo GmbH + * @license LGPL + */ +namespace Comolo\SuperThemeBundle\ContaoManager; + +use Contao\CoreBundle\ContaoCoreBundle; +use Contao\ManagerPlugin\Bundle\BundlePluginInterface; +use Contao\ManagerPlugin\Bundle\Config\BundleConfig; +use Contao\ManagerPlugin\Bundle\Parser\ParserInterface; +use Comolo\SuperThemeBundle\ComoloSuperThemeBundle; + +/** + * Plugin for the Contao Manager. + * + * @author Hendrik Obermayer + */ +class Plugin implements BundlePluginInterface +{ + /** + * {@inheritdoc} + */ + public function getBundles(ParserInterface $parser) + { + return [ + BundleConfig::create(ComoloSuperThemeBundle::class) + ->setLoadAfter([ContaoCoreBundle::class]) + ->setReplace(['supertheme']), + ]; + } +} diff --git a/src/Helper/ScssCompiler.php b/src/Helper/ScssCompiler.php index 122a773..f975d35 100644 --- a/src/Helper/ScssCompiler.php +++ b/src/Helper/ScssCompiler.php @@ -1,21 +1,22 @@ - * @copyright 2014 - Hendrik Obermayer - Comolo GmbH - */ - -/** - * Namespace. + * Copyright (C) 2017 Comolo GmbH + * + * @author Hendrik Obermayer + * @copyright 2017 Comolo GmbH + * @license LGPL */ - namespace Comolo\SuperThemeBundle\Helper; use Comolo\ScssCompass\CompassPlugin; use Leafo\ScssPhp\Compiler; +/** + * Class ScssCompiler + * @author Hendrik Obermayer + */ class ScssCompiler extends Compiler { protected $importedStylesheets = array(); diff --git a/src/Module/AssetGenerator.php b/src/Module/AssetGenerator.php index d1cf9f6..fd7575d 100644 --- a/src/Module/AssetGenerator.php +++ b/src/Module/AssetGenerator.php @@ -1,26 +1,19 @@ - * @copyright 2015 - Hendrik Obermayer - Comolo GmbH + * @author Hendrik Obermayer + * @copyright 2017 Comolo GmbH * @license LGPL */ - -/** - * Namespace. - */ - namespace Comolo\SuperThemeBundle\Module; /** * Class AssetGenerator. * - * @author Hendrik Obermayer - Comolo GmbH - * @copyright 2014 - Hendrik Obermayer - Comolo GmbH + * @author Hendrik Obermayer */ abstract class AssetGenerator extends \Controller { diff --git a/src/Module/CoffeescriptGenerator.php b/src/Module/CoffeescriptGenerator.php index 935f64a..fe26472 100644 --- a/src/Module/CoffeescriptGenerator.php +++ b/src/Module/CoffeescriptGenerator.php @@ -1,19 +1,13 @@ - * @copyright 2015 - Hendrik Obermayer - Comolo GmbH + * @author Hendrik Obermayer + * @copyright 2017 Comolo GmbH * @license LGPL */ - -/** - * Namespace. - */ - namespace Comolo\SuperThemeBundle\Module; use CoffeeScript\Compiler as CoffeeScriptCompiler; @@ -22,8 +16,7 @@ /** * Class GenerateCoffeescript. * - * @author Hendrik Obermayer - Comolo Comolo GmbH - * @copyright 2014 - Hendrik Obermayer - Comolo Comolo GmbH + * @author Hendrik Obermayer */ class CoffeescriptGenerator extends AssetGenerator { diff --git a/src/Module/ScssGenerator.php b/src/Module/ScssGenerator.php index e7b4db0..2eef008 100644 --- a/src/Module/ScssGenerator.php +++ b/src/Module/ScssGenerator.php @@ -1,18 +1,13 @@ + * @author Hendrik Obermayer + * @copyright 2017 Comolo GmbH * @license LGPL */ - -/** - * Namespace - */ namespace Comolo\SuperThemeBundle\Module; use Comolo\SuperThemeBundle\Helper\ScssCompiler; @@ -20,8 +15,7 @@ /** * Class ScssGenerator. * - * @author Hendrik Obermayer - Comolo GmbH - * @copyright 2014 - Hendrik Obermayer - Comolo GmbH + * @author Hendrik Obermayer */ class ScssGenerator extends AssetGenerator {