protected function replacePattern($pattern) {
    $replace = array(
      '$DIR' => dirname($this->configFile),
      '$CWD' => getcwd(),
    );
    return str_replace(array_keys($replace), array_values($replace), $pattern);
  }