[php]代码库
<?php
/*
*/
class be{
var $net=new Cnet;
var $novel=new Cnovel;
var $file=new Cfile;
}
class Cnet{
var $ch;
var $cookies;// =>no save
var $header;
function __construct(){
$ch=curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
}
function set_header($header){
curl_setopt($ch,CURLOPT_HEADER,$header);
}
function set_cookies($cookie_file){
curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie_file);
}
function send($url){
$response=curl_exec($ch);
return $response;
}
function __destruct(){
curl_close($ch);
}
}
Class Cfile{
function read($address){
file_get_contents($address);
}
function write($address,$txt){
$file = fopen($address,"w");
return fwrite($file,$txt);
fclose($file);
}
}
Class Cdb{
var $file;
function __construct(){
$file=new Cfile;
}
function read($c,$where)}
$file->read(Be_Root.Be_Data."/".,)
}
}