PHP code example of xiaoyun / supports

1. Go to this page and download the library: Download xiaoyun/supports 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/ */

    

xiaoyun / supports example snippets


use XiaoYun\Supports\Log;
use Monolog\Logger;

class APPLICATIONLOG extends Log
{
    /**
     * Make a default log instance.
     *
     * @author XiaoYun <[email protected]>
     *
     * @return Logger
     */
    public static function createLogger()
    {
        $handler = new StreamHandler('./log.log');
        $handler->setFormatter(new LineFormatter("%datetime% > %level_name% > %message% %context% %extra%\n\n"));

        $logger = new Logger('XiaoYun.private_number');
        $logger->pushHandler($handler);

        return $logger;
    }
}

use XiaoYun\Supports\Log;

protected function registerLog()
{
    $logger = Log::createLogger($file, $identify, $level);

    Log::setLogger($logger);
}

use XiaoYun\Supports\Log;

Log::debug('test', ['test log']);