From 9da8a0f236f77331f1a7b61afbe0a5dae21256b1 Mon Sep 17 00:00:00 2001 From: nilov Date: Tue, 8 Nov 2016 11:57:20 +0700 Subject: [PATCH] Implement CmsContentBlockSilexProvider, version 0.1. --- .gitignore | 3 +++ ContentBlockServiceProvider.php | 37 +++++++++++++++++++++++++++++++++ LICENSE | 22 ++++++++++++++++++++ composer.json | 23 ++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 .gitignore create mode 100644 ContentBlockServiceProvider.php create mode 100644 LICENSE create mode 100644 composer.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e8b410 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +composer.lock +vendor/* diff --git a/ContentBlockServiceProvider.php b/ContentBlockServiceProvider.php new file mode 100644 index 0000000..1207c31 --- /dev/null +++ b/ContentBlockServiceProvider.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Glavweb\CmsContentBlockSilexProvider; + +use Pimple\Container; +use Pimple\ServiceProviderInterface; +use Glavweb\CmsContentBlock\ContentBlockService; + +/** + * ContentBlockServiceProvider + * + * @package Glavweb\CmsContentBlockSilexProvider + * @author Andrey Nilov + */ +class ContentBlockServiceProvider implements ServiceProviderInterface +{ + /** + * {@inheritdoc} + */ + public function register(Container $app) + { + $app['content_block_service'] = function () use ($app) { + return new ContentBlockService( + $app['cms_rest_client'] + ); + }; + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..16a39e2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 GLAVWEB + +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/composer.json b/composer.json new file mode 100644 index 0000000..ba48c2b --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "glavweb/cms-content-block-silex-provider", + "description": "GLAVWEB.cms Rest Client Silex Provider", + "authors": [ + { + "name": "nilov", + "email": "nilov@glavweb.ru", + "homepage": "http://glavweb.ru" + }, + { + "name": "GLAVWEB Community", + "homepage": "https://github.com/glavweb/cms-content-block-silex-provider/contributors" + } + ], + "require": { + "php": ">=5.5.9", + "pimple/pimple": "~3.0", + "glavweb/cms-content-block": "~0.1" + }, + "autoload": { + "psr-4": { "Glavweb\\CmsContentBlockSilexProvider\\": "" } + } +}