symfony1 icon indicating copy to clipboard operation
symfony1 copied to clipboard

`symfony` as symlink (callable from anywhere)

Open xerc opened this issue 6 years ago • 6 comments

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

https://github.com/FriendsOfSymfony1/symfony1/blob/573d5790cb007ff8a4447a148497a5516673fcea/data/bin/symfony#L12-L15

xerc avatar Feb 02 '19 14:02 xerc

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

j0k3r avatar Jun 08 '20 06:06 j0k3r

$ 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 avatar Jun 09 '20 13:06 xerc

Hi

security-softwares avatar Oct 16 '22 12:10 security-softwares

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

https://github.com/FriendsOfSymfony1/symfony1/blob/0c9ba112fc2d7ed21796079fb66c5e592943c701/lib/task/sfBaseTask.class.php#L57-L61

xerc avatar Mar 27 '24 18:03 xerc

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

connorhu avatar Mar 27 '24 20:03 connorhu

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

xerc avatar Mar 28 '24 09:03 xerc

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

...

alquerci avatar Apr 02 '24 19:04 alquerci