concrete/src/Package/PackageService.php
public function getAvailablePackages($onlyNotInstalled = true)
    {
        $dh = $this->application->make('helper/file');
        $packages = $dh->getDirectoryContents(DIR_PACKAGES);
        if ($onlyNotInstalled) {
            $handles = $this->getInstalledHandles();
            $packages = array_diff($packages, $handles);
        }

        if (count($packages) > 0) {
            $packagesTemp = [];
            // get package objects from the file system
            foreach ($packages as $p) {
                if (file_exists(DIR_PACKAGES . '/' . $p . '/' . FILENAME_CONTROLLER)) {
                    $pkg = $this->getClass($p);
                    if (!empty($pkg)) {
                        $packagesTemp[] = $pkg;
                    }
                }
            }
            $packages = $packagesTemp;
        }

        return $packages;
    }
public function getAvailablePackages($onlyNotInstalled = true)
    {
        $dh = $this->application->make('helper/file');
        $packages = $dh->getDirectoryContents(DIR_PACKAGES);
        if ($onlyNotInstalled) {
            $handles = $this->getInstalledHandles();
            $packages = array_diff($packages, $handles);
        }

        if (count($packages) > 0) {
            $packagesTemp = [];
            // get package objects from the file system
            foreach ($packages as $p) {
                if (file_exists(DIR_PACKAGES . '/' . $p . '/' . FILENAME_CONTROLLER)) {
                    $pkg = $this->getClass($p);
                    if (!empty($pkg)) {
                        $packagesTemp[] = $pkg;
                    }
                }
            }
            $packages = $packagesTemp;
        }

        return $packages;
    }
public function getAvailablePackages ( $ onlyNotInstalled = true ) { $ dh = $ this -> application -> make ( 'helper/file' ) ; $ packages = $ dh -> getDirectoryContents ( DIR_PACKAGES ) ; if ( $ onlyNotInstalled ) { $ handles = $ this -> getInstalledHandles ( ) ; $ packages = array_diff ( $ packages , $ handles ) ; } if ( count ( $ packages ) > 0 ) { $ packagesTemp = [ ] ; // get package objects from the file system foreach ( $ packages as $ p ) { if ( file_exists ( DIR_PACKAGES . '/' . $ p . '/' . FILENAME_CONTROLLER ) ) { $ pkg = $ this -> getClass ( $ p ) ; if ( ! empty ( $ pkg ) ) { $ packagesTemp [ ] = $ pkg ; } } } $ packages = $ packagesTemp ; } return $ packages ; }
Get the package controllers of the available packages.

@param bool $onlyNotInstalled true to get the controllers of not installed packages, false to get all the package controllers

@return \Concrete\Core\Package\Package[]
Get the package controllers of the available packages .