Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jumbie on August 15, 2010, 07:39:52 pm

Title: COM object EA.Repository calling from PHP?
Post by: jumbie on August 15, 2010, 07:39:52 pm
I want to create object EA.Repository from PHP with “new COM” syntax:
$rep = new COM("EA.Repository");
No success = no answer from browser.
The same problem with command:
com_load_typelib("EA.Repository");
I have local web server on the same machine as EA. The other COM objects like “ADO.Connection” are working well.
Is it possible to connect EA from PHP and how? Thanks for answers!
Title: Re: COM object EA.Repository calling from PHP?
Post by: Eve on August 16, 2010, 08:20:59 am
I suspect your problem that whatever user your PHP script is running under doesn't have license details set up for EA.
Title: Re: COM object EA.Repository calling from PHP?
Post by: jumbie on August 16, 2010, 04:47:50 pm
Thanks for answer, but without solution.

The script in VBS file on my machine

Set rep = CreateObject("EA.Repository")
rep.Openfile("C:\eatemp\test.eap")
Msgbox rep.models.count
rep.ShowWindow 1
msgbox "Opened"


is working good.

I have my intranet local web server installed on the same machine as EA. If the problem is in license details, how can I solve this problem and create object in PHP?
Is it possible?
Thanks for answers!
Title: Re: COM object EA.Repository calling from PHP?
Post by: beginner on August 16, 2010, 06:18:23 pm
Well, I connect from Perl and that works like a charm. Maybe you fiddle around a bit with the COM call and try to open "easier" objects like notepad. Can't really help further since my PHP background is all Linux.

b.
Title: Re: COM object EA.Repository calling from PHP?
Post by: jumbie on August 16, 2010, 08:17:33 pm
beginner, thanks, but as I said, the other COM objects like “ADO.Connection” are working well... :)
Title: Re: COM object EA.Repository calling from PHP?
Post by: beginner on August 16, 2010, 10:49:42 pm
Hmm. The ability to read brings an obvious advantage.

Now, as said my background in PHP is Linux, where it could be a security problem. Don't know what Windoze is like.

b.
Title: Re: COM object EA.Repository calling from PHP?
Post by: Eve on August 17, 2010, 08:15:31 am
As I said, your PHP code will likely be running under a different user from the one you log in to.  That user will not have license details set up, so the COM object will not be able to create.  When you run vbscript you are still running as the same user.