本文整理汇总了PHP中fs::run方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::run方法的具体用法?PHP fs::run怎么用?PHP fs::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs
的用法示例。
在下文中一共展示了fs::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fs
if (isset($_POST['operation'])) {
// $fs /var/www/test/aqfaridi/
$fs = new fs(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'users' . DIRECTORY_SEPARATOR . 'guest' . DIRECTORY_SEPARATOR);
try {
$rslt = null;
switch ($_POST['operation']) {
case 'code_run':
$timelimit = $_POST['tl'];
$lang = $_POST['lang'];
$access = $_POST['access'];
$input = $_POST['stdin'];
$data = $_POST['sdata'];
$fname = $_POST['fname'];
$ext = $_POST['ext'];
$rslt = $fs->save($data, $fname, $ext);
$rslt = $fs->run($timelimit, $lang, $access, $input, $fname, $ext);
break;
default:
throw new Exception('Unsupported operation: ' . $_GET['operation']);
break;
}
header('Content-Type: application/json; charset=utf8');
echo json_encode($rslt);
} catch (Exception $e) {
header($_SERVER["SERVER_PROTOCOL"] . ' 500 Server Error');
header('Status: 500 Server Error');
echo $e->getMessage();
}
die;
}
if (isset($_POST['aqf'])) {
示例2: isset
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
$rslt = $fs->move($node, $parn);
break;
case 'copy_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
$rslt = $fs->copy($node, $parn);
break;
case 'code_run':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$timelimit = $_GET['tl'];
$lang = $_GET['lang'];
$access = $_GET['access'];
$input = $_GET['stdin'];
$rslt = $fs->run($node, $timelimit, $lang, $access, $input);
break;
case 'download_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$rslt = $fs->download($node);
break;
case 'logout':
logout();
break;
default:
throw new Exception('Unsupported operation: ' . $_GET['operation']);
break;
}
header('Content-Type: application/json; charset=utf8');
//json_encode — Returns the JSON representation of a value
//$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5)