Beispiel #1
0
 /**
  * @param string $cacheDir
  * @return array
  * @throws \Exception
  */
 protected function getInstalledPackages($cacheDir)
 {
     $file = new \Composer\Json\JsonFile($cacheDir . '/composer/installed.json');
     if (!$file->exists()) {
         throw new \Exception('no packages installed in repository');
     }
     $packages = $file->read();
     usort($packages, function ($a, $b) {
         return strnatcasecmp($a['name'], $b['name']);
     });
     return $packages;
 }