改进数据表字段缓存读取

This commit is contained in:
thinkphp
2016-09-20 10:45:10 +08:00
parent fe1fd73b93
commit c1a2db30c7
2 changed files with 13 additions and 7 deletions

View File

@@ -1341,13 +1341,15 @@ class Query
}
list($guid) = explode(' ', $tableName);
if (!strpos($guid, '.')) {
$guid = $this->getConfig('database') . '.' . $guid;
}
if (!isset(self::$info[$guid])) {
if (!strpos($guid, '.')) {
$schema = $this->getConfig('database') . '.' . $guid;
} else {
$schema = $guid;
}
// 读取缓存
if (is_file(RUNTIME_PATH . 'schema/' . $guid . '.php')) {
$info = include RUNTIME_PATH . 'schema/' . $guid . '.php';
if (is_file(RUNTIME_PATH . 'schema/' . $schema . '.php')) {
$info = include RUNTIME_PATH . 'schema/' . $schema . '.php';
} else {
$info = $this->connection->getFields($guid);
}