File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 11<?php
22define ('DEBUG ' , 'on ' );
3- define ("WEBPATH " , realpath (__DIR__ . '/../ ' ));
3+ define ('WEBPATH ' , __DIR__ );
4+ define ('ROOT_PATH ' , dirname (__DIR__ ));
5+
6+ if (is_file (ROOT_PATH .'/framework/libs/lib_config.php ' ))
7+ {
8+ require ROOT_PATH .'/framework/libs/lib_config.php ' ;
9+ }
10+ else
11+ {
12+ require_once ROOT_PATH .'/vendor/autoload.php ' ;
13+ Swoole \Loader::vendor_init ();
14+ }
415
5- require_once __DIR__ .'/../vendor/autoload.php ' ;
6- Swoole \Loader::vendor_init ();
716Swoole \Loader::addNameSpace ('WebIM ' , __DIR__ .'/src/ ' );
817Swoole::$ php ->config ->setPath (__DIR__ .'/apps/configs ' );
918
10- $ AppSvr = new Swoole \Protocol \HttpServer ();
11- $ AppSvr ->loadSetting (__DIR__ . ' /.. /swoole.ini ' ); //加载配置文件
19+ $ AppSvr = new Swoole \Protocol \AppServer ();
20+ $ AppSvr ->loadSetting (ROOT_PATH . ' /swoole.ini ' ); //加载配置文件
1221$ AppSvr ->setDocumentRoot (__DIR__ );
22+ $ AppSvr ->setAppPath (__DIR__ .'/apps/ ' );
1323$ AppSvr ->setLogger (new \Swoole \Log \EchoLog (true )); //Logger
1424
1525$ server = new \Swoole \Network \Server ('0.0.0.0 ' , 8888 );
You can’t perform that action at this time.
0 commit comments