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

symfony as symlink (callable from anywhere) #204

Open
xerc opened this issue Feb 2, 2019 · 6 comments · May be fixed by #367
Open

symfony as symlink (callable from anywhere) #204

xerc opened this issue Feb 2, 2019 · 6 comments · May be fixed by #367

Comments

@xerc
Copy link

xerc commented Feb 2, 2019

// prevent symlink obfuscation
chdir(dirname($_SERVER['SCRIPT_FILENAME']));

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

@j0k3r
Copy link
Contributor

j0k3r commented Jun 8, 2020

I don't get it. What changes are you requested? Could you submit a PR?

@xerc
Copy link
Author

xerc commented Jun 9, 2020

$ ln -s ~/web/symfony/lib/vendor/bin/symfony /tmp/symfony
$ cd /tmp && php symfony

will only show the symfony commands - but not lib/tasks/*

@xerc
Copy link
Author

xerc commented Mar 27, 2024

@j0k3r ; should running symfony outside of the project directory raise an error or only with args (actual behavior)?

public function checkProjectExists()
{
if (!file_exists('symfony')) {
throw new sfException('You must be in a symfony project directory.');
}

@connorhu
Copy link
Collaborator

connorhu commented Mar 27, 2024

@xerc What is your suggestion, how should the symfony know where the "project root" is?

@xerc
Copy link
Author

xerc commented Mar 28, 2024

@connorhu as seen above symfony checks itself in this version (when running a task)

@alquerci
Copy link
Contributor

alquerci commented Apr 2, 2024

Behaviours

The actual working behaviour

cd path/to/symfony-project-root
./symfony --version

But, that does not work

cd path/outside
path/to/symfony-project-root/symfony --version

Possible solution

1. Simple one

Having a wrapper script.

#! /bin/sh -eu

cd path/to/symfony-project-root

./symfony "$@"

2. Harder one

Adding the feature to be able to execute symfony1 task on any current working directory.

3. Looking for current Symfony behaviour

...

@connorhu connorhu linked a pull request Apr 4, 2024 that will close this issue
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 a pull request may close this issue.

4 participants