Development

#6914 (symfony.bat minor bug)

You must first sign up to be able to contribute.

Ticket #6914 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

symfony.bat minor bug

Reported by: rochajoel Assigned to: Yve
Priority: minor Milestone: 1.2.10
Component: other Version: 1.2.8
Keywords: Windows batch Cc:
Qualification: Unreviewed

Description (Last modified by FabianLange)

I went into some trouble the other day because i was working on Windows XP with a sub directory named symfony, and the batch file you provide has a little bug in this case because:

IF EXISTS .\symfony

matched against the directory, not the file, and this was giving me an error.

I decided to have it fixed up and i send you my slow but robust bug fix. I hope you like it, it is an honor to me to be able to contribute to such a great software.

Attachments

symfony-bat.patch (0.6 kB) - added by FabianLange on 07/28/09 11:21:55.
patch file for windows batch file according to original patch

Change History

07/28/09 11:21:55 changed by FabianLange

  • attachment symfony-bat.patch added.

patch file for windows batch file according to original patch

07/28/09 11:24:20 changed by FabianLange

  • description changed.

10/08/09 16:06:37 changed by fabien

Fabian, any reason for not applying the patch?

10/08/09 17:46:57 changed by FabianLange

I dont really like it, performance on the cli on windows is bad enough already and this patch would do a not really inexpensive search for the executable each time. I haven't had the time to check if my doubts are well founded.

11/10/09 22:36:00 changed by FabianLange

  • milestone set to SymfonyBugHuntDay.

Dear Bug Hunters, are you a Windows expert? Can you clear up my confusion?

11/14/09 15:07:58 changed by Yve

  • owner changed from fabien to Yve.
  • status changed from new to assigned.

11/14/09 16:43:33 changed by Yve

  • status changed from assigned to closed.
  • resolution set to worksforme.

Why not just simplify things?

If it doesn't get the script's path (not an NT), just feed it 'symfony', otherwise always include the full path.

The result should be the same as with the patch.

Just replace:

IF EXIST ".\symfony" (

%PHP_COMMAND% ".\symfony" %*

) ELSE (

%PHP_COMMAND% "%SCRIPT_DIR%\symfony" %*

)

With:

if "%SCRIPT_DIR%" == "" (

%PHP_COMMAND% "symfony" %*

) else (

%PHP_COMMAND% "%SCRIPT_DIR%\symfony" %*

)

The only case this will not work is if you use a pre-NT system and somehow the current path the batch file uses isn't the path it is in. I have no pre-NT Windows version available, so I can't test this.

Sorry for not using a patch, I'm not quite familiar with the system.

11/14/09 21:06:01 changed by FabianLange

  • status changed from closed to reopened.
  • resolution deleted.

11/14/09 21:14:07 changed by FabianLange

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [23948]) [1.3, 1.4] improved searching for symfony script file on windows (closes #6914)

11/14/09 21:14:44 changed by FabianLange

(In [23949]) [1.2] improved searching for symfony script file on windows (closes #6914)

11/15/09 20:30:00 changed by FabianLange

  • milestone changed from SymfonyBugHuntDay to 1.2.10.