Esempio n. 1
0
 /**
  * Удаление временной папки
  *
  * @param $clusterFileUniqSrc
  * @return bool|mixed
  */
 public function deleteTmpDir($clusterFileUniqSrc)
 {
     $dir = new Dir($this->rootTmpDir($clusterFileUniqSrc), false);
     if ($dir->isExist()) {
         $dir->remove();
     }
     return true;
 }
Esempio n. 2
0
 /**
  * @return CheckComponent[]
  */
 public function loadChecksComponents()
 {
     $result = [];
     $dir = new Dir($this->basePath . "/" . static::CHECKS_DIR_NAME);
     if ($dir->isExist()) {
         if ($files = $dir->findFiles()) {
             foreach ($files as $file) {
                 $className = $this->checkNamespace . "\\" . $file->getFileName();
                 if (class_exists($className)) {
                     $component = new $className();
                     if (is_subclass_of($component, CheckComponent::className())) {
                         $result[$component->className()] = $component;
                     }
                 }
             }
         }
     }
     return $result;
 }