public function __construct(){ parent::__construct(); //在config里设置不起作用,估计哪里有bug,暂时不去深究 $this->_viewsHome = ROOT_DIR.'/sbin/views/'; $this->cola_db = $this->model('Tag')->db(); $this->logFilePath = ROOT_DIR.'/sbin/sitemap_last_time.log'; $this->sitemap_path = ROOT_DIR.'/sites/wwwroot/sitemaps'; //检测 $this->sitemap_path是否存在,不存在的话创建 if(!file_exists($this->sitemap_path)){ mkdir($this->sitemap_path); } // 参数-d 或者 --delta, -p = push, -g = generate sitemap $options = getopt("dpg", array('delta')); if(isset($options['d']) || isset($options['delta'])){ $this->delta = true; } if(isset($options['g'])){ $this->generate = true; } if(isset($options['p'])){ $this->push = true; } $this->currentTime = time(); //打开文件或创建文件,并读取上次生成到的time $this->openLog(); // 读取目录下 格式为 sitemap_%d.xml的文件,取得最大的那个index, 作为此次生成文件的基准; //如果想重新生成所有,需要删除目录下的所有sitemap文件 // 可以用参数控制 $this->setCurrentIndex(); }
public function __construct() { parent::__construct(); $this->cola_db = $this->model('Tag')->db(); $this->logFilePath = ROOT_DIR . '/sbin/pic_id.log'; $this->logHandler = fopen($this->logFilePath, 'r+'); $this->api_base = base64_encode($this->api_key . ":" . $this->api_secret); }
public function __construct() { parent::__construct(); //在config里设置不起作用,估计哪里有bug,暂时不去深究 $this->_viewsHome = ROOT_DIR . '/sbin/views/'; $this->cola_db = $this->model('Tag')->db(); $this->logFilePath = ROOT_DIR . '/sbin/sitemap_pic_id.log'; $this->sitemap_path = ROOT_DIR . '/sites/wwwroot/sitemaps'; //检测 $this->sitemap_path是否存在,不存在的话创建 if (!file_exists($this->sitemap_path)) { mkdir($this->sitemap_path); } //打开文件或创建文件,并读取上次生成到的id $this->openLog(); // 读取目录下 格式为 sitemap_\d.xml的文件,取得最大的那个index, 作为此次生成文件的基准; //如果想重新生成所有,需要删除目录下的所有sitemap文件 // TODO 可以用参数控制 $this->setLastIndex(); }
public function __construct($arg = null) { parent::__construct(); $this->_arg = $arg; }