This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 概述:一共三大部分配置。 | |
| # 其中#注释掉的可以在需要的时候开启并修改,没有注释掉的(除了下面location示例)不要删掉,基本都是必须的配置项。 | |
| ###############################第一部分 全局配置############################ | |
| #user nobody; 指定启动进程的用户,默认不用指定即可。 | |
| #error_log logs/error.log; 配置日志输出,虽然叫error_log但是可以定义输出的级别,默认不写是ERROR级别 | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; 记录pid的文件,默认就是放到这个位置,可以修改。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 直接赋值是全局变量一般不要这么使用 | |
| a = 10 | |
| -- local是指定当前作用域(一般指大括号或当前文件内)有效的变量 | |
| local a = 10 | |
| -- 数字 | |
| local b = 10.1 | |
| print(a + b) -- 打印20.1,支持常见的运算符以及位运算符 | |
| print(15 & (1<<2)) -- 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| use Hyperf\Di\Aop\AbstractAspect; | |
| use Hyperf\Di\Aop\ProceedingJoinPoint; | |
| use Hyperf\RpcClient\ServiceClient; | |
| use Psr\EventDispatcher\EventDispatcherInterface; | |
| class RPCAspect extends AbstractAspect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Providers; | |
| use App\Encrypter; | |
| use Illuminate\Support\Str; | |
| use Illuminate\Support\ServiceProvider; | |
| class AppServiceProvider extends ServiceProvider | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Source: http://goo.gl/qyLFbg | |
| $html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />'; | |
| preg_match( '@src="([^"]+)"@' , $html, $match ); | |
| $src = array_pop($match); | |
| // will return /images/image.jpg |