Steve Lange @ Work

Steve Lange's thoughts on application lifecycle management, Visual Studio, and Team Foundation Server

July, 2009

  • Steve Lange @ Work

    Quick Way to Integrate PhpED and Team Foundation Server

    • 3 Comments

    phpedlogo So when I’m asked, “How can I integrate my PHP IDE with Team Foundation Server?”, my first response *should* be, “Why not use Visual Studio instead?”  That’s an idealistic reply, admittedly.  There are several great tools out there for PHP development, with followings that would collectively shudder at the thought of *having* to use Visual Studio.

    PhpED by NuSphere is a popular PHP development tool.  It boasts (among a lot of other things) the ability to plug-in to various version control systems, although it comes set up to leverage CVS.    There’s not much documentation out there to explain how exactly to tie into other version control systems besides CVS.  So what about Team Foundation Server?

    The fast answer?  Use the TFS Power Tools, more specifically the Windows Explorer extension.  This power tool allows you to perform version control operations on files directly from Windows Explorer:

    The TFS shell extension power tool

    All that’s really required (besides having the TFS Power Tools installed) is that the files you want to work on reside in a folder that’s in a TFS workspace

    If you use PhpED for PHP development, you probably see where I’m going with this.  ;)

    Let’s say I have the below workspace and project in PhpED:

    A sample project in PhpED

    I set up this project in C:\Work\NotDotNet\Test, which is already mapped to a TFS workspace.  As soon as I start populating files into this project, I can see that the Windows Explorer extension power tool is already working if I look at the file system:

    The TFS shell extension

    Now for the fun part.  PhpED has a nifty little feature that allows you to access the Windows shell from within its IDE.  Right-click, select “Shell Menu”, and there it is!

    Accessing the TFS shell extension from PhpED

    To add all these files to TFS version control, I right-click the project and select Shell Menu->Team Foundation Server->Add.

    The “Add to Source Control” dialog pops up:

    Add to Source Control dialog

    Hit “Finish”, and I’ve added all my files as pending changes to TFS.  Last, all I have to do is check them in by again going to the Shell Menu, only this time selecting “Check In”.

    Selecting Check In

    That gives me the TFS check-in dialog we all know and love.  I can do everything I normally would with this dialog, such as choosing specific files to check in, comments, check-in notes, and linking to work items.

    TFS Check-in dialog

    Click “Check In” and I’m done (in my case, check check-in created changeset 270)!

    Check-in completed!

    BTW, notice I’m getting the TFS version control icons displayed in PhpED (the green triangles in at the bottom-right of an item’s icon indicates it’s “seen” by TFS, a pencil indicates a checked-out file, etc.):

    TFS version control icons in PhpED

    Now to test that I can check out and check in, let’s make a little change.  (My big preface here is that I know almost nothing about PHP development, so I’m just going to insert some arbitrary text so I have a modification.  This is not a PHP lesson!)

    First, I noticed that PhpED won’t even let me modify a file (may be a setting somewhere, but I’m not sure) if it’s read-only.  So that tells me right away that my file is not checked out.

    So I check out the file via the Shell Menu extension (Shell Menu->Team Foundation Server->Check Out for Edit).

    Checking out a PHP file for edit

    Now I can make a small change.

    My simple change

    Once I’m done making my edits, I save the file and check it in (again using the Shell Menu, you probably get this by now).

    Selecting check-in

    Again, I get the beloved check-in dialog again.

    Check in Dialog

    Fill in the information I want, click “Check In”, and  I’m off!

    Now, just to make sure I’m not looking at smoke and mirrors, let’s switch to Team Explorer and view the file’s history.

    File history in Team Explorer

    There’s my change!  Now, for a final check, let me diff the two versions.

    Comparing the two versions of the PHP file in version control

    Make sense?  Not bad for a free integration point!

    Now, this all said, there is one main caveat which is worth mentioning – it shouldn’t prevent you from leveraging this shell-type integration, but it should be known nonetheless.  The TFS Power Tool shell extension only provides the basic version control operations.  Others, such as getting historical versions, viewing history, branching, merging, and shelving are notably absent from the shell extension’s menu.  You can still do all this from Team Explorer – you’ll have this installed on your machine, as it’s a requirement for the TFS Power Tools to be installed.  So yes, for some operations you’ll need to pop open Team Explorer, but the bulk of your daily operations are available right from the shell.

    BUT, PhpED is also has a very extensible menu system (that’s how it ties in with CVS), so you may also be able to leverage that to create TFS-specific menu options (such as creating workspaces, diffing files, etc.).  I had a little fun with this and was able to quite easily create a couple of TFS-related menu options to help me view a file’s history, as well as create a shelf.  All I did was drop the path to tf.exe (by default it’s "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\”) into my PATH environment variable (just easier than putting in the full path to tf.exe each time), and away I went.

    In PhpED, go to Tools->Settings, then scroll down to Integration under Tools.  Here I created a new menu called “Team Foundation Server” and added a few submenu items with the following options (I’m sure you can figure out how to add a few more if you want):

    Option Name Command Options Selected
    View History tf history “@FName@”
    • Show this command in workspace popup, for files
    • Show this command in Explorer popup, for files
    Shelve tf shelve
    • Show this command in workspace popup, for files, for directories
    • Show this command in Explorer popup, for files, for directories

    Annotate

    tfpt annotate “@FName@”
    • Show this command in workspace popup, for files
    • Show this command in Explorer popup, for files

    And I end up with this:

    PhpED Settings - customized menus for TFS

    As you can see, I can leverage the command-line interface for both Team Explorer (tf.exe) and the Power Tools (tfpt.exe, which gets added to your PATH automatically upon installation).

    So now, when I right-click on certain objects in PhpED, I can take advantage of these options.  They simply shell out the specified commands and the appropriate CLI takes over.  For example, if I select “View History”,

    Selecting the View History custom menu option

    I get this:

    Viewing History of the selected file in PhpED

    Sweet!

    So that’s about it!  There of course may be other ways to integrate these two products (perhaps using SVNBridge on CodePlex), but I found this above method to be quick and relatively painless.

    I hope this helps a couple people!  Please let me know what you think, or if you have any questions.

  • Steve Lange @ Work

    Windows 7 RTM Available to all MSDN Subscribers on August 6

    • 0 Comments

    Windows 7 On August 6th, the first public release of Windows 7 will be to MSDN Subscribers, which is over two months ahead of the general availability date of October 22nd for retail and OEM customers!  Lucky you!

    To support the variety of languages and builds, 893 different images are being released to MSDN Subscriber Downloads in three waves through August 21st:

    • Wave 1 (August 6th):
      • All Windows 7 Client (x86 and x64) Retail and VL Editions – English only
      • Language packs, WAIKs, WDKs, SDKs, and Symbols – in all available languages
    • Wave 2 (August 14th):
      • Windows Server 2008 R2 Standard, Enterprise, Datacenter, Web, Itanium (x64 and ia64) – English, French, German, Italian, Spanish, Japanese
      • All Windows 7 Client (x86 and x64) Retail and VL Editions – French, German, Italian, Spanish, Japanese
      • Checked builds – English
    • Wave 3 (August 21st):
      • Remaining Windows 7 Client and Windows Server 2008 R2 Editions in the following languages, released as they become available (likely order) – Dutch, Russian, Simplified Chinese, Brazilian, Polish, Korean, Traditional Chinese (Taiwan), Traditional Chinese (Hong Kong – SAR), Turkish, Czech, Portuguese, Hungarian, Swedish, Danish, Norwegian, Finnish, Arabic, Hebrew, Greek, Ukrainian, Thai, Romanian, Lithuanian, Slovak, Bulgarian, Estonian, Croatian, Serbian Latin, Latvian, Slovenian
      • Windows 7 Starter Edition – All languages

    Below are a few resources you may find helpful:

  • Steve Lange @ Work

    Expression Studio 3 Now Available to ALL MSDN Premium Subscribers

    • 0 Comments

    Microsoft Expression Last week, we expanded availability for Expression Studio to all MSDN Premium subscribers with the release of Expression 3 on MSDN Subscriber Downloads.  Previously, only subscribers at the Visual Studio Team System Team Suite with MSDN Premium level have been able to download Expression Studio, while all other MSDN Premium subscribers (e.g., Visual Studio Professional with MSDN Premium, Visual Studio Team System Development Edition with MSDN Premium, etc.) only had access to Expression Web and Expression Blend.

    Download Expression Studio 3 here (from MSDN, for MSDN Premium subscribers)!

  • Steve Lange @ Work

    Come Learn about TFS @ the South Colorado UG on 8/4

    • 0 Comments

    I’ll be speaking about “Team Foundation Server: Today & Tomorrow” at the August meeting of the South Colorado .NET User Group.  I hope to see you there!

Page 1 of 1 (4 items)