Fix #1137: implemented Piwik

This commit is contained in:
Nicolas Lœuillet 2016-02-19 15:27:57 +01:00
parent fa64d86110
commit 07643dde08
8 changed files with 61 additions and 1 deletions

View File

@ -22,3 +22,6 @@ export: "export"
import: "import"
misc: "misc"
modify_settings: "apply"
piwik_host: Host of your website in Piwik
piwik_site_id: ID of your website in Piwik
piwik_enabled: Enable Piwik

View File

@ -22,3 +22,6 @@ export: "export"
import: "import"
misc: "divers"
modify_settings: "appliquer"
piwik_host: URL de votre site dans Piwik
piwik_site_id: ID de votre site dans Piwik
piwik_enabled: Activer Piwik

View File

@ -19,6 +19,14 @@ services:
tags:
- { name: twig.extension }
wallabag.twig_piwik_extension:
class: Wallabag\CoreBundle\Twig\WallabagPiwikExtension
public: false
arguments:
- "@craue_config"
tags:
- { name: twig.extension }
wallabag.locale_listener:
class: Wallabag\CoreBundle\EventListener\LocaleListener
arguments: ["%kernel.default_locale%"]

View File

@ -64,7 +64,8 @@
"guzzlehttp/guzzle": "^5.2.0",
"doctrine/doctrine-migrations-bundle": "^1.0",
"paragonie/random_compat": "~1.0",
"craue/config-bundle": "~1.4"
"craue/config-bundle": "~1.4",
"mnapoli/piwik-twig-extension": "^1.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2",

View File

@ -312,6 +312,21 @@ class InstallCommand extends ContainerAwareCommand
'value' => 'http://v2.wallabag.org',
'section' => 'misc',
],
[
'name' => 'piwik_enabled',
'value' => '0',
'section' => 'analytics',
],
[
'name' => 'piwik_host',
'value' => 'http://v2.wallabag.org',
'section' => 'analytics',
],
[
'name' => 'piwik_site_id',
'value' => '1',
'section' => 'analytics',
],
];
foreach ($settings as $setting) {

View File

@ -110,6 +110,21 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
'value' => 'http://v2.wallabag.org',
'section' => 'misc',
],
[
'name' => 'piwik_enabled',
'value' => '0',
'section' => 'analytics',
],
[
'name' => 'piwik_host',
'value' => 'http://v2.wallabag.org',
'section' => 'analytics',
],
[
'name' => 'piwik_site_id',
'value' => '1',
'section' => 'analytics',
],
];
foreach ($settings as $setting) {

View File

@ -71,5 +71,6 @@
<div id="warning_message">
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
</div>
{{ piwik() }}
</body>
</html>

View File

@ -0,0 +1,14 @@
<?php
namespace Wallabag\CoreBundle\Twig;
use Craue\ConfigBundle\Util\Config;
use PiwikTwigExtension\PiwikTwigExtension;
class WallabagPiwikExtension extends PiwikTwigExtension
{
public function __construct(Config $craueConfig)
{
parent::__construct($craueConfig->get('piwik_host'), $craueConfig->get('piwik_site_id'), $craueConfig->get('piwik_enabled'));
}
}