private function packageExists($slug, $package)
    {
        $path = Grav::instance()['locator']->findResource($package->package_type . '://' . $slug);
        Installer::isValidDestination($path);
        return Installer::lastErrorCode();
    }
private function packageExists($slug, $package)
    {
        $path = Grav::instance()['locator']->findResource($package->package_type . '://' . $slug);
        Installer::isValidDestination($path);
        return Installer::lastErrorCode();
    }
private function packageExists ( $ slug , $ package ) { $ path = Grav :: instance ( ) [ 'locator' ] -> findResource ( $ package -> package_type . '://' . $ slug ) ; Installer :: isValidDestination ( $ path ) ; return Installer :: lastErrorCode ( ) ; }
Check if package exists

@param string $slug
@param Package $package
@return int
Check if package exists