public function code($code = 200) { $messages = Arrays::multikey($this->config['messages']); if (isset($messages[$code])) { return $messages[$code]; } return false; }
public function set($exp = '') { if (!is_string($exp)) { return Error::set('Error', 'stringParameter', 'exp'); } $chars = $this->config['setTimeFormatChars']; $chars = Arrays::multikey($chars); $setExp = str_ireplace(array_keys($chars), array_values($chars), $exp); return strftime($setExp); }
public function set($exp = 'H:i:s') { if (!is_string($exp)) { return Error::set('Error', 'stringParameter', 'exp'); } $chars = $this->config['setDateFormatChars']; $chars = Arrays::multikey($chars); $newClock = str_ireplace(array_keys($chars), array_values($chars), $exp); return date($newClock); }
private function _regularConverting($pattern, $ex = '', $delimiter) { $specialChars = $this->config['specialChars']; $pattern = str_ireplace(array_keys($specialChars), array_values($specialChars), $pattern); // Config/Regex.php dosyasından düzenlenmiş karakter // listeleri alınıyor. $regexChars = Arrays::multikey($this->config['regexChars']); $settingChars = Arrays::multikey($this->config['settingChars']); // -------------------------------------------------------------------------------------------- $pattern = str_ireplace(array_keys($regexChars), array_values($regexChars), $pattern); if (!empty($ex)) { $ex = str_ireplace(array_keys($settingChars), array_values($settingChars), $ex); } $pattern = $delimiter . trim($pattern, '/') . $delimiter . $ex; return $pattern; }
protected function vectorSize($mode = '', $cipher = '') { $mode = strtolower($mode); $cipher = strtolower($cipher); $modes = array('cbc' => 16, 'rc2' => 8, 'ecb' => 0); $modes = Arrays::multikey($modes); $mode = isset($modes[$mode]) ? $modes[$mode] : 16; if (!empty($cipher)) { $mode = isset($modes[$cipher]) ? $modes[$cipher] : $mode; } return mb_substr(hash('sha1', Config::get('Encode', 'projectKey')), 0, $mode); }
public function urlWord($str = '', $splitWord = '-') { if (!is_string($str)) { return Error::set(lang('Error', 'stringParameter', 'str')); } if (!is_string($splitWord)) { $splitWord = "-"; } $accent = Config::get('ForeignChars', 'accentChars'); $accent = Arrays::multikey($accent); $badChars = Config::get('Security', 'urlBadChars'); $str = str_replace(array_keys($accent), array_values($accent), $str); $str = str_replace($badChars, '', $str); $str = preg_replace("/\\s+/", ' ', $str); $str = str_replace(" ", '', $str); $str = str_replace(' ', $splitWord, trim(strtolower($str))); return $str; }
protected function vectorSize($mode = '', $cipher = '') { $mode = strtolower($mode); $cipher = strtolower($cipher); $modes = array('cbc' => 8, 'cast_256|loki97|rijndael_128|saferplus|serpent|twofish' => 16, 'rijndael_192' => 24, 'rijndael_256' => 32); $modes = Arrays::multikey($modes); $mode = isset($modes[$mode]) ? $modes[$mode] : 8; if (!empty($cipher)) { $mode = isset($modes[$cipher]) ? $modes[$cipher] : $mode; } return mb_substr(hash('sha1', Config::get('Encode', 'projectKey')), 0, $mode); }
public function accent($str = '') { if (!is_string($str)) { return Error::set('Error', 'stringParameter', 'str'); } // Config/ForeignChars.php dosyasından // kullanılacak karakter listesini al. $accent = Config::get('ForeignChars', 'accentChars'); $accent = Arrays::multikey($accent); return str_replace(array_keys($accent), array_values($accent), $str); }