PHP code example of gioco-plus / prism-plus

1. Go to this page and download the library: Download gioco-plus/prism-plus library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gioco-plus / prism-plus example snippets


php bin/hyperf.php vendor:publish "gioco-plus/prism-plus"

# 依赖注入

/**
 * 快取
 * @Inject()
 * @var CacheService
 */
protected $cache;

/**
 * 清除快取
 * @Inject()
 * @var CacheFlushService
 */
protected $cacheFlush;


# 配置MongoDb連線

/**
 * @Inject()
 * @var DbManager
 */
protected $dbManger;

# 使用
$this->dbManger->opMongoDb('gf')->insert("hyperf_test", [
    'aaa'=>'a',
    'bbb'=>'b',
    'ccc'=>'c'
]);

# 獲取Config
$this->config->get("mongodb.{$confName}");

composer /hyperf.php vendor:publish "gioco-plus/prism-const"