예제 #1
0
파일: Bundle.php 프로젝트: sinfocol/gwf3
 private function missingBits($file, $otherfile)
 {
     include $file;
     $lang_en = $lang;
     include $otherfile;
     $lang2 = $lang;
     foreach ($lang_en as $key => $value) {
         if (is_array($value)) {
             $valueE2 = GWF_Array::implode('[,]', $value);
         } else {
             $valueE2 = $value;
         }
         if (isset($lang2[$key])) {
             $valueO = $lang2[$key];
             if (is_array($valueO)) {
                 $valueO = GWF_Array::implode('[,]', $valueO);
             }
         } else {
             $valueO = $valueE2;
         }
         if ($valueO === $valueE2) {
             $this->addMissingBit($file, $key, $value);
         }
     }
 }
예제 #2
0
 /**
  * Translate an item.
  * @param string $iso
  * @param string $key
  * @param null|array $args
  * @return string|array
  */
 private function translate($iso, $key, $args = NULL)
 {
     if (false === isset($this->trans[$iso][$key])) {
         return htmlspecialchars($key) . (is_array($args) ? ': ' . GWF_Array::implode(',', $args) : '');
     }
     return $this->replaceArgs($this->trans[$iso][$key], $args);
 }
예제 #3
0
파일: GWF_Log.php 프로젝트: sinfocol/gwf3
 /**
  * strip values from arraykeys which begin with 'pass'
  * @todo faster way without foreach...
  * print_r and preg_match ?
  * array_map stripos('pass') return '';
  */
 private static function stripPassword(array $a)
 {
     $back = '';
     foreach ($a as $k => $v) {
         if (stripos($k, 'pass') !== false || $k === 'answer') {
             $v = 'xxxxx';
         } elseif (is_array($v) === true) {
             $v = GWF_Array::implode(',', $v);
         }
         $back .= self::$POST_DELIMITER . $k . '=>' . $v;
     }
     return self::shortString($back);
 }