PHP Classes

File: test/ssa/toEndTest/run.php

Recommend this page to a friend!
  Classes of thomas   SSA   test/ssa/toEndTest/run.php   Download  
File: test/ssa/toEndTest/run.php
Role: Example script
Content type: text/plain
Description: Example script
Class: SSA
Call PHP classes from JavaScript on Web pages
Author: By
Last change:
Date: 9 years ago
Size: 693 bytes
 

Contents

Class file image Download
<?php

include 'serviceConfig.php';

use
ssa\runner\ServiceRunner;
use
ssa\Configuration;

try {
    list(
$service, $action) = explode('.', $_POST['service']);
   
$serviceRunner = new ServiceRunner($service);
    echo
$serviceRunner->runAction($action, array_merge($_POST, $_FILES));
} catch (
Exception $ex) {
   
header('Content-type: text/json');
    echo
json_encode(array(
       
'class' => get_class($ex),
       
'errorCode' => $ex->getCode(),
       
'errorMessage' => $ex->getMessage(),
       
'errorFile' => $ex->getFile(),
       
'errorLine' => $ex->getLine(),
       
'errorTrace' => $ex->getTraceAsString(),
       
'debug' => Configuration::getInstance()->getDebug()
    ));
}