우리의 배포 모델은
- 개발자
- 단계
- 생산
- 장애 조치 (MySQL 복제 및로드 밸런서)
우리의 문제는 서버가 페일 오버되었다는 것입니다. 컨텐츠 편집자에게 페일 오버 중임을 알리고 싶습니다. 또한 개발 상자가 아닌 프로덕션 영역에서 편집하고 있는지 확인하고 싶습니다.
사용자가 로그인 한 후 환경을 구별 할 수있는 방법이 있습니까? 서버의 호스트 이름에 따라 관리 막대를 색상으로 구분하는 모듈이 있습니까?
우리의 배포 모델은
우리의 문제는 서버가 페일 오버되었다는 것입니다. 컨텐츠 편집자에게 페일 오버 중임을 알리고 싶습니다. 또한 개발 상자가 아닌 프로덕션 영역에서 편집하고 있는지 확인하고 싶습니다.
사용자가 로그인 한 후 환경을 구별 할 수있는 방법이 있습니까? 서버의 호스트 이름에 따라 관리 막대를 색상으로 구분하는 모듈이 있습니까?
답변:
첫 번째 답변에서 언급했듯이 environment_indicator 가 찾고 있습니다.
글쎄, 우리는 또한 같은 종류의 개발 모델을 사용하며 기능 모듈 을 사용하는 경우 사용하기 쉽도록 설정을 파일로 작성할 수 있습니다. 이렇게하면 색상이 자동으로 변경됩니다.
아래 코드를 따르면 기능 모듈을 통해 가져올 수 있습니다.
/**
* Implements hook_default_environment_indicator_environment().
*/
function mymodule_default_environment_indicator_environment() {
$export = array();
$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'live';
$environment->name = 'Live';
$environment->regexurl = 'example.com';
$environment->settings = array(
'color' => '#bb0000',
'text_color' => '#ffffff',
'weight' => '',
'position' => 'top',
'fixed' => 0,
);
$export['live'] = $environment;
$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'staging';
$environment->name = 'Staging';
$environment->regexurl = 'stage.example.com';
$environment->settings = array(
'color' => '#000099',
'text_color' => '#ffffff',
'weight' => '',
'position' => 'top',
'fixed' => 0,
);
$export['staging'] = $environment;
$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'dev';
$environment->name = 'Dev';
$environment->regexurl = 'dev.example.com';
$environment->settings = array(
'color' => '#000066',
'text_color' => '#ffffff',
'weight' => '',
'position' => 'top',
'fixed' => 0,
);
$export['dev'] = $environment;
return $export;
}