當前位置: 首頁>>代碼示例>>PHP>>正文


PHP remove函數代碼示例

本文整理匯總了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);
}
開發者ID:BillTheBest,項目名稱:1.6.x,代碼行數:35,代碼來源:exec.nosslsearch.google.com.php

示例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();
 }
開發者ID:atomchind,項目名稱:card_collection,代碼行數:12,代碼來源:CollectionController.php

示例3: apply

 private function apply($file, $type)
 {
     require 'migration/' . $file;
     if ($type == 'remove') {
         remove();
     } else {
         install();
     }
     db()->update_migration->insert(array('id' => $file));
 }
開發者ID:AndreasWebdev,項目名稱:ivcms5,代碼行數:10,代碼來源:migration.php

示例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));
 }
開發者ID:masteriv,項目名稱:framework,代碼行數:11,代碼來源:Migration.php

示例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();
}
開發者ID:brucewu16899,項目名稱:1.6.x,代碼行數:14,代碼來源:exec.nosslsearch.google.com.php

示例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;
}
開發者ID:tarsana,項目名稱:io,代碼行數:15,代碼來源:bootstrap.php

示例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>";
}
開發者ID:Bleuh,項目名稱:Couple,代碼行數:17,代碼來源:score.php

示例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();
}
開發者ID:senyor,項目名稱:dojorama,代碼行數:18,代碼來源:index.php

示例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));
}
開發者ID:Zhi2014,項目名稱:cogs,代碼行數:44,代碼來源:fun_del.php

示例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));
}
開發者ID:morovan,項目名稱:granitpiestany.sk,代碼行數:44,代碼來源:fun_del.php

示例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;
 }
開發者ID:XQ-quadrant,項目名稱:gbCMS,代碼行數:43,代碼來源:SearchModel.class.php

示例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);
}
開發者ID:matruszkowski,項目名稱:uncon,代碼行數:19,代碼來源:clear_cache.php

示例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;
}
開發者ID:minhhien,項目名稱:pascal4fun,代碼行數:21,代碼來源:marksutil.php

示例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;
    }
}
開發者ID:chenyongze,項目名稱:m3d,代碼行數:22,代碼來源:m3d.php

示例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) {
開發者ID:asucrews,項目名稱:nostarchBot,代碼行數:31,代碼來源:SHDtest.php


注:本文中的remove函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。