Skip to content

Relative path finding fix#23

Open
rmikalkenas wants to merge 1 commit intoEasyCorp:masterfrom
rmikalkenas:patch-1
Open

Relative path finding fix#23
rmikalkenas wants to merge 1 commit intoEasyCorp:masterfrom
rmikalkenas:patch-1

Conversation

@rmikalkenas
Copy link

If $this->localProjectDir = '/app' and $absolutePath = '/app/web/app_dev.php' then $relativePath = '/web_dev.php' and validatePathIsRelativeToProject throws InvalidConfigurationException.
As I understand it should remove absolute paths dir

If `$this->localProjectDir = '/app'` and `$absolutePath = '/app/web/app_dev.php'` then `$relativePath = '/web_dev.php'` and `validatePathIsRelativeToProject` throws `InvalidConfigurationException`.
As I understand it should remove absolute paths dir
@@ -272,6 +272,10 @@ public function controllersToRemove(array $paths) : self

$localRelativePaths = array_map(function ($absolutePath) {
$relativePath = str_replace($this->localProjectDir, '', $absolutePath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, i wonder why don't we just replace this line to $relativePath = mb_substr($absolutePath, mb_strlen($this->localProjectDir)); instead?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i get it now. Your solution indeed fix the issue you mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants