# 1.easyswoole saas系统 **Repository Path**: caiwh/lzyPro ## Basic Information - **Project Name**: 1.easyswoole saas系统 - **Description**: easyswoole 项目--saas系统主要微商城(小程序+web+pc)+订单客服管理+进销存,admin.lp.wx1010.cn u:admin p:123456项目持续开发中。。。。 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2022-07-13 - **Last Updated**: 2022-07-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EASYSWOOLE lzyPro ## 如何运行DEMO 1.安装项目时请不要覆盖默认的配置文件以及EasySwooleEvent事件注册文件 ```bash git clone https://gitee.com/lzy_3001/lzyPro.git demo cd demo && composer install php vendor/bin/easyswoole install php easyswoole start ``` 2.配置nginx ```bash server { listen 80; server_name www.fa77.com; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_http_version 1.1; proxy_set_header Connection "keep-alive"; proxy_set_header X-Real-IP $remote_addr; if (!-f $request_filename) { proxy_pass http://127.0.0.1:9588; } } location ~ ^/static/(.*)$ { proxy_http_version 1.1; proxy_set_header Connection "keep-alive"; proxy_set_header X-Real-IP $remote_addr; if (!-f $request_filename) { proxy_pass http://www.fa77.com:8080; } } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } ``` 3.修改thinkphp 模板输入 ```bash /private/var/www/lzyPro/vendor/topthink/think-template/src/Template.php /** * 渲染模板文件 * @access public * @param string $template 模板文件 * @param array $vars 模板变量 * @return void */ public function fetch(string $template, array $vars = []): void { if ($vars) { $this->data = array_merge($this->data, $vars); } if (!empty($this->config['cache_id']) && $this->config['display_cache'] && $this->cache) { // 读取渲染缓存 if ($this->cache->has($this->config['cache_id'])) { echo $this->cache->get($this->config['cache_id']); return; } } $template = $this->parseTemplateFile($template); if ($template) { $cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($this->config['layout_on'] . $this->config['layout_name'] . $template) . '.' . ltrim($this->config['cache_suffix'], '.'); if (!$this->checkCache($cacheFile)) { // 缓存无效 重新模板编译 $content = file_get_contents($template); $this->compiler($content, $cacheFile); } // 页面缓存 ob_start(); ob_implicit_flush(0); // 读取编译存储 $this->storage->read($cacheFile, $this->data); // 获取并清空缓存 //$content = ob_get_clean(); --注释掉 if (!empty($this->config['cache_id']) && $this->config['display_cache'] && $this->cache) { // 缓存页面输出 $this->cache->set($this->config['cache_id'], $content, $this->config['cache_time']); } //echo $content;--注释掉 } } ```