• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2312 (tree)
Time2018-12-30 20:08:44
Authorumethyl

Log Message

Query::SetLimit() 削除

Change Summary

Incremental Difference

--- trunk/include/database/db_class.php (revision 2311)
+++ trunk/include/database/db_class.php (revision 2312)
@@ -351,11 +351,6 @@
351351 private $lock = false;
352352
353353 //-- 直接生成型 --//
354- //LIMIT 句生成
355- public static function SetLimit($from, $to) {
356- return sprintf(' LIMIT %d, %d', $from, $to);
357- }
358-
359354 //LIKE 句生成
360355 public static function GetLike($str) {
361356 return Text::Quote($str, '%', '%');
--- trunk/include/html/old_log_html_class.php (revision 2311)
+++ trunk/include/html/old_log_html_class.php (revision 2312)
@@ -96,9 +96,11 @@
9696 $cache_flag = false; //キャッシュ取得判定
9797 if (JinrouCacheManager::Enable(JinrouCacheManager::LOG_LIST)) {
9898 $cache_flag = self::IsCache();
99- if ($cache_flag) {
99+ if (true === $cache_flag) {
100100 $str = JinrouCacheManager::Get(JinrouCacheManager::LOG_LIST);
101- if (isset($str)) return $str;
101+ if (true === isset($str)) {
102+ return $str;
103+ }
102104 }
103105 }
104106
@@ -111,7 +113,9 @@
111113
112114 if (RQ::Get()->generate_index) {
113115 $max = RQ::Get()->max_room_no;
114- if (is_int($max) && $max > 0 && $room_count > $max) $room_count = $max;
116+ if (is_int($max) && $max > 0 && $room_count > $max) {
117+ $room_count = $max;
118+ }
115119 $builder = new PageLinkBuilder('index', RQ::Get()->page, $room_count);
116120 $builder->set_reverse = $is_reverse;
117121 $builder->url = '<a href="index';
@@ -199,7 +203,7 @@
199203 }
200204
201205 $str .= Text::LineFeed(self::GetListFooter());
202- if ($cache_flag) {
206+ if (true === $cache_flag) {
203207 JinrouCacheManager::Store($str);
204208 }
205209 return $str;
--- trunk/include/old_log_functions.php (revision 2311)
+++ trunk/include/old_log_functions.php (revision 2312)
@@ -49,7 +49,7 @@
4949 }
5050
5151 if ($this->file == 'old_log') {
52- $this->AddOption('reverse', Switcher::Get(! $this->set_reverse));
52+ $this->AddOption('reverse', Switcher::Get(false === $this->set_reverse));
5353 $url_stack[] = OldLogMessage::LINK_ORDER;
5454 if ($this->set_reverse) {
5555 $url_stack[] = OldLogMessage::ORDER_REVERSE;
@@ -80,8 +80,11 @@
8080
8181 //ページ送り用のリンクタグを作成する
8282 protected function GenerateTag($page, $title = null, $force = false) {
83- if ($page == $this->page->set && ! $force) return Text::QuoteBracket($page);
84- if (is_null($title)) {
83+ if ($page == $this->page->set && false === $force) {
84+ return Text::QuoteBracket($page);
85+ }
86+
87+ if (true === is_null($title)) {
8588 $title = Text::QuoteBracket($page);
8689 }
8790 if ($this->file == 'index') {
@@ -106,8 +109,7 @@
106109 }
107110 $start = max(1, $start);
108111 }
109- $end = $start + $this->view_page - 1;
110- if ($end > $total) $end = $total;
112+ $end = min($total, $start + $this->view_page - 1);
111113
112114 $this->page->set = $page;
113115 $this->page->total = $total;
@@ -114,7 +116,5 @@
114116 $this->page->start = $start;
115117 $this->page->end = $end;
116118 //Text::p($this->page, '◆page');
117- $this->limit = $page == 'all' ? '' : $this->view_count * ($page - 1);
118- $this->query = $page == 'all' ? '' : Query::SetLimit($this->limit, $this->view_count);
119119 }
120120 }
Show on old repository browser