background image

php 静态文件类生成代码:

<?php
class html
{
    var $dir; //dir for the htmls(www.ite5e.com)
    var $rootdir; //root of html files(www.ite5e.com):html
    var $name; //html 文件存放路径
    var $dirname; //指定的文件夹名称
    var $url; //获取 html 文件信息的来源网页地址
    var $time; //html 文件信息填加时的时间
    var $dirtype; //目录存放方式:year,month,,,,
    var $nametype; //html 文件命名方式:name
   
   
    function html($nametype = ‘name’, $dirtype = ‘year’, $rootdir = ‘html’)
    {
        $this -> setvar($nametype, $dirtype, $rootdir);
        }
   
    function setvar($nametype = ‘name’, $dirtype = ‘year’, $rootdir = ‘html’)
    {
        $this -> rootdir = $rootdir;
        $this -> dirtype = $dirtype;
        $this -> nametype = $nametype;
        }
   
    function createdir($dir = ”)
    {
        $this -> dir = $dir?$dir:$this -> dir;
       
        if (!is_dir($this -> dir))
            {
            $temp = explode(‘/’, $this -> dir);
            $cur_dir = ”;
            for($i = 0;$i < count($temp);$i )
            {
                $cur_dir .= $temp[$i] . ‘/’;
                if (!is_dir($cur_dir))