App\Console\Commands\PluginMake::checkEnv PHP Method

checkEnv() protected method

protected checkEnv ( $path, $name, $namespace, $title )
    protected function checkEnv($path, $name, $namespace, $title)
    {
        // check directory exists
        if ($this->files->exists($path)) {
            $this->error('Plugin already exists!');
            return false;
        }
        // check namespace
        if (!str_contains($namespace, '\\')) {
            $this->error('The namespace must have at least 1 delimiter(\\), use double backslash(\\\\) as delimiter');
            return false;
        }
        // check permission
        $pluginsDir = app('xe.plugin')->getPluginsDir();
        if (!$this->files->isWritable($pluginsDir)) {
            $this->error("Permission denied. Can not create plugin directory({$path}).");
            return false;
        }
    }