Skip to content

Commit

Permalink
Remove hardcoded UNIX dir separators.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleigh committed Jun 1, 2017
1 parent 7171c0c commit 92609ba
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Bundle/BundleMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function getPathCollection()
*/
protected function getPathKeys($path)
{
$key = str_replace('.php', '', explode('/bundles/', $path)[1]);
$key = str_replace('.php', '', explode(DIRECTORY_SEPARATOR.'bundles'.DIRECTORY_SEPARATOR, $path)[1]);

return explode('/', $key);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/LaravelLangBundlerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp()
protected function buildPath($pathArray, $path)
{
foreach ($pathArray as $directory) {
$path .= $directory.'/';
$path .= $directory.DIRECTORY_SEPARATOR;

if (!$this->filesystem->exists($path)) {
$this->filesystem->makeDirectory($path);
Expand Down
7 changes: 4 additions & 3 deletions src/Commands/MakeBundleMod.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function handle()

$pathArray = ['LangBundler', 'Mods'];

$basePath = app_path().'/';
$basePath = app_path().DIRECTORY_SEPARATOR;

$this->buildPath($pathArray, $basePath);

Expand All @@ -38,7 +38,7 @@ public function handle()
$stub = $this->getStub($name);

$this->filesystem->put(
app_path(implode('/', $pathArray).'/'.$name.'.php'),
app_path(implode(DIRECTORY_SEPARATOR, $pathArray).DIRECTORY_SEPARATOR.$name.'.php'),
$stub
);

Expand All @@ -58,7 +58,8 @@ protected function getStub($name)

$namespace = $namespace.'LangBundler\\Mods';

$stub = $this->filesystem->get(__DIR__.'/../BundleItems/ModStub.php');
$stub = $this->filesystem->get(
dirname(__DIR__).DIRECTORY_SEPARATOR.'BundleItems'.DIRECTORY_SEPARATOR.'ModStub.php');

$stub = str_replace(
'LaravelLangBundler\BundleItems',
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/MakeBundlesFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function handle()
{
$this->setUp();

$directory = resource_path('lang/bundles');
$directory = resource_path('lang'.DIRECTORY_SEPARATOR.'bundles');

if (!$this->filesystem->exists($directory)) {
$this->filesystem->makeDirectory($directory);
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/MakeNewBundleFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function handle()

$pathArray->prepend('bundles');

$basePath = resource_path('lang/');
$basePath = resource_path('lang'.DIRECTORY_SEPARATOR);

$path = $this->buildPath($pathArray->all(), $basePath);

Expand All @@ -50,7 +50,7 @@ protected function createFile($path, $filename)
{
$filePath = $path.$filename;

$stub = __DIR__.'/bundle-file-stub.php';
$stub = __DIR__.DIRECTORY_SEPARATOR.'bundle-file-stub.php';

if (!$this->filesystem->exists($filePath)) {
$this->filesystem->copy($stub, $filePath);
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function register()
public function boot()
{
$this->publishes([
__DIR__.'/config.php' => config_path('lang-bundler.php'),
__DIR__.DIRECTORY_SEPARATOR.'config.php' => config_path('lang-bundler.php'),
], 'config');
}

Expand Down

0 comments on commit 92609ba

Please sign in to comment.