From 89697138e217fedc1ca1851eea4779a9da9acb14 Mon Sep 17 00:00:00 2001 From: Alan Fuller Date: Thu, 22 Apr 2021 16:21:33 +0100 Subject: [PATCH 1/5] Update readme.md Incorrect command name --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index a23c44d..ef2a869 100644 --- a/readme.md +++ b/readme.md @@ -25,7 +25,7 @@ composer require ilab/namespacer Once installed: ```bash -./vendor/bin/renamespace [--composer COMPOSER] [--source SOURCE] [--package PACKAGE] [--namespace NAMESPACE] [--config CONFIG] +./vendor/bin/namespacer [--composer COMPOSER] [--source SOURCE] [--package PACKAGE] [--namespace NAMESPACE] [--config CONFIG] ``` ### Arguments @@ -55,4 +55,4 @@ process to catch special cases. ## Reporting Bugs If you run into issues, please open a ticket and attach the composer.json you were trying to process with a clear -description of the problem. \ No newline at end of file +description of the problem. From 02f6491ee64f75b226a378a1d9fd022ee21e9d2f Mon Sep 17 00:00:00 2001 From: alanef Date: Mon, 26 Apr 2021 17:41:58 +0100 Subject: [PATCH 2/5] Component: Package.php the copy of the package directory adds itself to its own subdirectory thus breaking PSR4 auto loader path fix removes one subdir from the copy fixes #1 --- Source/Models/Package.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Models/Package.php b/Source/Models/Package.php index de984ef..84d0304 100644 --- a/Source/Models/Package.php +++ b/Source/Models/Package.php @@ -160,7 +160,7 @@ public function process($configuration, string $packagePrefix, string $namespace unset($config['extra']['branch-alias']['dev-master']); @mkdir("$outputPath{$this->name}", 0755, true); - `cp -r {$this->path} $outputPath{$this->name}/`; + `cp -r {$this->path} $outputPath . dirname( $this->name )`; file_put_contents($outputPath.$this->name.'/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); From 35d7695d23d991264fccfae918681042e03a7bee Mon Sep 17 00:00:00 2001 From: alanef Date: Mon, 26 Apr 2021 17:53:53 +0100 Subject: [PATCH 3/5] Component: Package.php the copy of the package directory adds itself to its own subdirectory thus breaking PSR4 auto loader path fix removes one subdir from the copy add comments in code fixes #1 --- Source/Models/Package.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Models/Package.php b/Source/Models/Package.php index 84d0304..4f8d542 100644 --- a/Source/Models/Package.php +++ b/Source/Models/Package.php @@ -160,6 +160,10 @@ public function process($configuration, string $packagePrefix, string $namespace unset($config['extra']['branch-alias']['dev-master']); @mkdir("$outputPath{$this->name}", 0755, true); + /* + * change $this->name dirname of $this->name it make sthe assumption ALL packages are in teh format account/package + * maybe this needs to be validated but I haven't found an example that doesn't + */ `cp -r {$this->path} $outputPath . dirname( $this->name )`; file_put_contents($outputPath.$this->name.'/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); From d9477e70825a4b2ebe3fe3aa6a91a0b78377e72f Mon Sep 17 00:00:00 2001 From: alanef Date: Mon, 26 Apr 2021 18:11:25 +0100 Subject: [PATCH 4/5] Component: Package.php the copy of the package directory adds itself to its own subdirectory thus breaking PSR4 auto loader path fix removes one subdir from the copy add comments in code fixes #1 --- Source/Models/Package.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Models/Package.php b/Source/Models/Package.php index 4f8d542..f7bf80f 100644 --- a/Source/Models/Package.php +++ b/Source/Models/Package.php @@ -164,7 +164,8 @@ public function process($configuration, string $packagePrefix, string $namespace * change $this->name dirname of $this->name it make sthe assumption ALL packages are in teh format account/package * maybe this needs to be validated but I haven't found an example that doesn't */ - `cp -r {$this->path} $outputPath . dirname( $this->name )`; + $target = $outputPath . dirname( $this->name ); + `cp -r {$this->path} {$target}`; file_put_contents($outputPath.$this->name.'/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); From 90242b9029afe729d36b5fb77fcb964282252ac5 Mon Sep 17 00:00:00 2001 From: alanef Date: Wed, 4 Oct 2023 14:41:44 +0100 Subject: [PATCH 5/5] Fix missing function name in check for trailingslashit in functions.php --- .gitignore | 3 +++ Source/functions.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4e0ce4b..49e8056 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ build temp vendor composer.lock +.idea/ +.directory/ + diff --git a/Source/functions.php b/Source/functions.php index 607d8c9..bad3665 100644 --- a/Source/functions.php +++ b/Source/functions.php @@ -31,7 +31,7 @@ function arrayPath($array, $path, $defaultValue = null) { } } -if (!function_exists('')) { +if (!function_exists('trailingslashit')) { function trailingslashit( $string ) { return untrailingslashit( $string ) . '/'; }