FIX: convert / to DIRECTORY_SEPARATOR for gallery and contact form

This commit is contained in:
Michal Kváček
2016-04-04 10:59:52 +02:00
parent 08cb40b004
commit 8a33f1b4c7
2 changed files with 15 additions and 19 deletions
@@ -1,5 +1,6 @@
<?php namespace Modules\Gallery\Providers;
use App\Handlers\Registrators\TemplateRegistrator;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\Process\Exception\InvalidArgumentException;
@@ -31,7 +32,6 @@ class GalleryServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
/**
@@ -42,9 +42,9 @@ class GalleryServiceProvider extends ServiceProvider
protected function registerConfig()
{
$this->publishes([
__DIR__ . '/../Config/config.php' => config_path('gallery.php'),
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'config.php' => config_path('gallery.php'),
]);
$this->mergeConfigFrom(__DIR__ . '/../Config/config.php', 'gallery');
$this->mergeConfigFrom(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'config.php', 'gallery');
}
/**
@@ -54,16 +54,13 @@ class GalleryServiceProvider extends ServiceProvider
*/
public function registerViews()
{
$viewPath = base_path('resources/views/modules/gallery');
$viewPath = base_path('resources' . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'gallery');
$sourcePath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views';
$sourcePath = __DIR__ . '/../Resources/views';
$this->publishes([
$sourcePath => $viewPath
]);
$this->publishes([$sourcePath => $viewPath]);
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/gallery';
return $path . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'gallery';
}, \Config::get('view.paths')), [$sourcePath]), 'gallery');
/**
@@ -90,12 +87,12 @@ class GalleryServiceProvider extends ServiceProvider
*/
public function registerTranslations()
{
$langPath = base_path('resources/lang/modules/gallery');
$langPath = base_path('resources' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'gallery');
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'gallery');
} else {
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'gallery');
$this->loadTranslationsFrom(__DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'lang', 'gallery');
}
}