改进Handle类支持异常的多语言 Lang类增加has方法 增加核心中文语言包

This commit is contained in:
thinkphp
2016-06-16 16:07:44 +08:00
parent d8fc0bf7aa
commit 50d1798e92
35 changed files with 151 additions and 59 deletions

View File

@@ -255,7 +255,7 @@ class TagLib
$must = explode(',', $tag['must']);
foreach ($must as $name) {
if (!isset($result[$name])) {
throw new Exception('_PARAM_ERROR_:' . $name);
throw new Exception('tag attr must:' . $name);
}
}
}
@@ -272,7 +272,7 @@ class TagLib
$result['expression'] = rtrim($result['expression'], '/');
$result['expression'] = trim($result['expression']);
} elseif (empty($this->tags[$name]) || !empty($this->tags[$name]['attr'])) {
throw new Exception('_XML_TAG_ERROR_:' . $name);
throw new Exception('tag error:' . $name);
}
}
return $result;

View File

@@ -30,7 +30,7 @@ class File
}
// 生成模板缓存文件
if (false === file_put_contents($cacheFile, $content)) {
throw new Exception('cache write error :' . $cacheFile, 11602);
throw new Exception('cache write error:' . $cacheFile, 11602);
}
}

View File

@@ -46,7 +46,7 @@ class Sae
// 添加写入时间
$content = time() . $content;
if (!$this->mc->set($cacheFile, $content, MEMCACHE_COMPRESSED, 0)) {
throw new Exception('sae mc write error :' . $cacheFile);
throw new Exception('sae mc write error:' . $cacheFile);
} else {
$this->contents[$cacheFile] = $content;
return true;