metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
214 stars 160 forks source link

Factory instead => have to include params file #27

Closed kg00 closed 8 years ago

kg00 commented 8 years ago

Hi When using the new factory instead of creating object, we have to include the path to config/settings file. Is this a deliberate change? I liked it better not having to include the path everywhere since it made it easier to handle changes in path later on.

Earlier (and as it is still in __construct) the default was to use settings.ini in the actual folder (Registries/iisEppConnection in our test case), but now we get "File not found" when trying to use :

if ($this->eppconn = Metaregistrar\EPP\iisEppConnection::create('')) {

if we do not include the path to the file.

Is this something you will change to not having to include it in the create call so it works as earlier?

Thank you

kg00 commented 8 years ago

Just to update, even if I enter the correct path to the settings.ini -file in the call on create, it will not work. I get "ERROR: Error writing content " (and it seems the destruction of the connections is not done)

edit: The error is in login

metaregistrar commented 8 years ago

You do not have to use the new factory, it is still possible to create connections the 'old' way.

The old way to create would be $conn = new Metaregistrar\EPP\iisEppConnection();

In that case you do not have to specify the path, but you cannot use the ::create() factory.

Please note that for an iisEppConnection you will also need a valid certificate file.

My settings.ini looks like this: interface=iisEppConnection hostname=epp.iis.se port=700 userid=xxxxxxxxx password=xxxxx certificatefile=xxxxxx.pem certificatepassword=xxxxxxx

kg00 commented 8 years ago

The old one works fine. But when using the factory, it does not work. It gives error at login for some odd reason (writing error). Nothing changed except using ::create and including path to settings.ini

We do use certificates and the old connection works fine and we can create contacts, domains etc.

metaregistrar commented 8 years ago

Ok, i shall test old and new way of connecting and fix the issues there.

metaregistrar commented 8 years ago

I have fixed your problem. In the settings.ini you can specify a certificate path.

if there is no / or \ in the certificate path, the system will assume the cerificate file is in Registries/iisEppConnection

If you specify a full path in the certificate path, so you can store your certificate in a safe location, then the path to Registries/iisEppConnection is not added to the path.

So my recommendations: