This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » Multiple Versions of symfony on Windows
Multiple Versions of symfony on Windows [message #63389] Fri, 17 October 2008 20:40 Go to next message
AgentPhoenix  is currently offline AgentPhoenix
Messages: 9
Registered: July 2008
Junior Member
I'm trying to set up symfony 1.0.17, 1.1.4 and the 1.2 branch on a Windows machine so multiple applications can be developed on different symfony versions. I've followed http://symfonynerds.com/blog/?p=123 to the letter, but obviously ln -s doesn't work on a Windows machine. How do I create symbolic links to finish this up and be able to use multiple versions?
Re: Multiple Versions of symfony on Windows [message #63392 is a reply to message #63389 ] Fri, 17 October 2008 21:58 Go to previous messageGo to next message
Steffen  is currently offline Steffen
Messages: 18
Registered: March 2007
Junior Member
Well, to create symbolic links in Windows you need a tool called "junction" from Microsoft.

For your convenience: the link is http://technet.microsoft.com/en-us/sysinternals/bb896768.asp x

Hope that helps. Smile
Re: Multiple Versions of symfony on Windows [message #63408 is a reply to message #63389 ] Sat, 18 October 2008 11:53 Go to previous messageGo to next message
Targa  is currently offline Targa
Messages: 9
Registered: October 2008
Location: Siberia =)
Junior Member
Hi!
Junction tool is pretty cool but requires NTFS. So if you don't use NTFS, there is another way.
In our case (multiple symfony instances on Windows) you could use *.bat files to "emulate" symlinks on Windows.
Put code like this to symfony12.bat:
@echo off
<path_to_your_symfony_1.2_dir>\data\bin\symfony.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

Now, if you call
symfony12 -V
you'll see something like this:
symfony version 1.2.0-DEV (C:\server\php5\symfony_1.2\lib)
(my <path_to_your_symfony_1.2_dir> == C:\Server\php5\symfony_1.2). Note that symfony12.bat should be in your PATH.

Repeat this to each symfony version you want =)

P.S.


In theory there is no difference between theory and practice. In practice - there is.
Re: Multiple Versions of symfony on Windows [message #63448 is a reply to message #63389 ] Sun, 19 October 2008 17:02 Go to previous messageGo to next message
AgentPhoenix  is currently offline AgentPhoenix
Messages: 9
Registered: July 2008
Junior Member
For using junctions, where exactly do I need to be when I execute the commands? Should I be in the symfony12 folder, the project folder, or somewhere completely different?
Re: Multiple Versions of symfony on Windows [message #63465 is a reply to message #63389 ] Sun, 19 October 2008 19:37 Go to previous messageGo to next message
cokker  is currently offline cokker
Messages: 582
Registered: January 2007
Location: Germany
Faithful Member
I'm not sure if you really need symlinks to run different Versions.

You can create a new project by using absolute path to symfony-executable. In existing projects you can you ./symfony

The path to the install-dir of symfony libs are stored in config/config.php. or config/ProjectConfiguration.class.php (V1.1) If you adjust this all should be fine.

Greets
Sven
Re: Multiple Versions of symfony on Windows [message #63514 is a reply to message #63389 ] Mon, 20 October 2008 14:17 Go to previous messageGo to next message
AgentPhoenix  is currently offline AgentPhoenix
Messages: 9
Registered: July 2008
Junior Member
@cokker:
Yeah, I'm pretty sure you need access to the CLI stuff. Without it, you can't actually generate the file structure that's needed. Also, the environment we have set up would require us to be able to use symfony commands at the command line.

@Targa:
Alright, I put that code into my symfony.bat in symfony12. Here is the code I added:

@echo off
C:\xampp\php\symfony\symfony12\data\bin\symfony.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

I've also added the symfony 1.2 BAT file to the system variables. I go to the command line and issue the command symfony12 -V and it returns: "'symfony12' is not recognized as an internal or external command, operable program or batch file."

Any ideas?
Re: Multiple Versions of symfony on Windows [message #63515 is a reply to message #63514 ] Mon, 20 October 2008 15:38 Go to previous messageGo to next message
Targa  is currently offline Targa
Messages: 9
Registered: October 2008
Location: Siberia =)
Junior Member
OK, let's try again Smile

1. This code should be placed in file symfony12.bat (you doesn't have to name your file symfony12.bat, it could be named whatevere you want, but as for me - i prefer not to name it just "symfony.bat", because these could rise problems with ambiguous names).

2. Now, you have to place symfony12.bat somewhere Windows could find it, for example in C:\xampp\php\. And your PATH is this case should looks something like that: C:\WINDOWS\system32;C:\WINDOWS;C:\xampp\php\.

3. Now you could run symfony12 -V command. If you have named your .bat file in step 1, say, mysymfonystuff.bat - your command should be mysymfonystuff -V.

Hope this'll help you Smile


In theory there is no difference between theory and practice. In practice - there is.
Re: Multiple Versions of symfony on Windows [message #63519 is a reply to message #63389 ] Mon, 20 October 2008 16:13 Go to previous messageGo to next message
AgentPhoenix  is currently offline AgentPhoenix
Messages: 9
Registered: July 2008
Junior Member
Alright, so a follow-up question here. Do I move the symfony.bat file from symfony12/data/bin to, say, the XAMPP PHP directory, or do I just copy it? Or, even still, can I just point the system variable to the data/bin folder?
Re: Multiple Versions of symfony on Windows [message #63520 is a reply to message #63519 ] Mon, 20 October 2008 16:24 Go to previous messageGo to next message
Targa  is currently offline Targa
Messages: 9
Registered: October 2008
Location: Siberia =)
Junior Member
No Smile There is no need in doing all that stuff Smile

Your symfony12.bat would perfectly redirect your commands to native \data\bin\symfony.bat


In theory there is no difference between theory and practice. In practice - there is.
Re: Multiple Versions of symfony on Windows [message #66690 is a reply to message #63408 ] Wed, 03 December 2008 20:48 Go to previous message
rarerules  is currently offline rarerules
Messages: 17
Registered: February 2007
Junior Member
Targa wrote on Sat, 18 October 2008 05:53

Hi!
Junction tool is pretty cool but requires NTFS. So if you don't use NTFS, there is another way.
In our case (multiple symfony instances on Windows) you could use *.bat files to "emulate" symlinks on Windows.
Put code like this to symfony12.bat:
@echo off
<path_to_your_symfony_1.2_dir>\data\bin\symfony.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

Now, if you call
symfony12 -V
you'll see something like this:
symfony version 1.2.0-DEV (C:\server\php5\symfony_1.2\lib)
(my <path_to_your_symfony_1.2_dir> == C:\Server\php5\symfony_1.2). Note that symfony12.bat should be in your PATH.

Repeat this to each symfony version you want =)

P.S.


Actually you should replace this with:

<path_to_your_symfony_1.2_dir>\data\bin\symfony.bat %*


Because commands with arguments won't be passed correctly. For example:

symfony generate:app --escaping-strategy=on --csrf-secret=Unique$ecret frontend


won't work since DOS interprets the equals sign as an argument delimiter, instead of as part of the argument itself. If you use %* instead, all arguments will be passed "as is".
Previous Topic:fatal error in install sandbox
Next Topic:Installation switch
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software