Skip to content

Commit

Permalink
修改 util.SearchSkel 的风格外观,采用 bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
hightman committed Mar 20, 2013
1 parent 9d794ee commit aad4556
Show file tree
Hide file tree
Showing 12 changed files with 11,282 additions and 256 deletions.
8 changes: 7 additions & 1 deletion sdk/php/doc/guide/start.changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
在这里,按版本号罗列了历次版本的主要变动记录,以及相关的文档链接,
方便新老用户快速查看。完整的更新日志请查看 [git 提交日志][1]。

版本 1.4.2 (2013-3-20)
----------------------
- 再度完善搜索线程池大压力下的死锁问题(感谢几位热心用户的配合反馈)
- 美化 util.SearchSkel 生成的搜索骨架效果(采用 bootstrap)
- 加入 Yii 扩展的包装代码,位于 `sdk/php/wrapper/yii-ext/`

版本 1.4.1 (2013-2-21)
----------------------
- 修正潜伏已久的 searchd 死锁故障, 彻底解决进程卡死
- 修正潜伏已久的 searchd 死锁故障彻底解决进程卡死
- 修正若干已知的小 BUG 并改进一些显示效果
- 搜索日志记录时排除具有明显特征的搜索引擎爬虫

Expand Down
15 changes: 10 additions & 5 deletions sdk/php/util/SearchSkel.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
foreach ($xs->getAllFields() as $field) /* @var $field XSFieldMeta */
{
if ($field->hasIndexSelf() && $field->type != XSFieldMeta::TYPE_BODY && !$field->isBoolIndex())
$vars['@set_filter@'] .= "\t\t\t<li><input type=\"radio\" name=\"f\" value=\"{$field->name}\" <?php echo \$f_{$field->name}; ?> />" . ucfirst($field->name) . "</li>\n";
$vars['@set_filter@'] .= "\t\t\t<label class=\"radio inline\"><input type=\"radio\" name=\"f\" value=\"{$field->name}\" <?php echo \$f_{$field->name}; ?> />" . ucfirst($field->name) . "</label>\n";
if ($field->isNumeric())
{
$vars['@set_sort@'] .= "\t\t\t\t\t<option value=\"" . $field->name . "_DESC\" <?php echo \$s_{$field->name}_DESC; ?>>" . ucfirst($field->name) . "从大到小</option>\n";
Expand All @@ -111,7 +111,7 @@
continue;
}
}
$vars['@field_info@'] .= "\t\t\t\t<li><span>" . ucfirst($field->name) . ":</span> <?php echo htmlspecialchars(\$doc->" . $field->name . "); ?></li>\n";
$vars['@field_info@'] .= "\t\t\t\t" . ucfirst($field->name) . ": <?php echo htmlspecialchars(\$doc->" . $field->name . "); ?>\n";
}

$vars['@set_filter@'] = trim($vars['@set_filter@']);
Expand Down Expand Up @@ -151,9 +151,14 @@
{
echo "正在复制 " . $entry . " ...\n";
$file = $output . '/' . $entry;
if (file_exists($file))
copy($file, $file . '.bak');
copy($input . '/' . $entry, $file);
if (is_dir($input . '/' . $entry))
XSUtil::copyDir($input . '/' . $entry, $file);
else
{
if (file_exists($file))
copy($file, $file . '.bak');
copy($input . '/' . $entry, $file);
}
}
}
$dir->close();
Expand Down
22 changes: 22 additions & 0 deletions sdk/php/util/XSUtil.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,26 @@ public static function flush()
if (ob_get_level() > 0)
ob_flush();
}

/**
* 拷贝一个目录及其子目录文件
*/
public static function copyDir($src, $dst)
{
if (!($dir = @dir($src)) || (!is_dir($dst) && !@mkdir($dst, 0755, true)))
return false;
while (($entry = $dir->read()) !== false)
{
if ($entry === '.' || $entry === '..')
continue;
$psrc = $src . DIRECTORY_SEPARATOR . $entry;
$pdst = $dst . DIRECTORY_SEPARATOR . $entry;
if (is_dir($pdst))
self::copyDir($psrc, $pdst);
else
@copy($psrc, $pdst);
}
$dir->close();
return true;
}
}
Loading

0 comments on commit aad4556

Please sign in to comment.