tp5.1 Env使用

5.1版本取消了所有的系统常量,原来的系统路径变量改为使用Env类获取(需要引入think\facade\Env)


 
  1. echo "app_path=========".Env::get('app_path')."</br>";

  2. echo "root_path=========".Env::get('root_path')."</br>";

  3. echo "think_path=========".Env::get('think_path')."</br>";

  4. echo "config_path=========".Env::get('config_path')."</br>";

  5. echo "extend_path=========".Env::get('extend_path')."</br>";

  6. echo "vendor_path=========".Env::get('vendor_path')."</br>";

  7. echo "runtime_path=========".Env::get('runtime_path')."</br>";

  8. echo "route_path=========".Env::get('route_path')."</br>";

  9. echo "module_path=========".Env::get('module_path')."</br>";


 
  1. app_path=========/home/wwwroot/default/citygame/dragonfly/app/

  2. root_path=========/home/wwwroot/default/citygame/dragonfly/

  3. think_path=========/home/wwwroot/default/citygame/dragonfly/thinkphp/

  4. config_path=========/home/wwwroot/default/citygame/dragonfly/config/

  5. extend_path=========/home/wwwroot/default/citygame/dragonfly/extend/

  6. vendor_path=========/home/wwwroot/default/citygame/dragonfly/vendor/

  7. runtime_path=========/home/wwwroot/default/citygame/dragonfly/runtime/

  8. route_path=========/home/wwwroot/default/citygame/dragonfly/route/

  9. module_path=========/home/wwwroot/default/citygame/dragonfly/app/admin/

没有账号? 忘记密码?

社交账号快速登录