Home > Programming > PHP Interoperability & PDM Works Enterprise

PHP Interoperability & PDM Works Enterprise

One of my clients recently purchased PDM Works Enterprise in replacement for Visual Source Safe. In the pas few days, I got to familiarize myself with the tool and the objective is now to integrate it’s functionality with the existing intranet. It brought me in lands I had not visited in a long while: Microsoft technologies.

PDM Works Enterprise exposes a large COM interface for external applications to communicate with. The easy solution is to write VB applications to be called in command line. All examples provided in the documentation are either VB or VC++ and autocompletion makes accessing the COM objects very easy. Before going that route, I decided to give a try to the PHP COM extension, which reduces the amount of bridging required.

After a few minutes searching for the appropriate COM object to load, I got it running and everything worked flawlessly. I was really surprised. Finding the name of the COM object is far from easy thought (at least, for a non-Microsoft person like me). In the VB examples, EdmLib is imported and EdmVault can be instantiated. My first guess was something like this:

$vault = new COM( 'EdmLib.EdmVault' );
$vault->Login( ... );

Failure. After a few searches on Google, I came to the conclusion that no one ever used PDM Works with PHP. No big surprise there. Worst, it seemed like I was the only one who couldn’t figure where to find COM object names. How am I supposed to find them? I still don’t know, but a search in the registry brought me to this solution:

$vault = new COM( 'ConisioLib.EdmVault.1' );
$vault->Login( ... );

I could have figured out the Conisio part, which is the previous name of the product. Actually, I had a few attempts made in that direction, but the “.1″ part, I had no clue.

After that point, methods can be called. Some of them return objects and they can be dealt with seamlessly. Performances are acceptable and the API documentation provided is sufficient to remove the need for auto-completion. I still built myself an abstraction layer to get better error handling and especially to get rid of the weird calls required to iterate the lists. Although the COM extension supports iterators, the library does not seem to use them.

For some reason, I was expecting that I would need to run the PHP scripts from the PDM Works server. To my great surprise, they can run from anywhere, as long as the client software is installed and a local view is set-up. I could fairly easily perform all the operations I needed.

This solves the problem of the intranet to PDM Works communication. I will still have to write some VB to handle the various hooks in the process thought. At this time, the greatest obstacle is that Microsoft won’t let me use their products. I first installed the express edition and got a product key registered. They key they provided does not work. Great. Since I had no time to waste getting it to work (because it’s probably a firewall or proxy issue), I actually attempted to purchase the standard edition. The store on the MSDN website only ships to US. Staples is out of stock and ordering is not enabled. Futureshop does not sell it anymore. Amazon.ca is out of stock. Amazon.com does not ship software in Canada. Every other online vendor I visited from the reseller page does not have the product in stock. Is it actually possible to buy Visual Studio?

Categories: Programming Tags:
  1. March 16th, 2009 at 00:36 | #1

    Hi! just want to say thanks because you pushed me to continue and explore the possiblity of connecting PHP to PDMWorks.

  2. Ken
    November 3rd, 2011 at 10:03 | #2

    Thanks for the info. I am trying to play with PHP and EPDM, and I have ran into a bit of a problem. I am able to create the COM object, and I am able to check some basic things with the COM object, but I am unable to connect to my Vault (either using LoginWindowsUser or Login). My PHP page just hangs. With my VB and C# projects I had to define a Server and a Database to connect to in a DLL and then I could use the login. Do I need to do anything similar in PHP? Do you have any more examples or websites that I could read up on with PHP and EPDM?

    • Louis-Philippe Huberdeau
      November 3rd, 2011 at 11:11 | #3

      Sadly, this is all the information I have. Since writing this post, I have been moving around quite a bit and no longer use PDMWorks. From what I can remember, I never had an issue calling methods once the COM object was created.

      I wish I could help more.

  1. No trackbacks yet.