Skip to content

Commit

Permalink
Merge pull request #862 from gregumo/2.3
Browse files Browse the repository at this point in the history
Merge 2.3 into master
  • Loading branch information
gregumo committed Mar 23, 2017
2 parents 66659a0 + b72bc19 commit cba6b5b
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 113 deletions.
23 changes: 19 additions & 4 deletions Bundle/BusinessEntityBundle/Annotation/AnnotationDriver.php
Expand Up @@ -7,6 +7,7 @@
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver as DoctrineAnnotationDriver;
use Doctrine\ORM\Mapping\MappingException;
use Psr\Log\LoggerInterface;
use Symfony\Component\Config\Definition\Exception\Exception;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
Expand All @@ -25,6 +26,7 @@ class AnnotationDriver extends DoctrineAnnotationDriver
protected $eventDispatcher;
protected $widgetHelper;
protected $paths;
protected $logger;

/**
* construct.
Expand All @@ -33,19 +35,28 @@ class AnnotationDriver extends DoctrineAnnotationDriver
* @param EventDispatcherInterface $eventDispatcher
* @param WidgetHelper $widgetHelper
* @param array $paths The paths where to search about Entities
* @param LoggerInterface $logger
*/
public function __construct(Reader $reader, EventDispatcherInterface $eventDispatcher, $widgetHelper, $paths)
{
public function __construct(
Reader $reader,
EventDispatcherInterface $eventDispatcher,
$widgetHelper,
$paths,
LoggerInterface $logger
) {
$this->reader = $reader;
$this->eventDispatcher = $eventDispatcher;
$this->widgetHelper = $widgetHelper;
$this->paths = $paths;
$this->logger = $logger;
}

/**
* Get all class names.
*
* @return string[]
* @throws MappingException
*
* @return array
*/
public function getAllClassNames()
{
Expand All @@ -56,7 +67,11 @@ public function getAllClassNames()
$includedFiles = [];
foreach ($this->paths as $path) {
if (!is_dir($path)) {
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
$this->logger->error(sprintf(
'The given path "%s" seems to be incorrect. You need to edit victoire_core.base_paths configuration.',
$path
));
continue;
}
$iterator = new \RegexIterator(
new \RecursiveIteratorIterator(
Expand Down
25 changes: 24 additions & 1 deletion Bundle/BusinessEntityBundle/Resources/config/services.yml
Expand Up @@ -29,6 +29,29 @@ services:
tags:
- { name: form.type_extension }

victoire_business_entity.warmer:
class: Victoire\Bundle\BusinessEntityBundle\CacheWarmer\BusinessEntityWarmer
arguments:
- "@victoire_business_entity.annotation_driver"
tags:
# 110 => Must be higher than victoire_core.cache_warmer.entity_proxy_warmer
- { name: kernel.cache_warmer, priority: 110}
victoire_business_entity.cache_reader:
class: "%victoire_business_entity.cache_reader_class%"
arguments:
- "@victoire_core.cache"
- "@victoire_widget.widget_helper"
- "@victoire_business_entity.annotation_driver"

# ================== Annotations ================== #
victoire_business_entity.annotation_driver:
class: "%victoire_business_entity.annotation_driver_class%"
arguments:
- "@annotation_reader"
- "@event_dispatcher"
- "@victoire_widget.widget_helper"
- "%victoire_core.base_paths%"
- "@logger"

# ================== Provider ================== #

Expand Down Expand Up @@ -67,7 +90,7 @@ services:
- "@event_dispatcher"
- "@victoire_widget.widget_helper"
- "%victoire_core.base_paths%"

victoire_business_entity.warmer:
class: Victoire\Bundle\BusinessEntityBundle\CacheWarmer\BusinessEntityWarmer
arguments:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -17,6 +17,7 @@ It can be setup in any Symfony project in just some few minutes.
The main goal is to give to the final customer the ability to **create**/**edit**/**delete** each content on its website, as much for a static content than a business entity based content and **without any development skill**, with the minimum of training.

Victoire is the first CMS ever that allows content's personalization! Indeed you can define which content is shown regarding the criterias you define.

Many criterias can be used such as website locale, log in status, and so much more that can be created for each particular project.

A french documentation has been started and is being completed _slowly_ [here](http://github.com/victoire/documentation-fr/).
Expand Down Expand Up @@ -49,7 +50,7 @@ Victoire follows the [maintenance rules of Symfony](http://symfony.com/doc/maste

If you want to contribute to Victoire frontend, please read this [contribution guideline](doc/frontend-contribution.md).

##Install Victoire
## Install Victoire

To do so, follow the [setup guide](doc/setup.md).

Expand Down Expand Up @@ -81,7 +82,9 @@ Component | Description

## Widgets

All the widgets that you can use with a Victoire's website are available on the *[Friends Of Victoire](https://github.com/FriendsOfVictoire)* page.
All the widgets that you can use with a Victoire's website are available on
- *[Victoire](https://github.com/Victoire)*
- *[Friends Of Victoire](https://github.com/FriendsOfVictoire)*

## Troubleshooting

Expand Down
1 change: 1 addition & 0 deletions Tests/App/app/AppKernel.php
Expand Up @@ -63,6 +63,7 @@ public function registerBundles()
new Victoire\Bundle\WidgetMapBundle\VictoireWidgetMapBundle(),
new Victoire\Bundle\ORMBusinessEntityBundle\VictoireORMBusinessEntityBundle(),
new Victoire\Bundle\APIBusinessEntityBundle\VictoireAPIBusinessEntityBundle(),

//Victoire test bundles
new Victoire\Widget\ForceBundle\VictoireWidgetForceBundle(),
new Victoire\Widget\LightSaberBundle\VictoireWidgetLightSaberBundle(),
Expand Down
4 changes: 2 additions & 2 deletions Tests/App/app/config/config_base.yml
Expand Up @@ -136,9 +136,9 @@ victoire_core:
- "customModal"
slots: ~
base_paths: #(optional) required for a non standard installation
- "%kernel.root_dir%/../../../Bundle/BlogBundle"
- "%kernel.root_dir%/../../../vendor/friendsofvictoire"
- "%kernel.root_dir%/../src"
- "%kernel.root_dir%/../../../Bundle/BlogBundle"
- "%kernel.root_dir%/../../../vendor/victoire"
business_entity_debug: false

services:
Expand Down
26 changes: 0 additions & 26 deletions Tests/App/src/Victoire/Widget/ForceBundle/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions Tests/App/src/Victoire/Widget/ForceBundle/composer.json

This file was deleted.

26 changes: 0 additions & 26 deletions Tests/App/src/Victoire/Widget/LightSaberBundle/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions Tests/App/src/Victoire/Widget/LightSaberBundle/composer.json

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -37,8 +37,6 @@
"doctrine/orm": "^2.5",
"friendsofsymfony/jsrouting-bundle": "^1.0|^2.0",
"friendsofsymfony/user-bundle": "~2.0@dev",
"friendsofvictoire/text-widget": "^2.0",
"friendsofvictoire/button-widget": "^2.0",
"incenteev/composer-parameter-handler": "^2.0",
"jms/serializer-bundle": "^1.0",
"knplabs/gaufrette": "^0.1",
Expand Down Expand Up @@ -74,7 +72,9 @@
"phpunit/phpunit": "4.6.*",
"sensio/generator-bundle": "~2.3",
"symfony/var-dumper": "~2.8|~3.1",
"doctrine/doctrine-fixtures-bundle": "^2.2"
"doctrine/doctrine-fixtures-bundle": "^2.2",
"victoire/text-widget": "~2.0",
"victoire/button-widget": "~2.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions dependencies.md
Expand Up @@ -25,8 +25,6 @@
| doctrine/orm | ^2.5 | |
| friendsofsymfony/jsrouting-bundle | ^1.0 or ^2.0 | |
| friendsofsymfony/user-bundle | ~2.0@dev | 2.0 is not yet stable |
| friendsofvictoire/text-widget | ^2.0 | |
| friendsofvictoire/button-widget | ^2.0 | |
| incenteev/composer-parameter-handler | ^2.0 | |
| jms/serializer-bundle | ^1.0 | |
| knplabs/gaufrette | ^0.1 | |
Expand All @@ -46,4 +44,6 @@
| troopers/assetic-injector-bundle | ^1.0 | |
| twig/extensions | ~1.0 | |
| twig/twig | ~1.0 | |
| victoire/text-widget | ~2.0 | |
| victoire/button-widget | ~2.0 | |
| willdurand/js-translation-bundle | ^2.5 | |
15 changes: 8 additions & 7 deletions doc/setup.md
Expand Up @@ -141,6 +141,12 @@ victoire_core:
business_entity_debug: true
layouts:
defaultLayout: "Default layout"
# Here you need to list all folders containing your BusinessEntities
# Remove friendsofvictoire if you don't need it
base_paths:
- "%kernel.root_dir%/../src"
- "%kernel.root_dir%/../vendor/victoire/victoire/Bundle/BlogBundle"
- "%kernel.root_dir%/../vendor/friendsofvictoire"

#if you need i18n
victoire_i18n:
Expand Down Expand Up @@ -279,13 +285,8 @@ There are some fixtures in `vendor/victoire/victoire/Tests/App/src/Acme/AppBundl

### Add the wanted widgets:

```json
"friendsofvictoire/text-widget" : "~2.0",
"friendsofvictoire/button-widget" : "~2.0",
"friendsofvictoire/image-widget" : "~2.0",
"friendsofvictoire/render-widget" : "~2.0",
"friendsofvictoire/breadcrumb-widget": "~2.0",
...
```sh
composer require victoire/text-widget victoire/button-widget victoire/image-widget victoire/render-widget victoire/breadcrumb-widget ...
```

Get the whole Victoire Widget list [**here**](http://packagist.org/search/?tags=victoire)
Expand Down

0 comments on commit cba6b5b

Please sign in to comment.