<?php
class server {
function server($timeout=30) {
set_time_limit($timeout);
$this->ScriptTimeout = $timeout;
}
//--------------------
// Properties:
//--------------------
public $ScriptTimeout;
//--------------------
// Methods:
//--------------------
public function CreateObject($object) {
$object = str_replace('.', '___', $object); // FIXME: Needs a proper parser
if(!class_exists($object, false))
return new COM(str_replace('___', '.', $object));
$args = null;
$num = 0;
if($num > 1) {
$args = func_get_arg(2);
$i = 2;
for($i=2; $i<$num; $i++) {
if($i == 2) break;
$args .= ", " . func_get_arg($i);
}
}
if(!$args) { $code = $object . '();'; }
else { $code = $object . '(' . $args . ');'; }
// return @eval('new ' . $code);
return new eval($code);
}
public function Execute($path) {
include($path); // TODO: May not work
}
public function GetLastError() {
return error_get_last(); // TODO: Implement ASPError (ASPError.php)
}
public function HTMLEncode($string) { // Simple and effective
return htmlspecialchars($string);
}
public function MapPath($path) { /* TODO */ }
public function Transfer($path) { /* TODO */ }
public function URLEncode($url) {
return urlencode($url);
}
}
?>