Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ability to inject custom drivers #1105

Merged
merged 5 commits into from Jun 26, 2018
Merged

Conversation

maximgubar
Copy link
Contributor

@maximgubar maximgubar commented Jun 18, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

this PR makes possible to declare and inject custom drivers for the bundle.
validation on strict match for 'gd', 'imagick', 'gmagick' has been removed

if (false === mb_strpos($path, '..'.DIRECTORY_SEPARATOR) &&
false === mb_strpos($path, DIRECTORY_SEPARATOR.'..') &&
false !== file_exists($absolute = $root.DIRECTORY_SEPARATOR.$path)
if (false === mb_strpos($path, '..'.\DIRECTORY_SEPARATOR) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

why the backslashes here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is global constant and php-cs doesn't like it without backslash

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm maybe better to disable the php-cs rule? I have never added blackslashes to such global constants and don't really see the point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was fixed in 1107.
will remove backslashes.

@@ -60,7 +60,7 @@ public function locate(string $path): string
*/
protected function generateAbsolutePath(string $root, string $path): ?string
{
if (false !== $absolute = realpath($root.DIRECTORY_SEPARATOR.$path)) {
if (false !== $absolute = realpath($root.\DIRECTORY_SEPARATOR.$path)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why the backslashes here?

@@ -127,7 +127,7 @@ private function getBundleResourcePaths(ContainerBuilder $container)
}

return array_map(function ($path) {
return $path.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'public';
return $path.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'public';
Copy link
Contributor

Choose a reason for hiding this comment

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

why the backslashes here?

@@ -50,8 +50,8 @@

protected function setUp()
{
$this->fixturesPath = realpath(__DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$this->temporaryPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'liip_imagine_test';
$this->fixturesPath = realpath(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
Copy link
Contributor

Choose a reason for hiding this comment

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

why the backslashes here?

@lsmith77
Copy link
Contributor

maybe we should have a 2.1 branch for this? or should we actually start using master again for future minor/major new versions?

@maximgubar maximgubar changed the base branch from 2.0 to master June 26, 2018 08:24
@maximgubar
Copy link
Contributor Author

@lsmith77 we started to use master branch again, the base branch of this PR was changed.

@lsmith77 lsmith77 merged commit 2e1c7d7 into master Jun 26, 2018
@lsmith77 lsmith77 deleted the config-driver-injection branch June 26, 2018 11:29
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.

None yet

2 participants