本文整理汇总了PHP中remove函数的典型用法代码示例。如果您正苦于以下问题:PHP remove函数的具体用法?PHP remove怎么用?PHP remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
$ReplaceEntry = null;
$sock = new sockets();
$DisableGoogleSSL = intval($sock->GET_INFO("DisableGoogleSSL"));
$EnableGoogleSafeSearch = $sock->GET_INFO("EnableGoogleSafeSearch");
echo "Starting......: " . date("H:i:s") . " Squid : EnableGoogleSafeSearch = '{$EnableGoogleSafeSearch}'\n";
if (!is_numeric($EnableGoogleSafeSearch)) {
$EnableGoogleSafeSearch = 1;
}
echo "Starting......: " . date("H:i:s") . " Squid : DisableGoogleSSL = {$DisableGoogleSSL}\n";
echo "Starting......: " . date("H:i:s") . " Squid : EnableGoogleSafeSearch = {$EnableGoogleSafeSearch}\n";
if ($DisableGoogleSSL == 0) {
if ($EnableGoogleSafeSearch == 0) {
echo "Starting......: " . date("H:i:s") . " Squid : change google.com DNS (disabled)\n";
remove();
build_progress("{disabled}", 100);
return;
}
}
if ($DisableGoogleSSL == 1) {
$ReplaceEntry = "nosslsearch.google.com";
}
if ($EnableGoogleSafeSearch == 1) {
$ReplaceEntry = "forcesafesearch.google.com";
}
if ($ReplaceEntry == null) {
remove();
build_progress("{disabled}", 100);
return;
}
echo "Starting......: " . date("H:i:s") . " Squid : {$ReplaceEntry} (enabled)\n";
build_progress("{enabled}", 5);
addDNSGOOGLE($ReplaceEntry);
}
示例2: deleteCollectionEntryById
/**
*
* @param Request $request
* TODO ADD ROUTE, RESTRICT ACCESS
*/
public function deleteCollectionEntryById(Request $request)
{
$id = $request;
$collectionEntry = $this->entityManager->getRepository('AppBundle:Collection')->find($id);
$this->entityManager . remove($collectionEntry);
$this->entityManager . flush();
}
示例3: apply
private function apply($file, $type)
{
require 'migration/' . $file;
if ($type == 'remove') {
remove();
} else {
install();
}
db()->update_migration->insert(array('id' => $file));
}
示例4: apply
private function apply($file, $type)
{
require $this->dir . $file;
if ($type == 'remove') {
remove($this->db);
} else {
install($this->db);
}
$this->checkTable();
$this->db->migration->insert(array('id' => $file));
}
示例5: run
function run()
{
$sock = new sockets();
$DisableGoogleSSL = intval($sock->GET_INFO("DisableGoogleSSL"));
if ($DisableGoogleSSL == 0) {
echo "Starting......: " . date("H:i:s") . " Squid : nosslsearch.google.com (disabled)\n";
remove();
build_progress("{disabled}", 110);
return;
}
echo "Starting......: " . date("H:i:s") . " Squid : nosslsearch.google.com (enabled)\n";
build_progress("{enabled}", 5);
addDNSGOOGLE();
}
示例6: remove
function remove($path)
{
if (is_file($path)) {
return unlink($path);
}
if (is_dir($path)) {
$path = rtrim($path, '/');
$files = glob($path . '/*', GLOB_MARK);
foreach ($files as $file) {
remove($file);
}
return rmdir($path);
}
return false;
}
示例7: toString
function toString($score)
{
remove();
echo "<div class='style'>";
echo "<table>";
echo "<tr><th>Pseudo</th><th>Score</th></tr>";
foreach ($score as $element) {
echo "<tr>";
foreach ($element as $element2) {
echo "<td>";
echo $element2;
echo "</td>";
}
}
echo "</table>";
echo "</div>";
}
示例8: run
function run()
{
$method = strtolower($_SERVER["REQUEST_METHOD"]);
$id = ltrim($_SERVER["REQUEST_URI"], dirname($_SERVER["SCRIPT_NAME"]));
$id = $id !== '' ? $id : null;
$items = array(array('id' => 0, 'title' => 'Title 1', 'format' => 1, 'releaseDate' => '2012-12-21', 'price' => '100', 'publish' => false, 'info' => ''), array('id' => 1, 'title' => 'Title 2', 'format' => 1, 'releaseDate' => '2013-12-21', 'price' => '50', 'publish' => false, 'info' => ''), array('id' => 2, 'title' => 'Title 3', 'format' => 1, 'releaseDate' => '2014-12-21', 'price' => '1000', 'publish' => false, 'info' => ''));
switch ($method) {
case 'get':
return $id === null ? listing($items) : detail($id, $items);
case 'post':
return $id === null ? create() : badRequest();
case 'put':
return $id !== null ? update($id) : badRequest();
case 'delete':
return $id !== null ? remove($id) : badRequest();
}
return badRequest();
}
示例9: del_items
function del_items($dir)
{
// delete files/dirs
if (($GLOBALS["permissions"] & 01) != 01) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
$cnt = count($GLOBALS['__POST']["selitems"]);
$err = false;
// delete files & check for errors
for ($i = 0; $i < $cnt; ++$i) {
$items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$abs = get_abs_item($dir, $items[$i]);
if (!@file_exists(get_abs_item($dir, $items[$i]))) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $items[$i])) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
// Delete
$ok = remove(get_abs_item($dir, $items[$i]));
if ($ok === false) {
$error[$i] = $GLOBALS["error_msg"]["delitem"];
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
}
show_error($err_msg);
}
header("Location: " . make_link("list", $dir, NULL));
}
示例10: del_items
function del_items($dir)
{
// check if user is allowed to delete files
if (!permissions_grant($dir, NULL, "delete")) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
$cnt = count($GLOBALS['__POST']["selitems"]);
$err = false;
// delete files & check for errors
for ($i = 0; $i < $cnt; ++$i) {
$items[$i] = stripslashes($GLOBALS['__POST']["selitems"][$i]);
$abs = get_abs_item($dir, $items[$i]);
if (!@file_exists(get_abs_item($dir, $items[$i]))) {
$error[$i] = $GLOBALS["error_msg"]["itemexist"];
$err = true;
continue;
}
if (!get_show_item($dir, $items[$i])) {
$error[$i] = $GLOBALS["error_msg"]["accessitem"];
$err = true;
continue;
}
// Delete
$ok = remove(get_abs_item($dir, $items[$i]));
if ($ok === false) {
$error[$i] = $GLOBALS["error_msg"]["delitem"];
$err = true;
continue;
}
$error[$i] = NULL;
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; ++$i) {
if ($error[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n";
}
show_error($err_msg);
}
miwoftp_redirect(make_link("list", $dir, NULL));
}
示例11: getInfo
public function getInfo()
{
$rawInfo = self::getRaw($this->action, $this->ref, $this->data);
//import('SHD.simple_html_dom');
$infoArray = parse_array($rawInfo['FILE'], '<tr>', '</tr>');
$tr = [];
$this->page = end($infoArray);
foreach ($infoArray as $k => $v) {
$tb = parse_array($v, '<td', '</td>');
$temp = get_attribute($tb[7], 'href');
$temp = split_string($temp, 'proj_idDes=', AFTER, EXCL);
$tb[7] = remove($tb[7], '<a', '>');
$tb[7] = remove($tb[7], '</a', '>');
$temp2 = $tb[7];
$tb[7] = [];
$tb[7][] = $temp2;
$tb[7][] = $temp;
$temp4 = get_attribute($tb[8], 'href');
$temp4 = split_string($temp4, 'proj_idDes=', AFTER, EXCL);
$tb[8] = remove($tb[8], '<a', '>');
$tb[8] = remove($tb[8], '</a', '>');
$temp3 = $tb[8];
$tb[8] = [];
$tb[8][] = $temp3;
$tb[8][] = $temp4;
$tr[] = $tb;
//parse_array($v,'<td','</td>');
//var_dump($tr);
}
/*
[4]=> array(9) { [0]=> string(37) "3" [1]=> string(30) "信息" [2]=> string(49) "201510613089 " [3]=> string(78) "基于人体肢体语言的机械臂操控" [4]=> string(62) "15国家创新训练项目" [5]=> string(45) "张翠芳" [6]=> string(185) "20132235 刘炳楠
20132312 覃勇杰
20132230 李晓芳
20132169 涂敏
" [7]=> string(145) "查看 " [8]=> string(158) " 成果展" }
*/
/*$html=new simple_html_dom();
$html->load($rawInfo["FILE"]);
//var_dump($html);
//return $rawInfo;
$infoArray = $html->find('tr');*/
return $tr;
}
示例12: remove
function remove($path)
{
if (!file_exists($path)) {
return true;
}
if (is_file($path)) {
return unlink($path);
}
$d = dir($path);
while ($e = $d->read()) {
if ($e == '.' || $e == '..') {
continue;
}
$nPath = $path . '/' . $e;
remove($nPath);
}
$d->close();
return rmdir($path);
}
示例13: run_tests
function run_tests($filename, $test_cases)
{
$code2test = read_src_file($filename . '_4test.pas');
$count_pass = 0;
$result = array(count($test_cases));
foreach ($test_cases as $key => $value) {
$result[$key] = test_result($key, $filename, $code2test);
if ($result[$key] == $value) {
$count_pass++;
}
}
remove($filename);
//Xoa tep chuong trinh
remove($filename . '.o');
//Xoa tep lien ket bien dich
echo show_testing_result($test_cases, $result);
if ($count_pass == count($test_cases)) {
return true;
}
return false;
}
示例14: process
function process($argv)
{
if (!isset($argv[1])) {
displayHelp();
exit;
}
switch ($argv[1]) {
case 'install':
install();
break;
case 'add':
add($argv);
break;
case 'rm':
remove($argv);
break;
case 'help':
default:
displayHelp();
break;
}
}
示例15: foreach
foreach ($html->find('div.views-field-field-image-cache-fid') as $image) {
$books[$bookCount]['imageUrl'] = str_replace("www", "ftp", get_attribute($image->find('img', 0), 'src'));
$bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-title') as $title) {
$books[$bookCount]['title'] = trim($title->plaintext);
$links = $title->find('a');
foreach ($links as $link) {
$books[$bookCount]['pageUrl'] = resolve_address($link->href, $page_base);
}
$bookPage = http_get($books[$bookCount]['pageUrl'], $target);
$bookHTML = new simple_html_dom();
$bookHTML->load($bookPage['FILE']);
foreach ($bookHTML->find('div.product-body') as $summary) {
$books[$bookCount]['summary'] = remove($summary->outertext, '<img', '/>');
}
$bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-field-author-value') as $author) {
$books[$bookCount]['author'] = trim($author->plaintext);
$bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-field-isbn13-value') as $isbn13) {
$books[$bookCount]['ISBN13'] = trim($isbn13->plaintext);
$bookCount++;
}
$bookCount = 0;
foreach ($html->find('div.views-field-field-released-value') as $releasedDate) {