php-epp-client icon indicating copy to clipboard operation
php-epp-client copied to clipboard

support all RFC5731 status fields from EPP schema

Open MikeAT opened this issue 1 year ago • 0 comments
trafficstars

This PR adds support for all status fields (name, language and message) from RFC5731 :

   <!--
   Status is a combination of attributes and an optional
   human-readable message that may be expressed in languages other
   than English.
   -->
   <complexType name="statusType">
    <simpleContent>
      <extension base="normalizedString">
        <attribute name="s" type="domain:statusValueType"
         use="required"/>
        <attribute name="lang" type="language"
         default="en"/>
      </extension>
    </simpleContent>
   </complexType>

To set a status with a message, create a eppStatus object:

$domain->addStatus(new eppStatus(eppDomain::STATUS_CLIENT_HOLD,'en','Payment overdue.'));

setting the status as string still works to not break any running implementations:

$domain->addStatus(eppDomain::STATUS_CLIENT_HOLD);

To receive the status objects on a domain set the parameter $fullobjects=true on the getStatuses-method.

   foreach ($d->getStatuses(true) as $status) {
            echo "  ".$status->getStatusname()." " .$status->getMessage()."\n";
        }

if not set or set to false, the statuses are returned as an array of strings like in the current implementation.

MikeAT avatar Sep 20 '24 10:09 MikeAT