Added new $grav['filesystem'] service using an instance of the new Filesystem object

This commit is contained in:
Matias Griese
2018-12-04 15:29:01 +02:00
parent cd21d65400
commit b38a143c66
3 changed files with 38 additions and 13 deletions

View File

@@ -11,6 +11,7 @@
* Added `Grav\Framework\Form\FormFlash` class to contain AJAX uploaded files in more reliable way
* Added `Grav\Framework\Form\FormFlashFile` class which implements `UploadedFileInterface` from PSR-7
* Added `Grav\Framework\Filesystem\Filesystem` class with methods to manipulate stream URLs
* Added new `$grav['filesystem']` service using an instance of the new `Filesystem` object
* Grav 1.6: Flex: Added support for custom object index classes (API compatibility break)
1. [](#improved)
* Improved `Grav\Framework\File\Formatter` classes to have abstract parent class and some useful methods

View File

@@ -67,19 +67,20 @@ class Grav extends Container
'Grav\Common\Service\SetupServiceProvider',
'Grav\Common\Service\StreamsServiceProvider',
'Grav\Common\Service\TaskServiceProvider',
'browser' => 'Grav\Common\Browser',
'cache' => 'Grav\Common\Cache',
'events' => 'RocketTheme\Toolbox\Event\EventDispatcher',
'exif' => 'Grav\Common\Helpers\Exif',
'inflector' => 'Grav\Common\Inflector',
'language' => 'Grav\Common\Language\Language',
'pages' => 'Grav\Common\Page\Pages',
'plugins' => 'Grav\Common\Plugins',
'scheduler' => 'Grav\Common\Scheduler\Scheduler',
'taxonomy' => 'Grav\Common\Taxonomy',
'themes' => 'Grav\Common\Themes',
'twig' => 'Grav\Common\Twig\Twig',
'uri' => 'Grav\Common\Uri',
'browser' => 'Grav\Common\Browser',
'cache' => 'Grav\Common\Cache',
'events' => 'RocketTheme\Toolbox\Event\EventDispatcher',
'exif' => 'Grav\Common\Helpers\Exif',
'filesystem' => 'Grav\Framework\Filesystem\Filesystem',
'inflector' => 'Grav\Common\Inflector',
'language' => 'Grav\Common\Language\Language',
'pages' => 'Grav\Common\Page\Pages',
'plugins' => 'Grav\Common\Plugins',
'scheduler' => 'Grav\Common\Scheduler\Scheduler',
'taxonomy' => 'Grav\Common\Taxonomy',
'themes' => 'Grav\Common\Themes',
'twig' => 'Grav\Common\Twig\Twig',
'uri' => 'Grav\Common\Uri',
];
/**

View File

@@ -0,0 +1,23 @@
<?php
/**
* @package Grav.Common.Service
*
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Common\Service;
use Grav\Framework\Filesystem\Filesystem;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
class FilesystemServiceProvider implements ServiceProviderInterface
{
public function register(Container $container)
{
$container['filesystem'] = function () {
return Filesystem::getInstance();
};
}
}