diff --git a/.travis.yml b/.travis.yml index 1e1785f..9705ddb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,17 +5,20 @@ language: php cache: directories: - $HOME/.composer/cache - - downloads matrix: include: - php: 5.5 + env: + - COMPOSER_FLAGS="--prefer-lowest --prefer-dist --no-interaction" - php: 7.0 + env: + - COMPOSER_FLAGS="--prefer-dist --no-interaction" before_script: - phpenv config-rm xdebug.ini - composer self-update - - composer install --prefer-dist --no-interaction + - composer update $COMPOSER_FLAGS - ./Tests/app/console doctrine:database:create - ./Tests/app/console doctrine:schema:create diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a15c520 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Sulu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ce10c08..c5b2a6e 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,40 @@ # SuluAutomationBundle -[![Build Status](https://travis-ci.org/sulu/SuluAutomationBundle.svg?branch=master)](https://travis-ci.org/sulu/SuluAutomationBundle) +[![Build Status](https://travis-ci.org/sulu/SuluAutomationBundle.svg)](https://travis-ci.org/sulu/SuluAutomationBundle) +[![StyleCI](https://styleci.io/repos/61883398/shield)](https://styleci.io/repos/61883398) -This bundle integrates the -[php-task library](https://github.com/php-task/php-task) into Sulu. +The SuluAutomationBundle provides a way to manages future tasks which can be scheduled for entities in the Sulu-Admin. +For example schedule the publishing of a page to a specific datetime in the future. -## Installation - -### Step 1: Download the Bundle - -Open a command console, enter your project directory and execute the following -command to download the latest stable version of this bundle: - -```console -$ composer require sulu/automation-bundle -``` - -This command requires you to have Composer installed globally, as explained in -the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the -Composer documentation. - -### Step 2: Enabled the Bundle +To schedule tasks this bundle uses the [php-task library](https://github.com/php-task/php-task). -Then, enable the bundle by adding it to the list of registered bundles in the -`app/AbstractKernel.php` file of your Sulu project. +## Requirements -```php -eventDispatcher->dispatch(Events::TASK_UPDATE_EVENT, new TaskUpdateEvent($task)); + $event = new TaskUpdateEvent($task); + $this->eventDispatcher->dispatch(Events::TASK_UPDATE_EVENT, $event); $this->scheduler->reschedule($task); if ($event->isCanceled()) { @@ -106,7 +107,8 @@ public function remove($id) $task = $this->findById($id); $this->scheduler->remove($task); - $event = $this->eventDispatcher->dispatch(Events::TASK_REMOVE_EVENT, new TaskRemoveEvent($task)); + $event = new TaskRemoveEvent($task); + $this->eventDispatcher->dispatch(Events::TASK_REMOVE_EVENT, $event); if ($event->isCanceled()) { return; } diff --git a/composer.json b/composer.json index fed0741..20fa94d 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,10 @@ } ], "require": { - "sulu/sulu": "1.5.* || dev-develop", + "sulu/sulu": "^1.5", "php-task/task-bundle": "^1.0", "willdurand/hateoas-bundle": "^1.2", - "jms/serializer-bundle": "^1.1", - - "sulu/document-manager": "^0.9 || dev-develop" + "jms/serializer-bundle": "^1.1" }, "require-dev": { "phpunit/phpunit": "~4.8 || ~5.0",