Esempio n. 1
0
 /**
  * Looks in the designated updates location for all directories, ascertains what
  * version they represent, and finds all versions greater than the currently installed version of
  * concrete5.
  *
  * @return ApplicationUpdate[]
  */
 public function getLocalAvailableUpdates()
 {
     $fh = Core::make('helper/file');
     $updates = [];
     $contents = @$fh->getDirectoryContents(DIR_CORE_UPDATES);
     foreach ($contents as $con) {
         if (is_dir(DIR_CORE_UPDATES . '/' . $con)) {
             $obj = ApplicationUpdate::get($con);
             if (is_object($obj)) {
                 if (version_compare($obj->getUpdateVersion(), APP_VERSION, '>')) {
                     $updates[] = $obj;
                 }
             }
         }
     }
     usort($updates, function ($a, $b) {
         return version_compare($a->getUpdateVersion(), $b->getUpdateVersion());
     });
     return $updates;
 }