Пример #1
0
 public function copy()
 {
     // create cache folder
     $cacheFolder = Ifw::$app->getAlias('@cache') . DIRECTORY_SEPARATOR . $this->getSourceFolderHash();
     if (!file_exists($cacheFolder)) {
         mkdir($cacheFolder, 0775);
     }
     FileHelper::copyr($this->sourceFolder, $cacheFolder);
 }
Пример #2
0
 public function actionIndex()
 {
     foreach (Ifw::$app->getModules() as $id => $module) {
         $module = Ifw::$app->getModule($id);
         //print_r($module);
         $files = \ifw\helpers\FileHelper::readdir($module->getBasePath() . DIRECTORY_SEPARATOR . 'tables');
         foreach ($files as $file) {
             echo "compare: " . $file['file'] . PHP_EOL;
             $class = pathinfo($file['name'], PATHINFO_FILENAME);
             try {
                 require_once $file['file'];
                 $obj = new $class();
                 $obj->compare();
             } catch (\Exception $e) {
                 echo "error:" . $e->getMessage() . PHP_EOL;
             }
         }
     }
 }