本文整理匯總了PHP中Archive::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Archive::all方法的具體用法?PHP Archive::all怎麽用?PHP Archive::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Archive
的用法示例。
在下文中一共展示了Archive::all方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: session_start
<?php
session_start();
require_once 'archive.php';
// $base_url = "http://127.0.0.1/devdesktop/archive/";
// $base_url = "http://127.0.0.1/devdesktop/archive/archivist/";
$method = $_SERVER['REQUEST_METHOD'];
$request = explode("/", substr(@$_SERVER['PATH_INFO'], 1));
// $request = @$_SERVER['PATH_INFO'];
// var_dump($request);
if (count($request) > 0) {
if ($method === 'GET') {
if ($request[0] === 'listar') {
array_key_exists('path', $_GET) ? $path = $_GET['path'] : ($path = null);
if (Archive::isFolder($path)) {
$reponse = ['type' => 'folder', 'data' => Archive::all($path)];
echo json_encode($reponse);
} else {
$reponse = ['type' => 'file', 'data' => Archive::open($path)];
echo json_encode($reponse);
}
}
if ($request[0] === 'folder') {
echo Archive::isFolder($_GET['url']);
}
} else {
if (isset($_POST) && $method === 'POST') {
if ($request[0] === 'store') {
if (count($_FILES) < 1) {
return "O campo arquivo não pode ser vazio.";
}