Author Topic: COM object EA.Repository calling from PHP?  (Read 5106 times)

jumbie

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
COM object EA.Repository calling from PHP?
« 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!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: COM object EA.Repository calling from PHP?
« Reply #1 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.

jumbie

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: COM object EA.Repository calling from PHP?
« Reply #2 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!

beginner

  • Guest
Re: COM object EA.Repository calling from PHP?
« Reply #3 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.

jumbie

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: COM object EA.Repository calling from PHP?
« Reply #4 on: August 16, 2010, 08:17:33 pm »
beginner, thanks, but as I said, the other COM objects like “ADO.Connection” are working well... :)

beginner

  • Guest
Re: COM object EA.Repository calling from PHP?
« Reply #5 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.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: COM object EA.Repository calling from PHP?
« Reply #6 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.