|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
-
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
- namespace common\helpers;
-
- use yii ;
-
- class Url
- {
- public static function frontend()
- {
- $server_name = Yii::$app->getRequest()->serverName ;
- if($server_name == 'localhost')
- {
- return 'http://localhost/reservation_pain/frontend/web/' ;
- }
- elseif($server_name == 'www.laboiteapain.net' ||
- $server_name == 'boulanger.laboiteapain.net')
- {
- return 'http://www.laboiteapain.net/' ;
- }
- elseif($server_name == 'dev.laboiteapain.net' ||
- $server_name == 'boulanger-dev.laboiteapain.net')
- {
- return 'http://dev.laboiteapain.net/' ;
- }
- elseif($server_name == 'demo.laboiteapain.net' ||
- $server_name == 'boulanger-demo.laboiteapain.net')
- {
- return 'http://demo.laboiteapain.net/' ;
- }
- }
-
- public static function backend()
- {
- $server_name = Yii::$app->getRequest()->serverName ;
- if($server_name == 'localhost')
- {
- return 'http://localhost/reservation_pain/backend/web/' ;
- }
- elseif($server_name == 'www.laboiteapain.net' ||
- $server_name == 'boulanger.laboiteapain.net')
- {
- return 'http://boulanger.laboiteapain.net/' ;
- }
- elseif($server_name == 'dev.laboiteapain.net' ||
- $server_name == 'boulanger-dev.laboiteapain.net')
- {
- return 'http://boulanger-dev.laboiteapain.net/' ;
- }
- elseif($server_name == 'demo.laboiteapain.net' ||
- $server_name == 'boulanger-demo.laboiteapain.net')
- {
- return 'http://boulanger-demo.laboiteapain.net/' ;
- }
- }
-
- public static function env($env, $section)
- {
- $server_name = Yii::$app->getRequest()->serverName ;
-
- if($section == 'backend')
- {
- if($server_name == 'localhost')
- {
- return 'http://localhost/reservation_pain/backend/web/' ;
- }
- else {
- if($env == 'prod')
- {
- return 'http://boulanger.laboiteapain.net/' ;
- }
- else {
- return 'http://boulanger-'.$env.'.laboiteapain.net/' ;
- }
- }
- }
- else {
- if($server_name == 'localhost')
- {
- return 'http://localhost/reservation_pain/frontend/web/' ;
- }
- else {
- if($env == 'prod')
- {
- return 'http://www.laboiteapain.net/' ;
- }
- else {
- return 'http://'.$env.'.laboiteapain.net/' ;
- }
- }
- }
- }
- }
|