• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP open_file函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中open_file函数的典型用法代码示例。如果您正苦于以下问题:PHP open_file函数的具体用法?PHP open_file怎么用?PHP open_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了open_file函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_inff_dir

function get_inff_dir($dirpath)
{
    $rarr = null;
    // массив , необходимые индексы для которого и выясеняет данная функция читая их из файла
    $str = "";
    // строка в которую будет помещаться имя каждого тэга считанного из текстового файла
    if ($rarr = scandir($dirpath)) {
        array_flip($rarr);
        foreach ($rarr as $key => $value) {
            $rarr[$key] = array("dfg" => "fds");
        }
        $isinfo = FALSE;
    }
    $fdata = open_file($path, "r");
    while (!feof($fdata)) {
        $simb = fgetc($fdata);
        // читаем файл посимвольно.
        if ($simb != "\r" && $simb != "\n") {
            $str = $str . $simb;
        } else {
            if ($simb == "\r") {
                $rarr[$str] = null;
                $str = "";
            }
        }
    }
    return $rarr;
}
开发者ID:laiello,项目名称:world-shared-folders,代码行数:28,代码来源:parser_lib.php


示例2: add_txt

function add_txt($file, $name, $uid, $textassoc = null, $start = 0, $end = 0)
{
    // open the file
    $filestr = open_file($file);
    // =========== GENERALIZE THIS PLZ =======================================
    // arrayify the text into canonical array form
    $acanon = str_to_array($filestr, "[^a-zA-Z0-9_\\s]");
    // get the hash of the text
    $hash = count_words($acanon);
    // get counts of uniques, hapax, ...
    $counts = get_counts($hash);
    // get a unique text hash to be used as location data
    $thash = file_id($uid, $name, $filestr);
    // must build aarray to send to db add function
    $data['name'] = $name;
    $data['words'] = $hash;
    $data['user'] = $uid;
    $data['counts'] = $counts;
    $data['start'] = $start;
    $data['end'] = $end ? $end : $counts['total'] - 1;
    $data['assoc'] = $textassoc;
    $data['canon'] = $filestr;
    $data['hash'] = $thash;
    // call the add function in MODQUERY and retrive the text_id
    $tid = add_text_to_db($data);
    return $tid;
}
开发者ID:raffled,项目名称:Lexomics,代码行数:27,代码来源:counter.php


示例3: notify

 public function notify()
 {
     $data['post'] = $_POST;
     $data['get'] = $_GET;
     $data['env'] = $_ENV;
     $data['requst'] = $_REQUEST;
     open_file($data, 'wxpay');
 }
开发者ID:976112643,项目名称:manor,代码行数:8,代码来源:WxpayController.class.php


示例4: tfile_to_str

function tfile_to_str($path)
{
    $str = "";
    $fdata = open_file($path, "r");
    while (!feof($fdata)) {
        $simb = fgetc($fdata);
        // read file charecter by character
        $str = $str . $simb;
    }
    // по окончании этого цикла в переменной $str мы размещаем всё содержимое файла метаинформации.
    return $str;
}
开发者ID:laiello,项目名称:world-shared-folders,代码行数:12,代码来源:common_lib.php


示例5: getScanStation

 public function getScanStation()
 {
     include "functions.php";
     include "../../../config/config.php";
     $data = open_file("/usr/share/fruitywifi/logs/dhcp.leases");
     $out = explode("\n", $data);
     $leases = [];
     for ($i = 0; $i < count($out); $i++) {
         $temp = explode(" ", $out[$i]);
         $leases[$temp[1]] = array($temp[2], $temp[3]);
     }
     unset($out);
     unset($data);
     $exec = "iw dev {$io_in_iface} station dump | sed -e 's/^\\t/|/g' | tr '\\n' ' ' | sed -e 's/Sta/\\nSta/g' | tr '\\t' ' '";
     $out = exec_fruitywifi($exec);
     $output = [];
     for ($i = 0; $i < count($out); $i++) {
         $station = [];
         $temp = explode("|", $out[$i]);
         if ($temp[0] != "") {
             foreach ($temp as &$value) {
                 unset($sub);
                 if (strpos($value, 'Station ') !== false) {
                     $value = str_replace("Station ", "", $value);
                     $value = explode(" ", $value);
                     $mac = $value[0];
                     $value = "station: " . $value[0];
                     $key_mac = $value[0];
                 }
                 $sub = explode(": ", $value);
                 //$station[] = $sub;
                 //$station[] = array($sub[0] => $sub[1]);
                 $station[$sub[0]] = $sub[1];
             }
             if (array_key_exists($mac, $leases)) {
                 //$station[] = array("ip" => $leases[$mac][0]);
                 //$station[] = array("hostname" => $leases[$mac][1]);
                 $station["ip"] = $leases[$mac][0];
                 $station["hostname"] = $leases[$mac][1];
             } else {
                 //$station[] = array("ip" => "");
                 //$station[] = array("hostname" => "");
                 $station["ip"] = "";
                 $station["hostname"] = "";
             }
             //$output[] = $station;
             $output[] = $station;
         }
     }
     echo json_encode($output);
 }
开发者ID:xtr4nge,项目名称:module_ap,代码行数:51,代码来源:ws.php


示例6: index

function index($datapath, $dbpath)
{
    // Create or open the database we're going to be writing to.
    $db = new XapianWritableDatabase($dbpath, Xapian::DB_CREATE_OR_OPEN);
    // Set up a TermGenerator that we'll use in indexing
    $termgenerator = new XapianTermGenerator();
    $termgenerator->set_stemmer(new XapianStem('en'));
    // open the file
    $fH = open_file($datapath);
    //    Read the header row in
    $headers = get_csv_headers($fH);
    while (($row = parse_csv_row($fH, $headers)) !== false) {
        // mapping from field name to value using first row headers
        // We're just going to use id_NUMBER, TITLE and DESCRIPTION
        $description = $row['DESCRIPTION'];
        $title = $row['TITLE'];
        $identifier = $row['id_NUMBER'];
        $collection = $row['COLLECTION'];
        $maker = $row['MAKER'];
        // we make a document and tell the term generator to use this
        $doc = new XapianDocument();
        $termgenerator->set_document($doc);
        // index each field with a suitable prefix
        $termgenerator->index_text($title, 1, 'S');
        $termgenerator->index_text($description, 1, 'XD');
        // index fields without prefixes for general search
        $termgenerator->index_text($title);
        $termgenerator->increase_termpos();
        $termgenerator->index_text($description);
        ### Start of new indexing code.
        // index the MATERIALS field, splitting on semicolons
        $materials = explode(";", $row['MATERIALS']);
        foreach ($materials as $material) {
            $material = strtolower(trim($material));
            if ($material != '') {
                $doc->add_boolean_term('XM' . $material);
            }
        }
        ### End of new indexing code.
        // store all the fields for display purposes
        $doc->set_data(json_encode($row));
        // we use the identifier to ensure each object ends up
        // in the database only once no matter how many times
        // we run the indexer
        $idterm = "Q" . $identifier;
        $doc->add_term($idterm);
        $db->replace_document($idterm, $doc);
    }
}
开发者ID:Averroes,项目名称:xapian-docsprint,代码行数:49,代码来源:index_filters.php


示例7: scanRecon

 public function scanRecon()
 {
     //include "functions.php";
     $exec = "python scan-recon.py -i mon0 ";
     //$out = exec_fruitywifi($exec);
     $data = open_file("/usr/share/fruitywifi/logs/wifirecon.log");
     $out = explode("\n", $data);
     $output = [];
     for ($i = 0; $i < count($out); $i++) {
         $ap = [];
         $temp = explode(",", $out[$i]);
         //if ($temp[0] != "")
         //{
         foreach ($temp as &$value) {
             $ap[] = $value;
         }
         $output[] = $ap;
         //}
     }
     echo json_encode($output);
 }
开发者ID:xtr4nge,项目名称:module_wifirecon,代码行数:21,代码来源:ws.php


示例8: index

function index($datapath, $dbpath)
{
    // Create or open the database we're going to be writing to.
    $db = new XapianWritableDatabase($dbpath, Xapian::DB_CREATE_OR_OPEN);
    // Set up a TermGenerator that we'll use in indexing.
    $termgenerator = new XapianTermGenerator();
    $termgenerator->set_stemmer(new XapianStem('english'));
    // Open the file.
    $fH = open_file($datapath);
    // Read the header row in.
    $headers = get_csv_headers($fH);
    while (($row = parse_csv_row($fH, $headers)) !== false) {
        // '$row' maps field name to value.  The field names come from the
        // first row of the CSV file.
        //
        // We're just going to use DESCRIPTION, TITLE and id_NUMBER.
        $description = $row['DESCRIPTION'];
        $title = $row['TITLE'];
        $identifier = $row['id_NUMBER'];
        // We make a document and tell the term generator to use this.
        $doc = new XapianDocument();
        $termgenerator->set_document($doc);
        // Index each field with a suitable prefix.
        $termgenerator->index_text($title, 1, 'S');
        $termgenerator->index_text($description, 1, 'XD');
        // Index fields without prefixes for general search.
        $termgenerator->index_text($title);
        $termgenerator->increase_termpos();
        $termgenerator->index_text($description);
        // Store all the fields for display purposes.
        $doc->set_data(json_encode($row));
        // We use the identifier to ensure each object ends up in the
        // database only once no matter how many times we run the
        // indexer.
        $idterm = "Q" . $identifier;
        $doc->add_boolean_term($idterm);
        $db->replace_document($idterm, $doc);
    }
}
开发者ID:ankitkumr10,项目名称:xapian-docsprint,代码行数:39,代码来源:index1.php


示例9: foreach

    $tab_directive = $dom->get_elements_by_tagname('directive');
    foreach ($tab_directive as $lign) {
        if ($lign->get_attribute('id') == $dir_id) {
            $directive = $lign;
        }
    }
    $parent = $directive->parent_node();
    $parent->remove_child($directive);
    $dom->dump_file($file);
    release_file($file);
    echo "<html><body onload=\"window.open('../index.php','main')\"></body></html>";
} elseif ($query == "add_directive") {
    $cat_id = $_GET['id'];
    $category = get_category_by_id($cat_id);
    $XML_FILE = "/etc/ossim/server/" . $category->xml_file;
    $dom = open_file($XML_FILE);
    $id = new_directive_id($category->id);
    $null = NULL;
    $node = $dom->create_element('directive');
    $node->set_attribute('id', $id);
    $node->set_attribute('name', "New directive");
    $node->set_attribute('priority', "0");
    $directive = new Directive($id, "New directive", "0", $null, $node);
    $_SESSION['directive'] = serialize($directive);
    release_file($XML_FILE);
    echo "<html><body onload=\"window.open('../right.php?directive=" . $id . "&level=1&action=edit_dir&id=" . $id . "','right')\"></body></html>";
} elseif ($query == "save_category") {
    $file = '/etc/ossim/server/categories.xml';
    if (!($dom = domxml_open_file($file, DOMXML_LOAD_SUBSTITUTE_ENTITIES))) {
        echo _("Error while parsing the document") . "\n";
        exit;
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:utils.php


示例10: check_server

}
$continue = check_server();
if ($continue === true) {
    print_log("Server OK");
    $continue = record_count();
    if ($continue === true) {
        print_log("Record count {$total_count}");
        $continue = open_file();
        if ($continue === true) {
            print_log("Output file {$current_outfile}");
            while ($this_count <= $total_count && $continue === true) {
                print_log('start:' . $this_count . ' get:' . $get_count . ' wait:' . $wait_time);
                if ($record_count >= $file_split && $file_split > 0) {
                    $chunk_count++;
                    close_file();
                    open_file();
                    print_log("Output chunk file {$current_outfile}");
                    $record_count = 0;
                }
                $start_time = time();
                $continue = get_records();
                $this_count += $get_count;
                $end_time = time();
                $time_dif = $end_time - $start_time;
                if ($time_dif >= $wait_min && $time_dif <= $wait_max) {
                    $wait_time = $time_dif;
                    $wait_time += $wait_add;
                    if ($get_count < $get_max) {
                        $get_count += $get_add;
                    }
                }
开发者ID:nws-cip,项目名称:capture-helpers,代码行数:31,代码来源:capture_get.php


示例11: basename

}
// 4. checks if file was uploaded and uploads file
if (count($_FILES) > 0 && $_FILES['file1']['error'] == 0) {
    //4a. checks if uploaded file is text
    if ($_FILES['file1']['type'] == 'text/plain') {
        //4b. if file is text type
        // Set the destination directory for uploads
        $upload_dir = '/vagrant/sites/todo.dev/public/uploads/';
        // Grab the filename from the uploaded file by using basename
        $filename_up = basename($_FILES['file1']['name']);
        // Create the saved filename using the file's original name and our upload directory
        $saved_filename = $upload_dir . $filename_up;
        // Move the file from the temp location to our uploads directory
        move_uploaded_file($_FILES['file1']['tmp_name'], $saved_filename);
        //4c. merges uploaded file with existing file
        $string_to_add = open_file($saved_filename);
        $array_to_add = explode("\n", $string_to_add);
        $list_array = array_merge($list_array, $array_to_add);
    } else {
        echo "File type must be TXT";
        echo '<script type="text/javascript">alert("type must be txt"); </script>';
    }
}
//6. converts array to string for saving to file
$contents = implode("\n", $list_array);
save_file($filename, $contents);
?>

<html>
<head>
	<title>My HTML todo list</title>
开发者ID:genarogarzajr,项目名称:codeup.dev,代码行数:31,代码来源:todo_list.php


示例12: array

<?php

require 'person_class.php';
require 'overwrite_file_function.php';
require 'open_file_function.php';
$people = array(new student("Mark", "Weiser", 21, 120.65), new student("Alice", "Karl", 20, 200.122), new employee("Jony", "White", 25, 12.522), new student("Ida", "Red", 22, 40.98), new employee("June", "Greed", 18, 70));
overwrite_file();
$arrlength = count($people);
for ($x = 0; $x < $arrlength; $x++) {
    $text = $people[$x]->get_title() . ", " . $people[$x]->get_name() . ", " . $people[$x]->get_surname() . ", " . $people[$x]->get_age() . ", " . $people[$x]->get_balance() . "\n";
    open_file($text);
}
echo "<pre>";
echo file_get_contents("data.txt");
echo "<pre>";
开发者ID:Dre90,项目名称:Web2,代码行数:15,代码来源:index.php


示例13: extract_data

function extract_data($short)
{
    $xml_str = open_file($short);
    $reader = new XMLReader();
    if (!$reader->open($xml_str)) {
        die("Failed to open First Folio");
    }
    $mei = array();
    $num_items = 0;
    $pid = 1;
    $act = 0;
    $scene = 0;
    $line = 0;
    $play = '';
    $person = array();
    $id = $name = '';
    $pers = '';
    $sex = '';
    $role = '';
    while ($reader->read()) {
        if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'person') {
            $id = $reader->getAttribute('xml:id');
            $sex = $reader->getAttribute('sex');
            $role = $reader->getAttribute('role');
            $pid++;
        }
        if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'persName') {
            if ($reader->getAttribute('type') == "standard") {
                $pers = $reader->readString();
            }
        }
        if ($id) {
            $person[$id] = array('xmlid' => $id, 'name' => $pers, 'snid' => $pid, 'sex' => $sex, 'role' => $role);
        }
        // parse the play sections
        if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'div') {
            $divtype = $reader->getAttribute('type');
            if ($divtype == 'act') {
                $act = $reader->getAttribute('n');
                array_push($mei, struct($act, $scene, $divtype, 10 + $act, '', '', ''));
            }
            if ($divtype == 'scene') {
                $scene = $reader->getAttribute('n');
                array_push($mei, struct($act, $scene, $divtype, 50 + $scene, '', '', ''));
            }
        }
        if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'sp') {
            $speaker = substr($reader->getAttribute('who'), 1);
        }
        if ($reader->nodeType == XMLReader::ELEMENT && ($reader->name == 'l' || $reader->name == 'p')) {
            $play = 60 + $person[$speaker]['snid'];
            $rhyme = $reader->getAttribute('rhyme');
            $ln = $reader->getAttribute('n');
            if ($play > 60) {
                array_push($mei, struct($act, $scene, $reader->name, $play, $speaker, $rhyme, $ln));
            }
        }
        // get the types of stage direction
        if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'stage') {
            $type = $reader->getAttribute('type');
            if ($type == 'entrance') {
                array_push($mei, struct($act, $scene, $reader->name, 101, '', '', ''));
            } else {
                if ($type == 'exit') {
                    array_push($mei, struct($act, $scene, $reader->name, 102, '', '', ''));
                } else {
                    if ($type == 'setting') {
                        array_push($mei, struct($act, $scene, $reader->name, 103, '', '', ''));
                    } else {
                        if ($type == 'business') {
                            array_push($mei, struct($act, $scene, $reader->name, 104, '', '', ''));
                        } else {
                            array_push($mei, struct($act, $scene, $reader->name, 105, '', '', ''));
                        }
                    }
                }
            }
        }
    }
    $reader->close();
    return $person;
}
开发者ID:iaine,项目名称:meiscripts,代码行数:82,代码来源:meitransform.php


示例14: open_file

        
        <!-- OUTPUT -->

        <div id="result-1">
            
			<div>
				<form id="formLogs-Refresh" name="formLogs-Refresh" method="POST" autocomplete="off" action="index.php">
					<input type="submit" value="refresh">
					<br><br>
					<?php 
if ($logfile != "" and $action == "view") {
    $filename = $mod_logs_history . $logfile . ".log";
} else {
    $filename = $mod_logs;
}
$data = open_file($filename);
// REVERSE
$data_array = explode("\n", $data);
$data = implode("\n", array_reverse($data_array));
?>
					<textarea id="output" class="module-content" style="font-family: courier;"><?php 
echo htmlspecialchars($data);
?>
</textarea>
					<input type="hidden" name="type" value="logs">
				</form>
		
			</div>
            
        </div>
	
开发者ID:xtr4nge,项目名称:module_openvpn,代码行数:29,代码来源:index.php


示例15: save_file

}
if ($r_act == "eval") {
    echo "<td alling=\"center\"><input type=radio checked name=\"r_act\" value=\"eval\"><b>Eval</b></td>";
} else {
    echo "<td alling=\"center\"><input type=radio name=\"r_act\" value=\"eval\"><b>Eval</b></td>";
}
echo "<td><input type=submit name=\"b_act\" value=\"Change\"></td></tr></table></form>";
################## ACTION ######################################################
if ($r_act == "nav" or $r_act == NULL) {
    $box = $_POST['box'];
    if ($_POST['b_save']) {
        $res = save_file($_POST['text'], $_POST['fname'], $_POST['dname']);
    } elseif ($_POST['b_new_file']) {
        open_file($_POST['new'], "wb", $_POST['dname']);
    } elseif ($_POST['b_open_file']) {
        open_file($_POST['fname'], "r", $_POST['dname']);
    } elseif ($_POST['b_mail']) {
        $res = "Function under construction!!!!!!!!!";
    } elseif ($_POST['b_run']) {
        chdir($_POST['wdir']);
        $dir = getcwd();
        $res = ex($_POST['cmd']);
    } elseif ($_POST['b_f_file']) {
        chdir($_POST['wdir']);
        $dir = getcwd();
        $res = ex("whereis " . $_POST['ffile']);
    } elseif ($_POST['b_upload']) {
        $s = "Uploading file " . $_POST['lfilename'] . " use the " . $box;
        $res = up_file($_POST['lfilename'], $_POST['tfilename'], $_POST['box']);
    } elseif ($_POST['b_mydb']) {
        //Выводим список БД
开发者ID:Theov,项目名称:webshells,代码行数:31,代码来源:gfs_sh.php


示例16: base64_decode

$cssPath		= '../../../template/css/';
$css 			= base64_decode(getValue("css","str","GET","fdsfds.fsd"));
$action 		= getValue("action","str","POST","");
$content 	= getValue("content","str","POST","");
$filename 	= $cssPath . $css;
if(file_exists($filename)){
	if($action == 'save'){
	   $filename = str_replace(".bak","",$filename);
		if(!file_exists($filename . ".bak")){
			@copy($filename,$filename . ".bak");
			chmod($filename . ".bak",777);
		}
		 write_file($filename,htmlspecialchars($content));
		 redirect("editcss.php");
	}
	$content = open_file($filename);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php 
echo $load_header;
?>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<? /*------------------------------------------------------------------------------------------------*/ ?>
<?php 
echo template_top(translate_text("Configuration"));
?>
开发者ID:nhphong0104,项目名称:thietkeweb360,代码行数:31,代码来源:editcss.php


示例17: sql

function sql()
{
    global $sqlaction, $sv_s, $sv_d, $drp_tbl, $g_fp, $file_type, $dbbase, $f_nm;
    $secu_config = "xtdump_conf.inc.php";
    $dbhost = $_POST['dbhost'];
    $dbuser = $_POST['dbuser'];
    $dbpass = $_POST['dbpass'];
    $dbbase = $_POST['dbbase'];
    $tbls = $_POST['tbls'];
    $sqlaction = $_POST['sqlaction'];
    $secu = $_POST['secu'];
    $f_cut = $_POST['f_cut'];
    $max_sql = $_POST['max_sql'];
    $opt = $_POST['opt'];
    $savmode = $_POST['savmode'];
    $file_type = $_POST['file_type'];
    $ecraz = $_POST['ecraz'];
    $f_tbl = $_POST['f_tbl'];
    $drp_tbl = $_POST['drp_tbl'];
    $header = "<center><table width=620 cellpadding=0 cellspacing=0 align=center><col width=1><col width=600><col width=1><tr><td></td><td align=left class=texte><br>";
    $footer = "<center><a href='javascript:history.go(-1)' target='_self' class=link>-назад-</a><br></center><br></td><td></td></tr><tr><td height=1 colspan=3></td></tr></table></center>" . nfm_copyright();
    // SQL actions STARTS
    if ($sqlaction == 'save') {
        if ($secu == 1) {
            $fp = fopen($secu_config, "w");
            fputs($fp, "<?php\n");
            fputs($fp, "\$dbhost='{$dbhost}';\n");
            fputs($fp, "\$dbbase='{$dbbase}';\n");
            fputs($fp, "\$dbuser='{$dbuser}';\n");
            fputs($fp, "\$dbpass='{$dbpass}';\n");
            fputs($fp, "?>");
            fclose($fp);
        }
        if (!is_array($tbls)) {
            echo $header . "\r\n<br><center><font color=red>ТЫ ЗАБЫЛ выделить нужные тебе таблицы для дампинга =)</b></font></center>\n{$footer}";
            exit;
        }
        if ($f_cut == 1) {
            if (!is_numeric($max_sql)) {
                echo $header . "<br><center><font color=red><b>Ошибка.</b></font></center>\n{$footer}";
                exit;
            }
            if ($max_sql < 200000) {
                echo $header . "<br><center><font color=red><b>база sql больше 200 000 мб</b></font></center>\n{$footer}";
                exit;
            }
        }
        $tbl = array();
        $tbl[] = reset($tbls);
        if (count($tbls) > 1) {
            $a = true;
            while ($a != false) {
                $a = next($tbls);
                if ($a != false) {
                    $tbl[] = $a;
                }
            }
        }
        if ($opt == 1) {
            $sv_s = true;
            $sv_d = true;
        } else {
            if ($opt == 2) {
                $sv_s = true;
                $sv_d = false;
                $fc = "_struct";
            } else {
                if ($opt == 3) {
                    $sv_s = false;
                    $sv_d = true;
                    $fc = "_data";
                } else {
                    exit;
                }
            }
        }
        $fext = "." . $savmode;
        $fich = $dbbase . $fc . $fext;
        $dte = "";
        if ($ecraz != 1) {
            $dte = date("dMy_Hi") . "_";
        }
        $gz = "";
        if ($file_type == '1') {
            $gz .= ".gz";
        }
        $fcut = false;
        $ftbl = false;
        $f_nm = array();
        if ($f_cut == 1) {
            $fcut = true;
            $max_sql = $max_sql;
            $nbf = 1;
            $f_size = 170;
        }
        if ($f_tbl == 1) {
            $ftbl = true;
        } else {
            if (!$fcut) {
                open_file("dump_" . $dte . $dbbase . $fc . $fext . $gz);
//.........这里部分代码省略.........
开发者ID:Theov,项目名称:webshells,代码行数:101,代码来源:NFM+1.8.php


示例18: empty

    }
    $folder = empty($folder) || $folder == '@root' ? '' : $folder;
}
if (empty($action)) {
    stdhead();
    echo "<h2>Open a php file</h2><br />";
    showdir_files();
    stdfoot();
} elseif ($action == 'edit') {
    if (!file_exists($path . $file)) {
        stderr("Error...", "File does not exists.");
    }
    stdhead();
    begin_main_frame("Editing file: <a href=\"" . (!empty($_folder) ? $folder : '') . $file . "\" alt=\"" . $file . "\" target=_blank title=\"" . $path . $file . "\">" . $file . "</a>" . (file_exists($path . $file . $backup_extension) ? "(click <a href=\"" . $_SERVER['PHP_SELF'] . "?action=restore&filename=" . $file . (!empty($_folder) ? '&folder=' . $_folder : '') . "\">here</a> to restore, or <a href=\"" . $_SERVER['PHP_SELF'] . "?action=deletebkp&filename=" . $file . (!empty($_folder) ? '&folder=' . $_folder : '') . "\">here</a> to delete the backup file.)" : ''));
    begin_frame("", 1);
    $data = open_file($file);
    echo "<form action=\"" . $_SERVER['PHP_SELF'] . "?action=save\" method=\"post\"><textarea name=\"data\" rows=\"50\" cols=\"150\">" . safeChar($data) . "</textarea><input type=\"hidden\" name=\"filename\" value=\"" . $file . "\">" . (!empty($_folder) ? "<input type=\"hidden\" name=\"folder\" value=\"" . $_folder . "\">" : '') . "<div align=\"center\"><input type=\"submit\" value=\"Save File\"></div></form>";
    end_frame();
    ?>
<br /><div align=center><h2>Edit another file</h2><?php 
    showdir_files();
    ?>
</div><?php 
    end_main_frame();
    stdfoot();
} elseif ($action == 'save') {
    if (empty($_POST['data'])) {
        stderr('Error...', 'File cannot be empty.');
    }
    write_file($_POST['data'], $file);
    header("Location: " . $_SERVER['PHP_SELF'] . "?action=edit&filename=" . $file . (!empty($_folder) ? '&folder=' . $_folder : ''));
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:editfiles.php


示例19: open_file

/**
 * 新建文件并写入内容,
 * 功能说明,
 * 		判断一个文件是否存在,不存在则创建,存在则创建文件名为定义的文件名后面加1,
 * 		如(文件名为:file,如果该文件存在,则创建file1,如果file1存在则创建file2...以此类推)
 * @param string $a				需要写入文件中的内容
 * @param string $b				文件名(不带后缀)
 * @param int $c				创建的文件后面的数字后缀从哪一个数字开始
 * @param string $d				文件的后缀名(不需要带".",默认为'txt'后缀)
 * @author						李东
 * @date						2015-06-03
 */
function open_file($a, $b, $c = '', $d = 'txt')
{
    @($open = fopen($b . $c . '.' . $d, 'r'));
    if ($open) {
        if (intval($c)) {
            $c++;
        } else {
            $c = 1;
        }
        open_file($a, $b, $c, $d);
    } else {
        $file = fopen($b . $c . '.' . $d, 'w');
        $str = fwrite($file, "<?php \n" . var_export($a, TRUE) . "\n ?>");
        fclose($file);
    }
}
开发者ID:976112643,项目名称:manor,代码行数:28,代码来源:function.php


示例20: Directive

    $node->set_attribute('priority', "0");
    $directive = new Directive($id, "New directive", "0", $null, $node);
    $_SESSION['directive'] = serialize($directive);
    release_file($XML_FILE);
    echo "<html><body onload=\"window.open('../right.php?add=1&directive=" . $id . "&level=1&action=edit_dir&id=" . $id . "&onlydir={$onlydir}&xml_file=" . $category->xml_file . "','right')\"></body></html>";
} elseif ($query == "copy_directive") {
    $dir_id = $_GET['id'];
    if ($_GET['directive_xml'] != "") {
        $file = "/etc/ossim/server/" . $_GET['directive_xml'];
    } elseif ($_SESSION['XML_FILE'] != "") {
        $file = $_SESSION['XML_FILE'];
    } else {
        $file = get_directive_file($dir_id);
    }
    $id_category = get_category_id_by_directive_id($dir_id);
    $dom = open_file($file);
    $directive = getDirectiveFromXML($dom, $dir_id);
    if ($directive->directive == "") {
        header("Location: ../viewer/index.php?directive={$dir_id}");
    }
    $mini = $_GET['mini'];
    $new_id = new_directive_id_by_directive_file($file, $mini);
    //$new_id = new_directive_id($id_category);
    $new_directive = $dom->create_element('directive');
    $new_directive->set_attribute('id', $new_id);
    $new_directive->set_attribute('name', "Copy of " . $directive->name);
    $new_directive->set_attribute('priority', $directive->priority);
    $tab_rules = $directive->rules;
    for ($ind = 1; $ind <= count($tab_rules); $ind++) {
        $rule = $tab_rules[$ind];
        list($id_dir, $id_rule, $id_father) = explode("-", $rule->id);
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:utils.php



注:本文中的open_file函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP open_form函数代码示例发布时间:2022-05-15
下一篇:
PHP open_database_connection函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap