EasyPHP
EN FR
>download >components >modules >blog >forum >faq >screenshots >introduction

For Windows Vista/Seven issues, please read the FAQ or leave a detailed message

PHP Integration with TFS command line - 'TF label'



August 18, 2010 05:23PM
Hi team,

I am working on a small PHP application which is used for handling a build/release request workflow as well as helps tracking releases across different environments. One of the features of this tool enables the release manager to mark a request as 'deployed' and an automatic email alert goes out to the development team. This PHP tool, running on EasyPHP is deployed on the Build Agent - the same build agent where MSBuild is installed and the 'tf' command line is available.

Ok, enough about the tool, coming to my TFS issue. I need to implement a feature wherein the TFS source code is labeled with a unique label as and when a release is marked as 'Deployed' on the PHP application. To implement this, I am trying to invoke the TFS command line from PHP. That is where the issue is. I am trying the following PHP code -
$tmp=exec("tf label myUniqueLabel $TeamProject/myFolder /login:abc,xxx /server:teamsystem.abc.com:8080");

I tried with exec, system, exec_shell..whatever, but it just doesn't work. I tried to put this TFS command line command on to a windows BAT file, it still doesn't work.
$tmp=exec("myLabelLogic.bat");

Some more observations -

- The bat file, as well as the command in general, works fine when I try to invoke it directly on the build agent.
- I tried to put some echo Hello World statements in the bat file, and those are printed out. This implies that the windows bat file is being called, but somehow my 'tf label' logic isn't called/doesn't work.
- Instead of the 'tf label' command, I tried a 'tf msdn' command and that seemingly is getting invoked from PHP - I get the same output as the one I get when I run the command directly on the command prompt.
- I use EasyPHP, which is invoked with the same windows username as the one used in the /login command above.

I tried googling around, tried a lot of tricks, even tried ensuring that the easyphp application has 'access to the desktop' using the windows services.msc option, but nothing works.

Would be nice if someone helps me out with this!

Regards,

Mrinal Mukherjee

Options: ReplyQuote
Posted by: Amour
August 19, 2010 07:03AM
Is it better if you use full path of "tf" ?

Also, can you try to find why "tf" is not working... maybe with ProcessMonitor ?

Options: ReplyQuote


Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.