Skip to content

[command] allow to call symfony command from anywhere - #367

Open
connorhu wants to merge 3 commits into
FriendsOfSymfony1:masterfrom
connorhu:fix/g204-call-command-anywhere
Open

[command] allow to call symfony command from anywhere#367
connorhu wants to merge 3 commits into
FriendsOfSymfony1:masterfrom
connorhu:fix/g204-call-command-anywhere

Conversation

@connorhu

@connorhu connorhu commented Apr 4, 2024

Copy link
Copy Markdown
Collaborator

closes #204

What this cause?
a) cwd is set properly => nothing
b) cwd is not set properly => somewhere something cause error

But it's the caller's responsibility to make sure cwd is set properly.
The symfony command sets cwd anyway:

@connorhu
connorhu force-pushed the fix/g204-call-command-anywhere branch from a9e68c0 to a48ed19 Compare April 4, 2024 12:43
@connorhu
connorhu force-pushed the fix/g204-call-command-anywhere branch from a48ed19 to cfda1c8 Compare April 4, 2024 12:44
@connorhu
connorhu requested a review from thePanz April 4, 2024 12:57

@alquerci alquerci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but a BC break concern.

About checkProjectExists()

As a public method, we do not know the usage of this public method.
Changing its behaviour is a BC break.

Only removing its usage, will be enough.

I suggest keeping it untouched OR use config/ProjectConfiguration.class.php like

// project exists?
if (file_exists('config/ProjectConfiguration.class.php'))
{
require_once('config/ProjectConfiguration.class.php');

@connorhu

connorhu commented Apr 5, 2024

Copy link
Copy Markdown
Collaborator Author

This feature protects the developer during development from doing the inappropriate thing (e.g. calling cli.php in the wrong way). But on a complete system, this method is no longer relevant and as I wrote, the cwd is handled by the symfony script. There are already tools used during development which are not tested and do not work properly under certain circumstances (e.g. #341).

@connorhu connorhu changed the title [command] allow to can call symfony command from anywhere [command] allow to call symfony command from anywhere Apr 9, 2024
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.

symfony as symlink (callable from anywhere)

2 participants