■Fuelphpにて環境の振り分け例

bootstrap.php の編集を行い、開発環境や本番環境の振り分けを行う。

例)
・ポートが8080の場合 → staging環境
・ホストが”localhost”の場合 → development環境
・上記に該当しない場合 → production環境

switch (isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : '') {

//テスト環境の場合
	case '8080':
		Fuel::$env = Fuel::STAGING;
		break;

//本番環境の場合(他の条件に該当しない)
	default:
		Fuel::$env = Fuel::PRODUCTION;
		break;
}

switch (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '') {

//開発環境の場合
	case 'localhost':
		Fuel::$env = Fuel::DEVELOPMENT;
		break;
}

19 Comments

  1. http://www.buy-backlink.net says:

    http://www.buy-backlink.net

    hfnpycfcg mokmf oxqvfus guyu jhelomokjjhkftn

  2. Buy Glo Cartridges Online says:

    … [Trackback]

    […] Find More Info here on that Topic: dragon-ark.com/archives/807 […]

  3. munib.org says:

    … [Trackback]

    […] Information to that Topic: dragon-ark.com/archives/807 […]

  4. find out here now says:

    … [Trackback]

    […] There you can find 37156 additional Info on that Topic: dragon-ark.com/archives/807 […]

  5. exchange online fiyat says:

    … [Trackback]

    […] There you can find 59093 additional Info on that Topic: dragon-ark.com/archives/807 […]

  6. dell sunucu teknik servis says:

    … [Trackback]

    […] Find More on to that Topic: dragon-ark.com/archives/807 […]

  7. kurumsal it danışmanlığı says:

    … [Trackback]

    […] Here you will find 32449 additional Info to that Topic: dragon-ark.com/archives/807 […]

  8. Hp Sunucu destek says:

    … [Trackback]

    […] Find More on to that Topic: dragon-ark.com/archives/807 […]

  9. world market url says:

    … [Trackback]

    […] Read More here on that Topic: dragon-ark.com/archives/807 […]

  10. Digital Transformation Solutions says:

    … [Trackback]

    […] Find More here to that Topic: dragon-ark.com/archives/807 […]

  11. como hackear whatsapp says:

    … [Trackback]

    […] Read More to that Topic: dragon-ark.com/archives/807 […]

  12. elojob lol says:

    … [Trackback]

    […] Here you can find 33421 more Info to that Topic: dragon-ark.com/archives/807 […]

  13. backlink says:

    backlink

    blog topic

  14. relx 煙彈 says:

    … [Trackback]

    […] Find More on that Topic: dragon-ark.com/archives/807 […]

  15. Fortune Games says:

    … [Trackback]

    […] Find More to that Topic: dragon-ark.com/archives/807 […]

  16. buy marijuana online says:

    … [Trackback]

    […] Read More Info here to that Topic: dragon-ark.com/archives/807 […]

  17. dumps sql says:

    … [Trackback]

    […] Info to that Topic: dragon-ark.com/archives/807 […]

  18. kardinal stick says:

    … [Trackback]

    […] Find More here on that Topic: dragon-ark.com/archives/807 […]

  19. tusblogos says:

    … [Trackback]

    […] Information to that Topic: dragon-ark.com/archives/807 […]

Leave a Reply