本文整理汇总了PHP中getFilesPath函数的典型用法代码示例。如果您正苦于以下问题:PHP getFilesPath函数的具体用法?PHP getFilesPath怎么用?PHP getFilesPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getFilesPath函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
return array('files' => $files, 'dirs' => $dirs);
}
function GetDirs($path, $type)
{
$ret = $sort = array();
$files = listDirectory(fixPath($path), 0);
foreach ($files as $f) {
$fullPath = $path . '/' . $f;
if (!is_dir(fixPath($fullPath)) || $f == '.' || $f == '..') {
continue;
}
$tmp = getFilesNumber(fixPath($fullPath), $type);
$ret[$fullPath] = array('path' => $fullPath, 'files' => $tmp['files'], 'dirs' => $tmp['dirs']);
$sort[$fullPath] = $f;
}
natcasesort($sort);
foreach ($sort as $k => $v) {
$tmp = $ret[$k];
echo ',{"p":"' . mb_ereg_replace('"', '\\"', $tmp['path']) . '","f":"' . $tmp['files'] . '","d":"' . $tmp['dirs'] . '"}';
GetDirs($tmp['path'], $type);
}
}
$type = empty($_GET['type']) ? '' : strtolower($_GET['type']);
if ($type != 'image' && $type != 'flash') {
$type = '';
}
echo "[\n";
$tmp = getFilesNumber(fixPath(getFilesPath()), $type);
echo '{"p":"' . mb_ereg_replace('"', '\\"', getFilesPath()) . '","f":"' . $tmp['files'] . '","d":"' . $tmp['dirs'] . '"}';
GetDirs(getFilesPath(), $type);
echo "\n]";
示例2: checkPath
function checkPath($path){
$ret = false;
if(mb_strpos($path.'/', getFilesPath()) === 0)
$ret = true;
return $ret;
}
示例3: liubo
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('UPLOAD');
checkAccess('UPLOAD');
$path = trim(empty($_POST['d']) ? getFilesPath() : $_POST['d']);
verifyPath($path);
$res = '';
if (is_dir(fixPath($path))) {
if (!empty($_FILES['files']) && is_array($_FILES['files']['tmp_name'])) {
$errors = $errorsExt = array();
foreach ($_FILES['files']['tmp_name'] as $k => $v) {
$filename = $_FILES['files']['name'][$k];
$filename = RoxyFile::MakeUniqueFilename(fixPath($path), $filename);
$filePath = fixPath($path) . '/' . $filename;
if (!RoxyFile::CanUploadFile($filename)) {
$errorsExt[] = $filename;
} elseif (!move_uploaded_file($v, $filePath)) {
$errors[] = $filename;
}
if (is_file($filePath)) {
示例4: liubo
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('FILESLIST');
checkAccess('FILESLIST');
$path = empty($_GET['d']) ? getFilesPath() : $_GET['d'];
$type = empty($_GET['type']) ? '' : strtolower($_GET['type']);
if ($type != 'image' && $type != 'flash') {
$type = '';
}
verifyPath($path);
$files = listDirectory(fixPath($path), 0);
natcasesort($files);
$str = '';
echo '[';
foreach ($files as $f) {
$fullPath = $path . '/' . $f;
if (!is_file(fixPath($fullPath)) || $type == 'image' && !RoxyFile::IsImage($f) || $type == 'flash' && !RoxyFile::IsFlash($f)) {
continue;
}
$size = filesize(fixPath($fullPath));
示例5: liubo
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('COPYFILE');
checkAccess('COPYFILE');
$path = trim(empty($_POST['f']) ? '' : $_POST['f']);
$newPath = trim(empty($_POST['n']) ? '' : $_POST['n']);
if (!$newPath) {
$newPath = getFilesPath();
}
verifyPath($path);
verifyPath($newPath);
if (is_file(fixPath($path))) {
$newPath = $newPath . '/' . RoxyFile::MakeUniqueFilename(fixPath($newPath), basename($path));
if (copy(fixPath($path), fixPath($newPath))) {
echo getSuccessRes();
} else {
echo getErrorRes(t('E_CopyFile'));
}
} else {
echo getErrorRes(t('E_CopyFileInvalisPath'));
}
示例6: liubo
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('FILESLIST');
checkAccess('FILESLIST');
$path = empty($_POST['d']) ? getFilesPath() : $_POST['d'];
$type = empty($_POST['type']) ? '' : strtolower($_POST['type']);
if ($type != 'image' && $type != 'flash') {
$type = '';
}
verifyPath($path);
$files = listDirectory(fixPath($path), 0);
natcasesort($files);
$str = '';
echo '[';
foreach ($files as $f) {
$fullPath = $path . '/' . $f;
if (!is_file(fixPath($fullPath)) || $type == 'image' && !RoxyFile::IsImage($f) || $type == 'flash' && !RoxyFile::IsFlash($f)) {
continue;
}
$size = filesize(fixPath($fullPath));
示例7: liubo
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('RENAMEDIR');
checkAccess('RENAMEDIR');
$path = trim(empty($_POST['d']) ? '' : $_POST['d']);
$name = trim(empty($_POST['n']) ? '' : $_POST['n']);
verifyPath($path);
if (is_dir(fixPath($path))) {
if (fixPath($path . '/') == fixPath(getFilesPath() . '/')) {
echo getErrorRes(t('E_CannotRenameRoot'));
} elseif (rename(fixPath($path), dirname(fixPath($path)) . '/' . $name)) {
echo getSuccessRes();
} else {
echo getErrorRes(t('E_RenameDir') . ' ' . basename($path));
}
} else {
echo getErrorRes(t('E_RenameDirInvalidPath'));
}