示例#1
0
 public function testReadableFile()
 {
     file_put_contents($this->getPath(), '');
     $fs = new DAO_FileSystem();
     $fs->chmod($this->getPath(), 0777);
     $validator = new ReadableFile($this->getPath());
     $this->assertTrue($validator->isValid());
 }
示例#2
0
 protected function loadConfigurationFile()
 {
     try {
         $sql = sprintf('truncate %s ', Job::TableName);
         DB::post($sql);
         $path = \Faid\Configure\Configure::read(self::ConfigureKey);
         $validator = new ReadableFile($path);
         if ($validator->isValid()) {
             include $path;
         }
         \CMSLog::addMessage(__CLASS__, 'Schedule restarted');
     } catch (\Exception $e) {
         \CMSLog::addMessage(__CLASS__, $e);
         return ['error' => 'internal error'];
     }
     return;
 }