Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php abstract class AlmanacSearchEngineAttachment extends PhabricatorSearchEngineAttac..

Decoded Output download

<?php

abstract class AlmanacSearchEngineAttachment
  extends PhabricatorSearchEngineAttachment {

  protected function getAlmanacPropertyList($object) {
    $builtins = $object->getAlmanacPropertyFieldSpecifications();

    $properties = array();
    foreach ($object->getAlmanacProperties() as $key => $property) {
      $is_builtin = isset($builtins[$key]);

      $properties[] = array(
        'key' => $key,
        'value' => $property->getFieldValue(),
        'builtin' => $is_builtin,
      );
    }

    return $properties;
  }

  protected function getAlmanacBindingDictionary(AlmanacBinding $binding) {
    $interface = $binding->getInterface();

    return array(
      'id' => (int)$binding->getID(),
      'phid' => $binding->getPHID(),
      'properties' => $this->getAlmanacPropertyList($binding),
      'interface' => $this->getAlmanacInterfaceDictionary($interface),
      'disabled' => (bool)$binding->getIsDisabled(),
    );
  }

  protected function getAlmanacInterfaceDictionary(
    AlmanacInterface $interface) {

    return array(
      'id' => (int)$interface->getID(),
      'phid' => $interface->getPHID(),
      'address' => $interface->getAddress(),
      'port' => (int)$interface->getPort(),
      'device' => $this->getAlmanacDeviceDictionary($interface->getDevice()),
      'network' => $this->getAlmanacNetworkDictionary($interface->getNetwork()),
    );
  }

  protected function getAlmanacDeviceDictionary(AlmanacDevice $device) {
    return array(
      'id' => (int)$device->getID(),
      'phid' => $device->getPHID(),
      'name' => $device->getName(),
      'properties' => $this->getAlmanacPropertyList($device),
      'status' => $device->getStatus(),
      'disabled' => $device->isDisabled(),
    );
  }

  protected function getAlmanacNetworkDictionary(AlmanacNetwork $network) {
    return array(
      'id' => (int)$network->getID(),
      'phid' => $network->getPHID(),
      'name' => $network->getName(),
    );
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

abstract class AlmanacSearchEngineAttachment
  extends PhabricatorSearchEngineAttachment {

  protected function getAlmanacPropertyList($object) {
    $builtins = $object->getAlmanacPropertyFieldSpecifications();

    $properties = array();
    foreach ($object->getAlmanacProperties() as $key => $property) {
      $is_builtin = isset($builtins[$key]);

      $properties[] = array(
        'key' => $key,
        'value' => $property->getFieldValue(),
        'builtin' => $is_builtin,
      );
    }

    return $properties;
  }

  protected function getAlmanacBindingDictionary(AlmanacBinding $binding) {
    $interface = $binding->getInterface();

    return array(
      'id' => (int)$binding->getID(),
      'phid' => $binding->getPHID(),
      'properties' => $this->getAlmanacPropertyList($binding),
      'interface' => $this->getAlmanacInterfaceDictionary($interface),
      'disabled' => (bool)$binding->getIsDisabled(),
    );
  }

  protected function getAlmanacInterfaceDictionary(
    AlmanacInterface $interface) {

    return array(
      'id' => (int)$interface->getID(),
      'phid' => $interface->getPHID(),
      'address' => $interface->getAddress(),
      'port' => (int)$interface->getPort(),
      'device' => $this->getAlmanacDeviceDictionary($interface->getDevice()),
      'network' => $this->getAlmanacNetworkDictionary($interface->getNetwork()),
    );
  }

  protected function getAlmanacDeviceDictionary(AlmanacDevice $device) {
    return array(
      'id' => (int)$device->getID(),
      'phid' => $device->getPHID(),
      'name' => $device->getName(),
      'properties' => $this->getAlmanacPropertyList($device),
      'status' => $device->getStatus(),
      'disabled' => $device->isDisabled(),
    );
  }

  protected function getAlmanacNetworkDictionary(AlmanacNetwork $network) {
    return array(
      'id' => (int)$network->getID(),
      'phid' => $network->getPHID(),
      'name' => $network->getName(),
    );
  }

}

Function Calls

None

Variables

None

Stats

MD5 39f6347302df8102b50ca51ddd996ab6
Eval Count 0
Decode Time 101 ms