Deployer: Namespace for functions

Created on 17 Jun 2015  Â·  15Comments  Â·  Source: deployphp/deployer

Should Deployer use namespace for functions in functions.php?
To protect from overriding when installed via Composer with Laravel.
In recipe can be used in two ways:

use function Deployer/task;

or

namespace Deployer;

@deployphp/maintainer what do you think?

bug

Most helpful comment

The global nature of deployer functions clashes also with hamcrest-php.

I get the following error:

PHP Fatal error:  Cannot redeclare set() 
(previously declared in vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php:455)
in vendor/deployer/deployer/src/functions.php on line 417

Definitely +1 for using a namespace in functions.php

All 15 comments

use function can be used on PHP 5.6 or lator.

If you use use function you'd have to import all functions (not only task). So i'd go for namespace Deployer.

Also, if this is to be implemented, i'd suggest in 4.0, per semver compliance. Lets not break API in minor updates.

I already wrote a couple of times how I'm a bit troubled by the "global" way Deployer sometimes handles things, so I'd back any solution.
On another note: I agree with @gordalina here, the idea is good, but it's hard to see whether it could be achieved in a non-BC-breaking fashion.

@ZeeCoder I don't think it's achievable in a non-BC-breaking fashion, and I'm ok with that, if and only if, there's a proper versioning scheme (such as semver) and documentation for it.

My thoughts exactly

So you think go for v4.0?

For certain features, like this one, yes imho.

Well, lets release 4.0! Also i have 100% awesome feature for this release. :fork_and_knife: :fork_and_knife: :fork_and_knife: :fork_and_knife:

Is there any other way to fix deployment of laravel apps?
On qua, 17/06/2015 at 15:36 Anton Medvedev [email protected] wrote:

Well, lets release 4.0! Also i haму 100% awesome feature for this release. [image:
:fork_and_knife:] [image: :fork_and_knife:] [image: :fork_and_knife:] [image:
:fork_and_knife:]

—
Reply to this email directly or view it on GitHub
https://github.com/deployphp/deployer/issues/356#issuecomment-112826244.

+1

:+1:

The global nature of deployer functions clashes also with hamcrest-php.

I get the following error:

PHP Fatal error:  Cannot redeclare set() 
(previously declared in vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php:455)
in vendor/deployer/deployer/src/functions.php on line 417

Definitely +1 for using a namespace in functions.php

Same here on symfony2 project

Need this as fast as possible for Symfony2 / Symfony3.

I think we need #471 to complete this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sweebee picture sweebee  Â·  3Comments

khoanguyen96 picture khoanguyen96  Â·  5Comments

dima-stefantsov picture dima-stefantsov  Â·  4Comments

lsv picture lsv  Â·  4Comments

dima-stefantsov picture dima-stefantsov  Â·  5Comments