Download the PHP package liuchang103/hyperf-facade without Composer

On this page you can find all versions of the php package liuchang103/hyperf-facade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hyperf-facade

hyperf-facade

Hyperf 门面组件,借鉴 Laravel Facade,不仅能节省依赖注入,还能在各种条件下拿到单例和容器

安装

引入包

使用

创建门面

直接返回类名,将会在 Hyperf 的容器中直接获取

下面将创建一个 Redis 门面

门面返回实例

门面静态使用

可使用在 Facade 静态调用对应方法

获取DI容器

在条件苛刻的流程中,想要拿到容器得再引入 Hyperf 工具类,在已引入的 Facade 中,即可获取

门面别名

当 Facade 需要起别名时,可用注解方式

使用别名

注:Alias 注解可作用其它类

短生命周期

以上门面代理的都会是长生命周期对象,如果想用门面使用短生命周期并且自动依赖注入,请看示例

使用门面时

同样使用静态调用

当类需要传入参数

长短生命周期测试

更好的区分应该在何时用单例模式

服务类

长生命周期

单例模式

短生命周期

使用门面时,同等 new 了一次


All versions of hyperf-facade with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-swoole Version >=4.5
hyperf/framework Version 2.*
hyperf/di Version 2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package liuchang103/hyperf-facade contains the following files

Loading the files please wait ....