PHP code example of leehootools / yii2-leehoo-yctools

1. Go to this page and download the library: Download leehootools/yii2-leehoo-yctools 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/ */

    

leehootools / yii2-leehoo-yctools example snippets


<?= 
'data' => [
            'class' => 'app\modules\data\Module',
            'on beforeAction' => function (yii\base\ActionEvent $event) {
                \leehooyctools\ResponseLog::initClass();
            },
            'on afterAction' => function ($event) {
                \leehooyctools\ResponseLog::getClass()->saveIn();
            }
        ]

namespace leehooyctools\config;

class Connection
{
       //配置用户Mysql表连接
    const USER_DB_CONNENCT = [
        'dsn' => 'mysql:host=127.0.0.1:9963;dbname=webapp',
        'username' => 'root',
        'password' => '',
        'charset' => 'utf8mb4'
    ];
    
    //配置用户Redis连接
    const USER_REDIS_CONNENCT = [
        'hostname'=>'127.0.0.1',
        'port'=>6379,
        'database'=>0
    ];
}

\leehooyctools\user\UserAuth::createUserAuthByOpenid('o-QfV6Byn1KWCsxA-q0uXqN6VSKs','walPluginAdv',1670000000,'微信识别朋友圈转发,自动授权');

php composer.phar