Skip to content

Commit

Permalink
Added support for contao manager (fix #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
henobi committed Jun 29, 2017
1 parent bc71f90 commit 3cc5a1a
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 66 deletions.
5 changes: 2 additions & 3 deletions .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/
11 changes: 6 additions & 5 deletions README.md
Expand Up @@ -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
Expand All @@ -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.
16 changes: 12 additions & 4 deletions composer.json
Expand Up @@ -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"
}
}
10 changes: 4 additions & 6 deletions src/ComoloSuperThemeBundle.php
@@ -1,15 +1,13 @@
<?php

/**
/*
* This file is part of the SuperTheme extension by Comolo.
*
* Copyright (C) 2013-2015 Hendrik Obermayer
* Copyright (C) 2017 Comolo GmbH
*
* @author Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @copyright 2015 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
* @copyright 2017 Comolo GmbH <https://www.comolo.de/>
* @license LGPL
*/

namespace Comolo\SuperThemeBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
37 changes: 37 additions & 0 deletions src/ContaoManager/Plugin.php
@@ -0,0 +1,37 @@
<?php
/*
* This file is part of the SuperTheme extension by Comolo.
*
* Copyright (C) 2017 Comolo GmbH
*
* @author Hendrik Obermayer <https://github.com/henobi>
* @copyright 2017 Comolo GmbH <https://www.comolo.de/>
* @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 <https://github.com/henobi>
*/
class Plugin implements BundlePluginInterface
{
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(ComoloSuperThemeBundle::class)
->setLoadAfter([ContaoCoreBundle::class])
->setReplace(['supertheme']),
];
}
}
21 changes: 11 additions & 10 deletions src/Helper/ScssCompiler.php
@@ -1,21 +1,22 @@
<?php

/**
* Class scssc.
/*
* This file is part of the SuperTheme extension by Comolo.
*
* @author Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @copyright 2014 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
*/

/**
* Namespace.
* Copyright (C) 2017 Comolo GmbH
*
* @author Hendrik Obermayer <https://github.com/henobi>
* @copyright 2017 Comolo GmbH <https://www.comolo.de/>
* @license LGPL
*/

namespace Comolo\SuperThemeBundle\Helper;

use Comolo\ScssCompass\CompassPlugin;
use Leafo\ScssPhp\Compiler;

/**
* Class ScssCompiler
* @author Hendrik Obermayer <https://github.com/henobi>
*/
class ScssCompiler extends Compiler
{
protected $importedStylesheets = array();
Expand Down
19 changes: 6 additions & 13 deletions src/Module/AssetGenerator.php
@@ -1,26 +1,19 @@
<?php

/**
* Contao Open Source CMS.
/*
* This file is part of the SuperTheme extension by Comolo.
*
* Copyright (C) 2005-2013 Leo Feyer
* Copyright (C) 2017 Comolo GmbH
*
* @author Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @copyright 2015 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
* @copyright 2017 Comolo GmbH <https://www.comolo.de/>
* @license LGPL
*/

/**
* Namespace.
*/

namespace Comolo\SuperThemeBundle\Module;

/**
* Class AssetGenerator.
*
* @author Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @copyright 2014 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
*/
abstract class AssetGenerator extends \Controller
{
Expand Down
19 changes: 6 additions & 13 deletions src/Module/CoffeescriptGenerator.php
@@ -1,19 +1,13 @@
<?php

/**
* Contao Open Source CMS.
/*
* This file is part of the SuperTheme extension by Comolo.
*
* Copyright (C) 2005-2013 Leo Feyer
* Copyright (C) 2017 Comolo GmbH
*
* @author Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @copyright 2015 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
* @copyright 2017 Comolo GmbH <https://www.comolo.de/>
* @license LGPL
*/

/**
* Namespace.
*/

namespace Comolo\SuperThemeBundle\Module;

use CoffeeScript\Compiler as CoffeeScriptCompiler;
Expand All @@ -22,8 +16,7 @@
/**
* Class GenerateCoffeescript.
*
* @author Hendrik Obermayer - Comolo Comolo GmbH <mail@comolo.de>
* @copyright 2014 - Hendrik Obermayer - Comolo Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
*/
class CoffeescriptGenerator extends AssetGenerator
{
Expand Down
18 changes: 6 additions & 12 deletions src/Module/ScssGenerator.php
@@ -1,27 +1,21 @@
<?php

/**
* Contao Open Source CMS.
/*
* This file is part of the SuperTheme extension by Comolo.
*
* Copyright (C) 2005-2013 Leo Feyer
* Copyright (C) 2017 Comolo GmbH
*
* @author Hendrik Obermayer - Comolo GmbH
* @copyright 2015 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
* @copyright 2017 Comolo GmbH <https://www.comolo.de/>
* @license LGPL
*/

/**
* Namespace
*/
namespace Comolo\SuperThemeBundle\Module;

use Comolo\SuperThemeBundle\Helper\ScssCompiler;

/**
* Class ScssGenerator.
*
* @author Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @copyright 2014 - Hendrik Obermayer - Comolo GmbH <mail@comolo.de>
* @author Hendrik Obermayer <https://github.com/henobi>
*/
class ScssGenerator extends AssetGenerator
{
Expand Down

0 comments on commit 3cc5a1a

Please sign in to comment.