在没有composer的情况下安装和发布Laravel包


Install and publish Laravel package without composer

我想使用这个包:https://github.com/lucadegasperi/oauth2-server-laravel/wiki/Installation用于在Laravel 中使用OAuth 2.0

我无法正确安装它。首先,我无法更新composer,所以我必须将"minimum-stability": "stable"更改为"minimum-stability": "dev"。通过更新composer,我的所有包都被替换为bij-dev版本。

其次,我不能通过在终端中键入以下命令来发布我的包:php artisan config:publish lucadegasperi/oauth2-server-laravel

我得到这个错误:

php artisan config:publish lucadegasperi/oauth2-server-laravel
{"error":{"type":"ErrorException","message":"file_put_contents('/Applications'/XAMPP'
/xamppfiles'/htdocs'/api-dashboardv2'/app'/storage'/meta'/services.json): failed to
open stream: Permission denied","file":"'/Applications'/XAMPP'/xamppfiles'/htdocs'
/api-dashboardv2'/vendor'/laravel'/framework'/src'/Illuminate'/Filesystem'
/Filesystem.php","line":69}}

我尝试了chmod -R 777 app,但无法更改应用程序上的文件模式。我正在使用XAMMP进行开发。

我可以在没有composer或其他东西的情况下安装和发布此软件包吗?

更新:

我现在得到以下错误:

PHP致命错误:类"League ''OAuth2''Server''Storage''Adapter"不是在中找到/Applications/XAMPP/examplefiles/htdocs/api-dashboardv2/vvendor/lucadegaperi/oauth2 server laravel/src/Storage/FluentAdapter.php在18号线上{"error":{"type":"Symfony''Component''Debug''Exception''FatalErrorException","message":"类'League ''OAuth2''Server''Storage''Adapter'不是found","file":"/Applications/XAMPP/examplefiles/htdocs/api-dashboardv2/vvendor/lucadegaperi/oauth2 server laravel/src/Storage/FluentAdapter.php","line":18}}

而且,是否可以将"minimum-stability": "dev"设置回'stable',并且只获取OAuth包的开发版本?

正如其他人所提到的,你应该按照文档中的描述授予它写权限

chmod -R 775 app/storage

请注意,775应该足够了。这里有一个很好的答案指出了区别。。。


关于composer.json 中的稳定性配置

您可以定义每个包装的稳定性!

"lucadegasperi/oauth2-server-laravel": "@dev"

Composer文档

更新

[错误在此期间已修复]

显然,有人刚刚对这个项目进行了一些修改,打破了一些东西。他们已经在尝试修复它…Github问题

您需要chmod -R 777 app/storage或足够的文件夹写入权限。当框架存储并写入文件夹中的文件夹时。文件确实在这里写道。

你尝试过吗:

chmod 777 app/storage/meta/services.json

它对我来说很容易