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 // Previously, Almanac services stored a "serviceClass". Migrate these to // new "s..

Decoded Output download

<?php

// Previously, Almanac services stored a "serviceClass". Migrate these to
// new "serviceType" values.

$table = new AlmanacService();
$conn_w = $table->establishConnection('w');

foreach (new LiskMigrationIterator($table) as $service) {

  $new_type = null;
  try {
    $old_type = $service->getServiceType();
    $object = newv($old_type, array());
    $new_type = $object->getServiceTypeConstant();
  } catch (Exception $ex) {
    continue;
  }

  if (!$new_type) {
    continue;
  }

  queryfx(
    $conn_w,
    'UPDATE %T SET serviceType = %s WHERE id = %d',
    $table->getTableName(),
    $new_type,
    $service->getID());
}
 ?>

Did this file decode correctly?

Original Code

<?php

// Previously, Almanac services stored a "serviceClass". Migrate these to
// new "serviceType" values.

$table = new AlmanacService();
$conn_w = $table->establishConnection('w');

foreach (new LiskMigrationIterator($table) as $service) {

  $new_type = null;
  try {
    $old_type = $service->getServiceType();
    $object = newv($old_type, array());
    $new_type = $object->getServiceTypeConstant();
  } catch (Exception $ex) {
    continue;
  }

  if (!$new_type) {
    continue;
  }

  queryfx(
    $conn_w,
    'UPDATE %T SET serviceType = %s WHERE id = %d',
    $table->getTableName(),
    $new_type,
    $service->getID());
}

Function Calls

None

Variables

None

Stats

MD5 fcd021602de70191fe05d1c73ebcb0db
Eval Count 0
Decode Time 73 ms