Exemplo n.º 1
0
<?php

set_time_limit(10);
include __DIR__ . '/Exception.php';
include __DIR__ . '/Base.php';
include __DIR__ . '/Tracker.php';
include __DIR__ . '/Storage.php';
$time_start = microtime(TRUE);
$tracker_addr = '192.168.199.199';
$tracker_port = 22122;
$tracker = new FastDFS\Tracker($tracker_addr, $tracker_port);
$storage_info = $tracker->applyStorage('group1');
var_dump($storage_info);
$group_name = 'group1';
$file_path = 'M00/00/02/wKjHx1UfghGAR9nbAAAMbKlxZXc835.jpg';
$appender_file_path = 'M00/00/00/CgAABVFc8duEOo6HAAAAAD1cKVQ817.txt';
$storage = new FastDFS\Storage($storage_info['storage_addr'], $storage_info['storage_port']);
var_dump($storage->deleteFile($group_name, $file_path));
$time_end = microtime(TRUE);
printf("[内存最终使用: %.2fMB]\r\n", memory_get_usage() / 1024 / 1024);
printf("[内存最高使用: %.2fMB]\r\n", memory_get_peak_usage() / 1024 / 1024);
printf("[页面执行时间: %.2f毫秒]\r\n", ($time_end - $time_start) * 1000);