Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

大移動

  • Loading branch information...
commit 144c0e91c0822dc6ba5c237ec9759b3c98bd6a0d 1 parent 7f5cb5a
@rsky authored
Showing with 261 additions and 192 deletions.
  1. +1 −0  .gitignore
  2. +16 −0 LICENSE.txt
  3. +0 −2  cli/.htaccess
  4. +0 −3  conf/.htaccess
  5. +10 −15 conf/conf.inc.php
  6. +6 −11 conf/conf_admin.inc.php
  7. +6 −5 conf/conf_ic2.inc.php
  8. +3 −3 conf/conf_user_def.inc.php
  9. +1 −0  data/dat/.gitignore
  10. +1 −0  data/db/.gitignore
  11. +1 −0  data/idx/.gitignore
  12. +1 −0  data/logs/.gitignore
  13. +1 −0  data/misc/.gitignore
  14. +1 −0  data/pref/.gitignore
  15. +1 −1  doc/ImageCache2/ic2_install.phps
  16. +3 −0  init.php
  17. +0 −3  lib/.htaccess
  18. +3 −3 lib/P2CommandRunner.php
  19. +6 −6 lib/ShowThreadK.php
  20. +4 −4 lib/ShowThreadPc.php
  21. +6 −6 lib/bootstrap.php
  22. +7 −3 lib/expack/ic2/DatabaseManager.php
  23. +4 −4 lib/expack/ic2/ImageInfo.php
  24. +91 −43 lib/expack/ic2/Thumbnailer.php
  25. +2 −1  lib/expack/ic2/bootstrap.php
  26. +9 −9 lib/expack/rss/getimage.inc.php
  27. +2 −2 lib/startup.funcs.php
  28. +1 −1  { → rep2}/aas.php
  29. +1 −1  { → rep2}/cookie.php
  30. +1 −1  { → rep2}/css.php
  31. 0  { → rep2}/css/blank.css
  32. 0  { → rep2}/css/ic2_iphone.css
  33. 0  { → rep2}/css/ic2_popinfo.css
  34. 0  { → rep2}/css/iphone.css
  35. 0  { → rep2}/css/iv2_iphone.css
  36. 0  { → rep2}/css/lightbox/lightbox-ie6.css
  37. 0  { → rep2}/css/lightbox/lightbox.css
  38. 0  { → rep2}/css/limelight.css
  39. 0  { → rep2}/css/menu_i.css
  40. 0  { → rep2}/css/tabber/tabber.css
  41. 0  { → rep2}/css/yui/screen.css
  42. +1 −1  { → rep2}/edit_aborn_word.php
  43. +2 −2 { → rep2}/edit_conf_user.php
  44. 0  { → rep2}/edit_dat_plugin.php
  45. 0  { → rep2}/edit_link_plugin.php
  46. 0  { → rep2}/edit_ng_thread.php
  47. 0  { → rep2}/edit_replace_imageurl.php
  48. +1 −1  { → rep2}/edit_user_font.php
  49. +1 −1  { → rep2}/editfavita.php
  50. +1 −1  { → rep2}/editfile.php
  51. +1 −1  { → rep2}/editpref.php
  52. +1 −1  { → rep2}/editrss.php
  53. 0  { → rep2}/favicon.ico
  54. +1 −1  { → rep2}/first_cont.php
  55. 0  { → rep2}/hissi.php
  56. +1 −1  { → rep2}/httpcmd.php
  57. +1 −0  rep2/ic/.gitignore
  58. +29 −29 { → rep2}/ic2.php
  59. +3 −3 { → rep2}/ic2_fitimage.php
  60. +1 −1  { → rep2}/ic2_getcount.php
  61. +14 −8 { → rep2}/ic2_getinfo.php
  62. +7 −7 { → rep2}/ic2_getter.php
  63. +1 −1  { → rep2}/ic2_manager.php
  64. +1 −1  { → rep2}/ic2_mkthumb.php
  65. +1 −1  { → rep2}/ic2_setrank.php
  66. +3 −3 { → rep2}/ic2_setter.php
  67. +1 −1  { → rep2}/ic2_viewtable.php
  68. 0  { → rep2}/img/100.gif
  69. 0  { → rep2}/img/100.png
  70. 0  { → rep2}/img/101.gif
  71. 0  { → rep2}/img/101.png
  72. 0  { → rep2}/img/200.gif
  73. 0  { → rep2}/img/200.png
  74. 0  { → rep2}/img/201.gif
  75. 0  { → rep2}/img/201.png
  76. 0  { → rep2}/img/202.gif
  77. 0  { → rep2}/img/202.png
  78. 0  { → rep2}/img/203.gif
  79. 0  { → rep2}/img/203.png
  80. 0  { → rep2}/img/204.gif
  81. 0  { → rep2}/img/204.png
  82. 0  { → rep2}/img/206.gif
  83. 0  { → rep2}/img/206.png
  84. 0  { → rep2}/img/300.gif
  85. 0  { → rep2}/img/300.png
  86. 0  { → rep2}/img/301.gif
  87. 0  { → rep2}/img/301.png
  88. 0  { → rep2}/img/302.gif
  89. 0  { → rep2}/img/302.png
  90. 0  { → rep2}/img/303.gif
  91. 0  { → rep2}/img/303.png
  92. 0  { → rep2}/img/304.gif
  93. 0  { → rep2}/img/304.png
  94. 0  { → rep2}/img/305.gif
  95. 0  { → rep2}/img/305.png
  96. 0  { → rep2}/img/306.gif
  97. 0  { → rep2}/img/306.png
  98. 0  { → rep2}/img/307.gif
  99. 0  { → rep2}/img/307.png
  100. 0  { → rep2}/img/400.gif
  101. 0  { → rep2}/img/400.png
  102. 0  { → rep2}/img/401.gif
  103. 0  { → rep2}/img/401.png
  104. 0  { → rep2}/img/402.gif
  105. 0  { → rep2}/img/402.png
  106. 0  { → rep2}/img/403.gif
  107. 0  { → rep2}/img/403.png
  108. 0  { → rep2}/img/404.gif
  109. 0  { → rep2}/img/404.png
  110. 0  { → rep2}/img/405.gif
  111. 0  { → rep2}/img/405.png
  112. 0  { → rep2}/img/406.gif
  113. 0  { → rep2}/img/406.png
  114. 0  { → rep2}/img/407.gif
  115. 0  { → rep2}/img/407.png
  116. 0  { → rep2}/img/408.gif
  117. 0  { → rep2}/img/408.png
  118. 0  { → rep2}/img/409.gif
  119. 0  { → rep2}/img/409.png
  120. 0  { → rep2}/img/410.gif
  121. 0  { → rep2}/img/410.png
  122. 0  { → rep2}/img/411.gif
  123. 0  { → rep2}/img/411.png
  124. 0  { → rep2}/img/412.gif
  125. 0  { → rep2}/img/412.png
  126. 0  { → rep2}/img/413.gif
  127. 0  { → rep2}/img/413.png
  128. 0  { → rep2}/img/414.gif
  129. 0  { → rep2}/img/414.png
  130. 0  { → rep2}/img/415.gif
  131. 0  { → rep2}/img/415.png
  132. 0  { → rep2}/img/416.gif
  133. 0  { → rep2}/img/416.png
  134. 0  { → rep2}/img/417.gif
  135. 0  { → rep2}/img/417.png
  136. 0  { → rep2}/img/500.gif
  137. 0  { → rep2}/img/500.png
  138. 0  { → rep2}/img/501.gif
  139. 0  { → rep2}/img/501.png
  140. 0  { → rep2}/img/502.gif
  141. 0  { → rep2}/img/502.png
  142. 0  { → rep2}/img/503.gif
  143. 0  { → rep2}/img/503.png
  144. 0  { → rep2}/img/504.gif
  145. 0  { → rep2}/img/504.png
  146. 0  { → rep2}/img/505.gif
  147. 0  { → rep2}/img/505.png
  148. 0  { → rep2}/img/aa.gif
  149. 0  { → rep2}/img/aa.png
  150. 0  { → rep2}/img/asap.png
  151. 0  { → rep2}/img/bg-b.png
  152. 0  { → rep2}/img/btn_close.gif
  153. 0  { → rep2}/img/btn_close.png
  154. 0  { → rep2}/img/btn_info.gif
  155. 0  { → rep2}/img/btn_info.png
  156. 0  { → rep2}/img/btn_minus.gif
  157. 0  { → rep2}/img/btn_minus.png
  158. 0  { → rep2}/img/btn_plus.gif
  159. 0  { → rep2}/img/btn_plus.png
  160. 0  { → rep2}/img/c-bl.png
  161. 0  { → rep2}/img/c-br.png
  162. 0  { → rep2}/img/c-tl.png
  163. 0  { → rep2}/img/c-tr.png
  164. 0  { → rep2}/img/check.gif
  165. 0  { → rep2}/img/check.png
  166. 0  { → rep2}/img/fi_full.gif
  167. 0  { → rep2}/img/fi_height.gif
  168. 0  { → rep2}/img/fi_width.gif
  169. 0  { → rep2}/img/glyphish/icons/01-refresh.png
  170. 0  { → rep2}/img/glyphish/icons/02-redo.png
  171. 0  { → rep2}/img/glyphish/icons/03-loopback.png
  172. 0  { → rep2}/img/glyphish/icons/04-squiggle.png
  173. 0  { → rep2}/img/glyphish/icons/05-shuffle.png
  174. 0  { → rep2}/img/glyphish/icons/06-magnifying-glass.png
  175. 0  { → rep2}/img/glyphish/icons/07-map-marker.png
  176. 0  { → rep2}/img/glyphish/icons/08-chat.png
  177. 0  { → rep2}/img/glyphish/icons/09-chat2.png
  178. 0  { → rep2}/img/glyphish/icons/10-medical.png
  179. 0  { → rep2}/img/glyphish/icons/100-coffee.png
  180. 0  { → rep2}/img/glyphish/icons/101-gameplan.png
  181. 0  { → rep2}/img/glyphish/icons/102-walk.png
  182. 0  { → rep2}/img/glyphish/icons/103-map.png
  183. 0  { → rep2}/img/glyphish/icons/104-index-cards.png
  184. 0  { → rep2}/img/glyphish/icons/105-piano.png
  185. 0  { → rep2}/img/glyphish/icons/106-sliders.png
  186. 0  { → rep2}/img/glyphish/icons/107-widescreen.png
  187. 0  { → rep2}/img/glyphish/icons/108-badge.png
  188. 0  { → rep2}/img/glyphish/icons/109-chicken.png
  189. 0  { → rep2}/img/glyphish/icons/11-clock.png
  190. 0  { → rep2}/img/glyphish/icons/110-bug.png
  191. 0  { → rep2}/img/glyphish/icons/111-user.png
  192. 0  { → rep2}/img/glyphish/icons/112-group.png
  193. 0  { → rep2}/img/glyphish/icons/113-navigation.png
  194. 0  { → rep2}/img/glyphish/icons/114-balloon.png
  195. 0  { → rep2}/img/glyphish/icons/115-bow-and-arrow.png
  196. 0  { → rep2}/img/glyphish/icons/116-controller.png
  197. 0  { → rep2}/img/glyphish/icons/117-todo.png
  198. 0  { → rep2}/img/glyphish/icons/118-coathanger.png
  199. 0  { → rep2}/img/glyphish/icons/119-piggybank.png
  200. 0  { → rep2}/img/glyphish/icons/12-eye.png
  201. 0  { → rep2}/img/glyphish/icons/120-headphones.png
  202. 0  { → rep2}/img/glyphish/icons/121-lanscape.png
  203. 0  { → rep2}/img/glyphish/icons/122-stats.png
  204. 0  { → rep2}/img/glyphish/icons/123-id-card.png
  205. 0  { → rep2}/img/glyphish/icons/124-bullhorn.png
  206. 0  { → rep2}/img/glyphish/icons/125-food.png
  207. 0  { → rep2}/img/glyphish/icons/126-moon.png
  208. 0  { → rep2}/img/glyphish/icons/127-sock.png
  209. 0  { → rep2}/img/glyphish/icons/128-bone.png
  210. 0  { → rep2}/img/glyphish/icons/129-golf.png
  211. 0  { → rep2}/img/glyphish/icons/13-target.png
  212. 0  { → rep2}/img/glyphish/icons/130-dice.png
  213. 0  { → rep2}/img/glyphish/icons/14-tag.png
  214. 0  { → rep2}/img/glyphish/icons/15-tags.png
  215. 0  { → rep2}/img/glyphish/icons/16-line-chart.png
  216. 0  { → rep2}/img/glyphish/icons/17-bar-chart.png
  217. 0  { → rep2}/img/glyphish/icons/18-envelope.png
  218. 0  { → rep2}/img/glyphish/icons/19-gear.png
  219. 0  { → rep2}/img/glyphish/icons/20-gear2.png
  220. 0  { → rep2}/img/glyphish/icons/21-skull.png
  221. 0  { → rep2}/img/glyphish/icons/22-skull-n-crossbones.png
  222. 0  { → rep2}/img/glyphish/icons/23-bird.png
  223. 0  { → rep2}/img/glyphish/icons/24-gift.png
  224. 0  { → rep2}/img/glyphish/icons/25-weather.png
  225. 0  { → rep2}/img/glyphish/icons/26-bandaid.png
  226. 0  { → rep2}/img/glyphish/icons/27-planet.png
  227. 0  { → rep2}/img/glyphish/icons/28-star.png
  228. 0  { → rep2}/img/glyphish/icons/29-heart.png
  229. 0  { → rep2}/img/glyphish/icons/30-key.png
  230. 0  { → rep2}/img/glyphish/icons/31-ipod.png
  231. 0  { → rep2}/img/glyphish/icons/32-iphone.png
  232. 0  { → rep2}/img/glyphish/icons/33-cabinet.png
  233. 0  { → rep2}/img/glyphish/icons/34-coffee.png
  234. 0  { → rep2}/img/glyphish/icons/35-shopping-bag.png
  235. 0  { → rep2}/img/glyphish/icons/36-toolbox.png
  236. 0  { → rep2}/img/glyphish/icons/37-suitcase.png
  237. 0  { → rep2}/img/glyphish/icons/38-airplane.png
  238. 0  { → rep2}/img/glyphish/icons/39-spraycan.png
  239. 0  { → rep2}/img/glyphish/icons/40-inbox.png
  240. 0  { → rep2}/img/glyphish/icons/41-picture-frame.png
  241. 0  { → rep2}/img/glyphish/icons/42-photos.png
  242. 0  { → rep2}/img/glyphish/icons/43-film-roll.png
  243. 0  { → rep2}/img/glyphish/icons/44-shoebox.png
  244. 0  { → rep2}/img/glyphish/icons/45-movie1.png
  245. 0  { → rep2}/img/glyphish/icons/46-movie2.png
  246. 0  { → rep2}/img/glyphish/icons/47-fuel.png
  247. 0  { → rep2}/img/glyphish/icons/48-fork-and-knife.png
  248. 0  { → rep2}/img/glyphish/icons/49-battery.png
  249. 0  { → rep2}/img/glyphish/icons/50-beaker.png
  250. 0  { → rep2}/img/glyphish/icons/51-outlet.png
  251. 0  { → rep2}/img/glyphish/icons/52-pinetree.png
  252. 0  { → rep2}/img/glyphish/icons/53-house.png
  253. 0  { → rep2}/img/glyphish/icons/54-lock.png
  254. 0  { → rep2}/img/glyphish/icons/55-network.png
  255. 0  { → rep2}/img/glyphish/icons/56-cloud.png
  256. 0  { → rep2}/img/glyphish/icons/57-download.png
  257. 0  { → rep2}/img/glyphish/icons/58-bookmark.png
  258. 0  { → rep2}/img/glyphish/icons/59-flag.png
  259. 0  { → rep2}/img/glyphish/icons/60-signpost.png
  260. 0  { → rep2}/img/glyphish/icons/61-brightness.png
  261. 0  { → rep2}/img/glyphish/icons/62-contrast.png
  262. 0  { → rep2}/img/glyphish/icons/63-runner.png
  263. 0  { → rep2}/img/glyphish/icons/64-zap.png
  264. 0  { → rep2}/img/glyphish/icons/65-note.png
  265. 0  { → rep2}/img/glyphish/icons/66-microphone.png
  266. 0  { → rep2}/img/glyphish/icons/67-tshirt.png
  267. 0  { → rep2}/img/glyphish/icons/68-paperclip.png
  268. 0  { → rep2}/img/glyphish/icons/69-display.png
  269. 0  { → rep2}/img/glyphish/icons/70-tv.png
  270. 0  { → rep2}/img/glyphish/icons/71-compass.png
  271. 0  { → rep2}/img/glyphish/icons/72-pin.png
  272. 0  { → rep2}/img/glyphish/icons/73-radar.png
  273. 0  { → rep2}/img/glyphish/icons/74-location.png
  274. 0  { → rep2}/img/glyphish/icons/75-phone.png
  275. 0  { → rep2}/img/glyphish/icons/76-baby.png
  276. 0  { → rep2}/img/glyphish/icons/77-ekg.png
  277. 0  { → rep2}/img/glyphish/icons/78-stopwatch.png
  278. 0  { → rep2}/img/glyphish/icons/79-medical-bag.png
  279. 0  { → rep2}/img/glyphish/icons/80-shopping-cart.png
  280. 0  { → rep2}/img/glyphish/icons/81-dashboard.png
  281. 0  { → rep2}/img/glyphish/icons/82-dogpaw.png
  282. 0  { → rep2}/img/glyphish/icons/83-calendar.png
  283. 0  { → rep2}/img/glyphish/icons/84-lightbulb.png
  284. 0  { → rep2}/img/glyphish/icons/85-trophy.png
  285. 0  { → rep2}/img/glyphish/icons/86-camera.png
  286. 0  { → rep2}/img/glyphish/icons/87-wineglass.png
  287. 0  { → rep2}/img/glyphish/icons/88-beermug.png
  288. 0  { → rep2}/img/glyphish/icons/89-dumbbell.png
  289. 0  { → rep2}/img/glyphish/icons/90-lifebuoy.png
  290. 0  { → rep2}/img/glyphish/icons/91-beaker2.png
  291. 0  { → rep2}/img/glyphish/icons/92-testtube.png
  292. 0  { → rep2}/img/glyphish/icons/93-thermometer.png
  293. 0  { → rep2}/img/glyphish/icons/94-pill.png
  294. 0  { → rep2}/img/glyphish/icons/95-equalizer.png
  295. 0  { → rep2}/img/glyphish/icons/96-book.png
  296. 0  { → rep2}/img/glyphish/icons/97-puzzle.png
  297. 0  { → rep2}/img/glyphish/icons/98-palette.png
  298. 0  { → rep2}/img/glyphish/icons/99-umbrella.png
  299. 0  { → rep2}/img/glyphish/icons2/01-refresh.png
  300. 0  { → rep2}/img/glyphish/icons2/02-redo.png
Sorry, we could not display the entire diff because too many files (1,308) changed.
View
1  .gitignore
@@ -0,0 +1 @@
+*.phar
View
16 LICENSE.txt
@@ -0,0 +1,16 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
2  cli/.htaccess
@@ -1,2 +0,0 @@
-Order allow,deny
-Deny from all
View
3  conf/.htaccess
@@ -1,3 +0,0 @@
-Order allow,deny
-Deny from all
-Allow from none
View
25 conf/conf.inc.php
@@ -153,9 +153,15 @@ function p2_init()
// }}}
// {{{ ライブラリ類のパス設定
- define('P2_CONF_DIR', __DIR__);
+ define('P2_CONFIG_DIR', __DIR__);
- define('P2_BASE_DIR', dirname(P2_CONF_DIR));
+ define('P2_BASE_DIR', dirname(P2_CONFIG_DIR));
+
+ // ドキュメントルート
+ define('P2_WWW_DIR', P2_BASE_DIR . '/rep2');
+
+ // コマンドラインスクリプト
+ define('P2_SCRIPT_DIR', P2_BASE_DIR . '/scripts');
// 基本的な機能を提供するするライブラリ
define('P2_LIB_DIR', P2_BASE_DIR . '/lib');
@@ -173,17 +179,6 @@ function p2_init()
define('P2_SKIN_DIR', P2_BASE_DIR . '/skin');
define('P2_USER_SKIN_DIR', P2_BASE_DIR . '/user_skin');
- // PEARインストールディレクトリ、検索パスに追加される
- define('P2_PEAR_DIR', P2_BASE_DIR . '/includes');
-
- // コマンドラインツール
- define('P2_CLI_DIR', P2_BASE_DIR . '/cli');
-
- // 検索パスをセット
- if (is_dir(P2_PEAR_DIR)) {
- set_include_path(P2_PEAR_DIR . PATH_SEPARATOR . get_include_path());
- }
-
// }}}
// {{{ 環境チェックとデバッグ
@@ -226,7 +221,7 @@ function p2_init()
// {{{ 管理者用設定etc.
// 管理者用設定を読み込み
- include P2_CONF_DIR . '/conf_admin.inc.php';
+ include P2_CONFIG_DIR . '/conf_admin.inc.php';
// ディレクトリの絶対パス化
$_conf['data_dir'] = p2_realpath($_conf['data_dir']);
@@ -306,7 +301,7 @@ function p2_init()
// }}}
- include P2_CONF_DIR . '/empty_style.php';
+ include P2_CONFIG_DIR . '/empty_style.php';
include P2_LIB_DIR . '/bootstrap.php';
}
View
17 conf/conf_admin.inc.php
@@ -11,24 +11,19 @@
// (それぞれパーミッションは 707 or 777 に。Web公開外ディレクトリに設定するのが望ましいです)
// p2で使用する基本のデータ保存ディレクトリ
-$_conf['data_dir'] = "./data"; // ("./data")
+$_conf['data_dir'] = P2_BASE_DIR . '/data/misc';
// 取得スレッドの dat データ保存ディレクトリ
-$_conf['dat_dir'] = "./data"; // ("./data")
+$_conf['dat_dir'] = P2_BASE_DIR . '/data/dat';
// 取得スレッドの idx データ保存ディレクトリ
-$_conf['idx_dir'] = "./data"; // ("./data")
+$_conf['idx_dir'] = P2_BASE_DIR . '/data/idx';
// 初期設定データ保存ディレクトリ
-$_conf['pref_dir'] = "./data"; // ("./data")
+$_conf['pref_dir'] = P2_BASE_DIR . '/data/pref';
// SQLite3データベース保存ディレクトリ
-$_conf['db_dir'] = "./data/db"; // ("./data/db")
-
-// 将来的には以下のようにしたい予定
-// $_conf['dat_dir'] = $_conf['data_dir'] . '/dat';
-// $_conf['idx_dir'] = $_conf['data_dir'] . '/idx';
-// $_conf['pref_dir'] = $_conf['data_dir'] . '/pref';
+$_conf['db_dir'] = P2_BASE_DIR . '/data/db';
// }}}
// ----------------------------------------------------------------------
@@ -178,7 +173,7 @@
// ----------------------------------------------------------------------
// {{{ 拡張パック
-include P2_CONF_DIR . '/conf_admin_ex.inc.php';
+include P2_CONFIG_DIR . '/conf_admin_ex.inc.php';
// }}}
View
11 conf/conf_ic2.inc.php
@@ -5,15 +5,16 @@
// {{{ 全般
-// キャッシュ保存ディレクトリのパス
-$_conf['expack.ic2.general.cachedir'] = "./cache";
+// キャッシュ保存ディレクトリのパスとURI
+$_conf['expack.ic2.general.cachedir'] = P2_WWW_DIR . '/ic';
+$_conf['expack.ic2.general.cacheuri'] = './ic';
// DSN (DBに接続するためのデータソース名)
// @link http://jp.pear.php.net/manual/ja/package.database.db.intro-dsn.php
// 例)
-// MySQL: "mysql://username:password@localhost:3306/database"
-// PostgreSQL: "pgsql://username:password@localhost:5432/database"
-// SQLite2: "sqlite:///./cache/imgcache.sqlite"
+// MySQL: 'mysql://username:password@localhost:3306/database'
+// PostgreSQL: 'pgsql://username:password@localhost:5432/database'
+// SQLite2: 'sqlite:///' . $_conf['db_dir'] . '/imgcache.sqlite'
// 注1: username,password,databaseは実際のものと読み替える。
// 注2: MySQL,PosrgreSQLでは予めデータベースを作っておく。
$_conf['expack.ic2.general.dsn'] = "";
View
6 conf/conf_user_def.inc.php
@@ -493,13 +493,13 @@
// }}}
// {{{ 拡張パックとiPhone
-include P2_CONF_DIR . '/conf_user_def_ex.inc.php';
-include P2_CONF_DIR . '/conf_user_def_i.inc.php';
+include P2_CONFIG_DIR . '/conf_user_def_ex.inc.php';
+include P2_CONFIG_DIR . '/conf_user_def_i.inc.php';
// }}}
// {{{ ■+Wiki
-include P2_CONF_DIR . '/conf_user_def_wiki.inc.php';
+include P2_CONFIG_DIR . '/conf_user_def_wiki.inc.php';
// }}}
View
1  data/dat/.gitignore
@@ -0,0 +1 @@
+*
View
1  data/db/.gitignore
@@ -0,0 +1 @@
+*
View
1  data/idx/.gitignore
@@ -0,0 +1 @@
+*
View
1  data/logs/.gitignore
@@ -0,0 +1 @@
+*
View
1  data/misc/.gitignore
@@ -0,0 +1 @@
+*
View
1  data/pref/.gitignore
@@ -0,0 +1 @@
+*
View
2  doc/ImageCache2/ic2_install.phps
@@ -5,7 +5,7 @@
// {{{ p2��{�ݒ�ǂݍ��݁��F��
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
View
3  init.php
@@ -0,0 +1,3 @@
+<?php
+set_include_path('phar://' . __DIR__ . '/p2pear.phar');
+require __DIR__ . '/conf/conf.inc.php';
View
3  lib/.htaccess
@@ -1,3 +0,0 @@
-Order allow,deny
-Deny from all
-Allow from none
View
6 lib/P2CommandRunner.php
@@ -5,8 +5,8 @@
// {{{ CONSTANTS
-if (!defined('P2_CLI_DIR')) {
- define('P2_CLI_DIR', realpath(__DIR__ . '/../cli'));
+if (!defined('P2_SCRIPT_DIR')) {
+ define('P2_SCRIPT_DIR', realpath(__DIR__ . '/../script'));
}
// }}}
@@ -36,7 +36,7 @@ static public function fetchSubjectTxt($mode, array $_conf)
$args[] = '-d';
$args[] = 'extension=' . escapeshellarg('http.' . PHP_SHLIB_SUFFIX);
}
- $args[] = escapeshellarg(P2_CLI_DIR . DIRECTORY_SEPARATOR . 'fetch-subject-txt.php');
+ $args[] = escapeshellarg(P2_SCRIPT_DIR . DIRECTORY_SEPARATOR . 'fetch-subject-txt.php');
switch ($mode) {
case 'fav':
View
12 lib/ShowThreadK.php
@@ -1055,13 +1055,13 @@ public function plugin_imageCache2($url, $purl, $str)
}
// オリジナルの有無を確認
- $_src_url = $this->thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ $_src_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($_src_url)) {
$src_exists = true;
$img_url = $img_url2 . $icdb->id;
$src_url = $_src_url;
} else {
- $img_url = $this->thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ $img_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
$src_url = $src_url2 . $icdb->id;
}
@@ -1072,7 +1072,7 @@ public function plugin_imageCache2($url, $purl, $str)
if (!isset($this->inline_prvw) || !is_object($this->inline_prvw)) {
$this->inline_prvw = $this->thumbnailer;
}
- $prv_url = $this->inline_prvw->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ $prv_url = $this->inline_prvw->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
// サムネイル表示制限数以内のとき
if ($inline_preview_flag) {
@@ -1250,13 +1250,13 @@ public function plugin_replaceImageUrl($url, $purl, $str)
}
// オリジナルの有無を確認
- $_src_url = $this->thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ $_src_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($_src_url)) {
$src_exists = true;
$img_url = $img_url2 . $icdb->id;
$src_url = $_src_url;
} else {
- $img_url = $this->thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ $img_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
$src_url = $src_url2 . $icdb->id;
}
@@ -1267,7 +1267,7 @@ public function plugin_replaceImageUrl($url, $purl, $str)
if (!isset($this->inline_prvw) || !is_object($this->inline_prvw)) {
$this->inline_prvw = $this->thumbnailer;
}
- $prv_url = $this->inline_prvw->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ $prv_url = $this->inline_prvw->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
// サムネイル表示制限数以内のとき
if ($inline_preview_flag) {
View
8 lib/ShowThreadPc.php
@@ -1546,7 +1546,7 @@ public function plugin_imageCache2($url, $purl, $str,
}
// オリジナルがキャッシュされているときは画像を直接読み込む
- $_img_url = $this->thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ $_img_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($_img_url)) {
$img_url = $_img_url;
$cached = true;
@@ -1555,7 +1555,7 @@ public function plugin_imageCache2($url, $purl, $str,
}
// サムネイルが作成されていているときは画像を直接読み込む
- $_thumb_url = $this->thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ $_thumb_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($_thumb_url)) {
$thumb_url = $_thumb_url;
// 自動スレタイメモ機能がONでスレタイが記録されていないときはDBを更新
@@ -1719,7 +1719,7 @@ public function plugin_replaceImageUrl($url, $purl, $str)
}
// オリジナルがキャッシュされているときは画像を直接読み込む
- $_img_url = $this->thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ $_img_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($_img_url)) {
$img_url = $_img_url;
$cached = true;
@@ -1728,7 +1728,7 @@ public function plugin_replaceImageUrl($url, $purl, $str)
}
// サムネイルが作成されていているときは画像を直接読み込む
- $_thumb_url = $this->thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ $_thumb_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($_thumb_url)) {
$thumb_url = $_thumb_url;
// 自動スレタイメモ機能がONでスレタイが記録されていないときはDBを更新
View
12 lib/bootstrap.php
@@ -47,7 +47,7 @@
}
// デフォルト設定を読み込み、ユーザー設定とともにマージ
- include P2_CONF_DIR . '/conf_user_def.inc.php';
+ include P2_CONFIG_DIR . '/conf_user_def.inc.php';
$_conf = array_merge($_conf, $conf_user_def, $conf_user);
$save_conf_user = true;
} else {
@@ -57,7 +57,7 @@
}
} else {
// デフォルト設定を読み込み、マージ
- include P2_CONF_DIR . '/conf_user_def.inc.php';
+ include P2_CONFIG_DIR . '/conf_user_def.inc.php';
$_conf = array_merge($_conf, $conf_user_def);
$save_conf_user = true;
}
@@ -292,7 +292,7 @@
// {{{ デザイン設定 読込
$skin_name = $default_skin_name = 'conf_user_style';
-$skin = P2_CONF_DIR . '/conf_user_style.inc.php';
+$skin = P2_CONFIG_DIR . '/conf_user_style.inc.php';
if (!$_conf['ktai'] && $_conf['expack.skin.enabled']) {
// 保存されているスキン名
$saved_skin_name = null;
@@ -347,7 +347,7 @@
if (!file_exists($skin)) {
$skin_name = 'conf_user_style';
- $skin = P2_CONF_DIR . '/conf_user_style.inc.php';
+ $skin = P2_CONFIG_DIR . '/conf_user_style.inc.php';
}
$skin_en = rawurlencode($skin_name) . '&amp;_=' . P2_VERSION_ID;
if ($_conf['view_forced_by_query']) {
@@ -355,9 +355,9 @@
}
// デフォルト設定を読み込んで
-include P2_CONF_DIR . '/conf_user_style.inc.php';
+include P2_CONFIG_DIR . '/conf_user_style.inc.php';
// スキンで上書き
-if ($skin != P2_CONF_DIR . '/conf_user_style.inc.php') {
+if ($skin != P2_CONFIG_DIR . '/conf_user_style.inc.php') {
include $skin;
}
View
10 lib/expack/ic2/DatabaseManager.php
@@ -71,6 +71,8 @@ static public function update($updated)
*/
static public function remove($target, $to_blacklist = false)
{
+ $ini = ic2_loadconfig();
+
$removed_files = array();
if (empty($target)) {
return $removed_files;
@@ -99,6 +101,8 @@ static public function remove($target, $to_blacklist = false)
}
// 画像を削除
+ $parent_dir = dirname($ini['General']['cachedir']) . DIRECTORY_SEPARATOR;
+ $pattern = '/^' . preg_quote($parent_dir, '/') . '/';
foreach ($target as $id) {
$icdb = new IC2_DataObject_Images();
$icdb->whereAdd("id = {$id}");
@@ -121,7 +125,7 @@ static public function remove($target, $to_blacklist = false)
$path = $t->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($path)) {
unlink($path);
- $removed_files[] = $path;
+ $removed_files[] = preg_replace($pattern, '', $path);
}
}
}
@@ -129,7 +133,7 @@ static public function remove($target, $to_blacklist = false)
$path = $t->srcPath($icdb->size, $icdb->md5, $icdb->mime);
if (file_exists($path)) {
unlink($path);
- $removed_files[] = $path;
+ $removed_files[] = preg_replace($pattern, '', $path);
}
// ブラックリスト送りの準備
@@ -137,7 +141,7 @@ static public function remove($target, $to_blacklist = false)
$_blacklist = new IC2_DataObject_BlackList();
$_blacklist->size = $icdb->size;
$_blacklist->md5 = $icdb->md5;
- if ($icdb->mime == 'clamscan/infected' || $icdb->rank == -4) {
+ if ($icdb->mime === 'clamscan/infected' || $icdb->rank == -4) {
$_blacklist->type = 2;
} elseif ($icdb->rank < 0) {
$_blacklist->type = 1;
View
8 lib/expack/ic2/ImageInfo.php
@@ -22,7 +22,7 @@ static public function getExtraInfo($img)
$add['uri_w'] = $img['uri'];
}
- if ($img['mime'] == 'clamscan/infected') {
+ if ($img['mime'] === 'clamscan/infected') {
// ウィルスに感染していたファイルのとき
$add['src'] = './img/x04.png';
@@ -32,9 +32,9 @@ static public function getExtraInfo($img)
} else {
- // ソースとサムネイルのパスを取得
- $add['src'] = $thumb->srcPath($icdb->size, $icdb->md5, $icdb->mime);
- $add['thumb'] = $thumb->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ // ソースとサムネイルのURLを取得
+ $add['src'] = $thumb->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
+ $add['thumb'] = $thumb->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
// サムネイルの縦横の大きさを計算
$m = explode('x', $thumb->calc($icdb->width, $icdb->height));
View
134 lib/expack/ic2/Thumbnailer.php
@@ -28,8 +28,11 @@ class IC2_Thumbnailer
public $ini; // @var array ImageCache2の設定
public $mode; // @var int サムネイルの種類
public $cachedir; // @var string ImageCache2のキャッシュ保存ディレクトリ
+ public $cacheuri; // @var string ImageCache2のキャッシュ保存ディレクトリのURI
public $sourcedir; // @var string ソース保存ディレクトリ
+ public $sourceuri; // @var string ソース保存ディレクトリのURI
public $thumbdir; // @var string サムネイル保存ディレクトリ
+ public $thumburi; // @var string サムネイル保存ディレクトリのURI
public $driver; // @var string イメージドライバの種類
public $epeg; // @var bool Epegが利用可能か否か
public $magick; // @var string ImageMagickのパス
@@ -163,10 +166,13 @@ public function __construct($mode = self::SIZE_DEFAULT, array $dynamic_options =
$this->error('無効なイメージドライバです。');
}
- // ディレクトリ設定
- $this->cachedir = $this->ini['General']['cachedir'];
- $this->sourcedir = $this->cachedir . '/' . $this->ini['Source']['name'];
- $this->thumbdir = $this->cachedir . '/' . $setting['name'];
+ // ディレクトリ/URI設定
+ $this->cachedir = $this->ini['General']['cachedir'];
+ $this->sourcedir = $this->cachedir . DIRECTORY_SEPARATOR . $this->ini['Source']['name'];
+ $this->thumbdir = $this->cachedir . DIRECTORY_SEPARATOR . $setting['name'];
+ $this->cacheuri = $this->ini['General']['cacheuri'];
+ $this->sourceuri = $this->cacheuri . '/' . $this->ini['Source']['name'];
+ $this->thumburi = $this->cacheuri . '/' . $setting['name'];
// サムネイルの画像形式・幅・高さ・回転角度・品質設定
$rotate = (int) $options['rotate'];
@@ -244,7 +250,8 @@ public function __construct($mode = self::SIZE_DEFAULT, array $dynamic_options =
* テンポラリ・サムネイルの生成に成功したとき、true
* 失敗したとき PEAR_Error
*/
- public function convert($size, $md5, $mime, $width, $height, $force = false, $anigif = false, $gifcaution = false)
+ public function convert($size, $md5, $mime, $width, $height,
+ $force = false, $anigif = false, $gifcaution = false)
{
// 画像
if (!empty($this->intermd) && file_exists($this->intermd)) {
@@ -255,8 +262,8 @@ public function convert($size, $md5, $mime, $width, $height, $force = false, $an
} else {
$src = $this->srcPath($size, $md5, $mime, true);
}
- $thumbURL = $this->thumbPath($size, $md5, $mime);
- $thumb = $this->thumbPath($size, $md5, $mime, true);
+ $thumbUrl = $this->thumbUrl($size, $md5, $mime);
+ $thumbPath = $this->thumbPath($size, $md5, $mime);
if ($src == false) {
$error = PEAR::raiseError("無効なMIMEタイプ。({$mime})");
return $error;
@@ -264,39 +271,39 @@ public function convert($size, $md5, $mime, $width, $height, $force = false, $an
$error = PEAR::raiseError("ソース画像がキャッシュされていません。({$src})");
return $error;
}
- if (!$force && !$this->dynamic && file_exists($thumb)) {
- return $thumbURL;
+ if (!$force && !$this->dynamic && file_exists($thumbPath)) {
+ return $thumbUrl;
}
- $thumbdir = dirname($thumb);
- if (!is_dir($thumbdir) && !@mkdir($thumbdir)) {
- $error = PEAR::raiseError("ディレクトリを作成できませんでした。({$thumbdir})");
+ $thumbDir = dirname($thumbPath);
+ if (!is_dir($thumbDir) && !@mkdir($thumbDir)) {
+ $error = PEAR::raiseError("ディレクトリを作成できませんでした。({$thumbDir})");
return $error;
}
// サイズが既定値以下で回転なし、画像形式が同じならばそのままコピー
// --- 携帯で表示できないことがあるので封印、ちゃんとサムネイルをつくる
/*if ($this->resize == false && $this->rotate == 0 && $this->type == $this->mimemap[$mime]) {
- if (@copy($src, $thumb)) {
- return $thumbURL;
+ if (@copy($src, $thumbPath)) {
+ return $thumbUrl;
} else {
- $error = PEAR::raiseError("画像をコピーできませんでした。({$src} -&gt; {$thumb})");
+ $error = PEAR::raiseError("画像をコピーできませんでした。({$src} -&gt; {$thumbPath})");
return $error;
}
}*/
// Epegでサムネイルを作成
- if ($mime == 'image/jpeg' && $this->epeg) {
- $dst = ($this->dynamic) ? '' : $thumb;
+ if ($mime === 'image/jpeg' && $this->epeg) {
+ $dst = ($this->dynamic) ? '' : $thumbPath;
list($max_width, $max_height) = $this->getMaxImageSize();
$result = epeg_thumbnail_create($src, $dst, $max_width, $max_height, $this->quality);
- if ($result == false) {
+ if ($result === false) {
$error = PEAR::raiseError("サムネイルを作成できませんでした。({$src} -&gt; {$dst})");
return $error;
}
if ($this->dynamic) {
$this->buf = $result;
}
- return $thumbURL;
+ return $thumbUrl;
}
// 出力サイズを計算
@@ -328,7 +335,7 @@ public function convert($size, $md5, $mime, $width, $height, $force = false, $an
$convertor->setResampling($this->resize);
$convertor->setRotation($this->rotate);
$convertor->setTrimming($this->trim);
- if ($this->driver == 'imagemagick') {
+ if ($this->driver === 'imagemagick') {
$convertor->setImageMagickConvertPath($this->magick);
}
if ($anigif) {
@@ -346,13 +353,13 @@ public function convert($size, $md5, $mime, $width, $height, $force = false, $an
$this->buf = $result;
}
} else {
- $result = $convertor->save($src, $thumb, $size);
+ $result = $convertor->save($src, $thumbPath, $size);
}
if (PEAR::isError($result)) {
return $result;
}
- return $thumbURL;
+ return $thumbUrl;
}
// }}}
@@ -449,32 +456,56 @@ public function calc($width, $height, $return_array = false)
}
// }}}
- // {{{ srcPath()
+ // {{{ getSource()
/**
- * ソース画像のパスを取得
+ * ソースパスを取得
*/
- public function srcPath($size, $md5, $mime, $FSFullPath = false)
+ public function getSource($size, $md5, $mime, $fullPath)
{
- $directory = $this->getSubDir($this->sourcedir, $size, $md5, $mime, $FSFullPath);
+ $basedir = $fullPath ? $this->sourcedir : $this->sourceuri;
+ $directory = $this->getSubDir($basedir, $size, $md5, $mime, $fullPath);
if (!$directory) {
return false;
}
$basename = $size . '_' . $md5 . $this->mimemap[$mime];
- return $directory . ($FSFullPath ? DIRECTORY_SEPARATOR : '/') . $basename;
+ return $directory . ($fullPath ? DIRECTORY_SEPARATOR : '/') . $basename;
}
// }}}
- // {{{ thumbPath()
+ // {{{ srcPath()
+
+ /**
+ * ソース画像のパスを取得
+ */
+ public function srcPath($size, $md5, $mime)
+ {
+ return $this->getSource($size, $md5, $mime, true);
+ }
+
+ // }}}
+ // {{{ srcUrl()
+
+ /**
+ * ソース画像のUrlを取得
+ */
+ public function srcUrl($size, $md5, $mime)
+ {
+ return $this->getSource($size, $md5, $mime, false);
+ }
+
+ // }}}
+ // {{{ getThumbnail()
/**
* サムネイルのパスを取得
*/
- public function thumbPath($size, $md5, $mime, $FSFullPath = false)
+ public function getThumbnail($size, $md5, $mime, $fullPath)
{
- $directory = $this->getSubDir($this->thumbdir, $size, $md5, $mime, $FSFullPath);
+ $basedir = $fullPath ? $this->thumbdir : $this->thumburi;
+ $directory = $this->getSubDir($basedir, $size, $md5, $mime, $fullPath);
if (!$directory) {
return false;
}
@@ -496,7 +527,29 @@ public function thumbPath($size, $md5, $mime, $FSFullPath = false)
}
$basename .= $this->type;
- return $directory . ($FSFullPath ? DIRECTORY_SEPARATOR : '/') . $basename;
+ return $directory . ($fullPath ? DIRECTORY_SEPARATOR : '/') . $basename;
+ }
+
+ // }}}
+ // {{{ thumbPath()
+
+ /**
+ * サムネイルのパスを取得
+ */
+ public function thumbPath($size, $md5, $mime)
+ {
+ return $this->getThumbnail($size, $md5, $mime, true);
+ }
+
+ // }}}
+ // {{{ thumbUrl()
+
+ /**
+ * サムネイルのURLを取得
+ */
+ public function thumbUrl($size, $md5, $mime)
+ {
+ return $this->getThumbnail($size, $md5, $mime, false);
}
// }}}
@@ -505,21 +558,16 @@ public function thumbPath($size, $md5, $mime, $FSFullPath = false)
/**
* 画像が保存されるサブディレクトリのパスを取得
*/
- public function getSubDir($basedir, $size, $md5, $mime, $FSFullPath = false)
+ public function getSubDir($basedir, $size, $md5, $mime, $fullPath = false)
{
- if (!is_dir($basedir)) {
- return false;
- }
-
$dirID = $this->dirID($size, $md5, $mime);
-
- if ($FSFullPath) {
- $directory = realpath($basedir) . DIRECTORY_SEPARATOR . $dirID;
- } else {
- $directory = $basedir . '/' . $dirID;
+ if ($fullPath) {
+ if (!is_dir($basedir)) {
+ return false;
+ }
+ return realpath($basedir) . DIRECTORY_SEPARATOR . $dirID;
}
-
- return $directory;
+ return $basedir . '/' . $dirID;
}
// }}}
View
3  lib/expack/ic2/bootstrap.php
@@ -37,7 +37,8 @@ function ic2_loadconfig()
static $ini = null;
if (is_null($ini)) {
- include P2_CONF_DIR . '/conf_ic2.inc.php';
+ $_conf = $GLOBALS['_conf'];
+ include P2_CONFIG_DIR . '/conf_ic2.inc.php';
$ini = array();
$_ic2conf = preg_grep('/^expack\\.ic2\\.\\w+\\.\\w+$/', array_keys($_conf));
View
18 lib/expack/rss/getimage.inc.php
@@ -88,17 +88,17 @@ function rss_get_image_ic2($src_url, $memo='')
}
// オリジナルがキャッシュされているときは画像を直接読み込む
- $_img_url = $thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
- if (file_exists($_img_url)) {
- $img_url = $_img_url;
+ $_img_path = $thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ if (file_exists($_img_path)) {
+ $img_url = $thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
$img_size = "width=\"{$icdb->width}\" height=\"{$icdb->height}\"";
$src_exists = true;
}
// サムネイルが作成されていているときは画像を直接読み込む
- $_thumb_url = $thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
- if (file_exists($_thumb_url)) {
- $thumb_url = $_thumb_url;
+ $_thumb_path = $thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ if (file_exists($_thumb_path)) {
+ $thumb_url = $thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
// 自動タイトルメモ機能がONでタイトルが記録されていないときはDBを更新
if (!is_null($img_memo) && strpos($icdb->memo, $img_memo) === false){
$update = new IC2_DataObject_Images();
@@ -115,9 +115,9 @@ function rss_get_image_ic2($src_url, $memo='')
}
// 携帯用サムネイルが作成されていているときは画像を直接読み込む
- $_thumb_k_url = $thumbnailer_k->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
- if (file_exists($_thumb_k_url)) {
- $thumb_k_url = $_thumb_k_url;
+ $_thumb_k_path = $thumbnailer_k->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ if (file_exists($_thumb_k_path)) {
+ $thumb_k_url = $thumbnailer_k->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
} elseif ($src_exists) {
$thumb_k_url = $thumb_k_url2 . $icdb->id;
}
View
4 lib/startup.funcs.php
@@ -12,7 +12,7 @@
*/
function p2_check_environment($check_recommended)
{
- include P2_CONF_DIR . '/setup_info.php';
+ include P2_CONFIG_DIR . '/setup_info.php';
$php_version = phpversion();
@@ -81,7 +81,7 @@ function p2_check_environment($check_recommended)
*/
function p2_check_migration($config_version)
{
- include P2_CONF_DIR . '/setup_info.php';
+ include P2_CONFIG_DIR . '/setup_info.php';
$migrators = array();
$found = false;
View
2  aas.php → rep2/aas.php
@@ -34,7 +34,7 @@
// {{{ p2基本設定読み込み&認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
View
2  cookie.php → rep2/cookie.php
@@ -5,7 +5,7 @@
* 内部文字エンコーディング: Shift_JIS
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
2  css.php → rep2/css.php
@@ -5,7 +5,7 @@
// {{{ 初期設定読み込み & ユーザ認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
require_once P2_STYLE_DIR . '/mystyle_css.php';
View
0  css/blank.css → rep2/css/blank.css
File renamed without changes
View
0  css/ic2_iphone.css → rep2/css/ic2_iphone.css
File renamed without changes
View
0  css/ic2_popinfo.css → rep2/css/ic2_popinfo.css
File renamed without changes
View
0  css/iphone.css → rep2/css/iphone.css
File renamed without changes
View
0  css/iv2_iphone.css → rep2/css/iv2_iphone.css
File renamed without changes
View
0  css/lightbox/lightbox-ie6.css → rep2/css/lightbox/lightbox-ie6.css
File renamed without changes
View
0  css/lightbox/lightbox.css → rep2/css/lightbox/lightbox.css
File renamed without changes
View
0  css/limelight.css → rep2/css/limelight.css
File renamed without changes
View
0  css/menu_i.css → rep2/css/menu_i.css
File renamed without changes
View
0  css/tabber/tabber.css → rep2/css/tabber/tabber.css
File renamed without changes
View
0  css/yui/screen.css → rep2/css/yui/screen.css
File renamed without changes
View
2  edit_aborn_word.php → rep2/edit_aborn_word.php
@@ -3,7 +3,7 @@
* rep2 - あぼーんワード編集インタフェース
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
4 edit_conf_user.php → rep2/edit_conf_user.php
@@ -3,7 +3,7 @@
* rep2 - ユーザ設定編集UI
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
@@ -24,7 +24,7 @@
define('P2_EDIT_CONF_FILE_ADMIN', 1024);
define('P2_EDIT_CONF_FILE_ADMIN_EX', 2048);
-include P2_CONF_DIR . '/conf_user_def.inc.php';
+include P2_CONFIG_DIR . '/conf_user_def.inc.php';
//=====================================================================
// 前処理
View
0  edit_dat_plugin.php → rep2/edit_dat_plugin.php
File renamed without changes
View
0  edit_link_plugin.php → rep2/edit_link_plugin.php
File renamed without changes
View
0  edit_ng_thread.php → rep2/edit_ng_thread.php
File renamed without changes
View
0  edit_replace_imageurl.php → rep2/edit_replace_imageurl.php
File renamed without changes
View
2  edit_user_font.php → rep2/edit_user_font.php
@@ -6,7 +6,7 @@
// {{{ 初期化
// 初期設定読み込み & ユーザ認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
require_once P2_LIB_DIR . '/fontconfig.inc.php';
View
2  editfavita.php → rep2/editfavita.php
@@ -3,7 +3,7 @@
* rep2 - お気に入り編集
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
2  editfile.php → rep2/editfile.php
@@ -3,7 +3,7 @@
ファイルをブラウザで編集する
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
2  editpref.php → rep2/editpref.php
@@ -3,7 +3,7 @@
* rep2 - 設定管理
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
2  editrss.php → rep2/editrss.php
@@ -3,7 +3,7 @@
* rep2expck - RSSリスト編集
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
0  favicon.ico → rep2/favicon.ico
File renamed without changes
View
2  first_cont.php → rep2/first_cont.php
@@ -4,7 +4,7 @@
* フレーム3分割画面、右下部分
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
0  hissi.php → rep2/hissi.php
File renamed without changes
View
2  httpcmd.php → rep2/httpcmd.php
@@ -5,7 +5,7 @@
* 返り値は、テキストで返す
*/
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize(); // ユーザ認証
View
1  rep2/ic/.gitignore
@@ -0,0 +1 @@
+*
View
58 ic2.php → rep2/ic2.php
@@ -7,7 +7,7 @@
define('P2_OUTPUT_XHTML', 1);
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
@@ -175,6 +175,7 @@ public function __destruct()
// 画像がキャッシュされているか確認
$search = new IC2_DataObject_Images();
$filepath = null;
+$fileurl = null;
$mtime = -1;
$retry = false;
@@ -237,13 +238,14 @@ public function __destruct()
// ファイルが保存されていればそれでよし、保存されていなければレコードを削除する。
if (file_exists($filepath)) {
+ $fileurl = $thumbnailer->srcUrl($search->size, $search->md5, $search->mime);
if ($force) {
$_size = $search->size;
$_md5 = $search->md5;
$_mime = $search->mime;
$mtime = $search->time;
} else {
- ic2_finish($filepath, $thumb, $params, false);
+ ic2_finish($fileurl, $thumb, $params, false);
}
} else {
$retry = true;
@@ -367,9 +369,9 @@ public function __destruct()
if (PEAR::isError($code)) {
ic2_error('x02', $code->getMessage());
-} elseif ($filepath && $mtime > 0 && $code == 304) {
+} elseif ($fileurl && $mtime > 0 && $code == 304) {
// 304 Not Modified のとき
- ic2_finish($filepath, $thumb, $params, false);
+ ic2_finish($fileurl, $thumb, $params, false);
} elseif ($code != 200) {
ic2_error($code);
}
@@ -444,8 +446,8 @@ public function __destruct()
$height = $info[1];
// 強制更新を試みたものの、更新されていなかったとき(レスポンスコードは200)
-if ($filepath && $force && $mtime > 0 && $size == $_size && $md5 == $_md5 && $mime == $_mime) {
- ic2_finish($filepath, $thumb, $params, false);
+if ($fileurl && $force && $mtime > 0 && $size == $_size && $md5 == $_md5 && $mime == $_mime) {
+ ic2_finish($fileurl, $thumb, $params, false);
}
$params = compact('uri', 'host', 'name', 'size', 'md5', 'width', 'height', 'mime', 'memo');
@@ -463,6 +465,7 @@ public function __destruct()
// すべてのチェックをパスしたなら、保存用の名前にリネームする
$newfile = $thumbnailer->srcPath($size, $md5, $mime);
+$newurl = $thumbnailer->srcUrl($size, $md5, $mime);
$newdir = dirname($newfile);
if (!is_dir($newdir) && !@mkdir($newdir)) {
ic2_error('x02', "ディレクトリを作成できませんでした。({$newdir})");
@@ -509,7 +512,7 @@ public function __destruct()
}
}
// 画像を表示
-ic2_finish($newfile, $thumb, $params, $force, $ini['Thumbdeco']['anigif'] ? $is_anigif : false, $is_gif_caution);
+ic2_finish($newurl, $thumb, $params, $force, $ini['Thumbdeco']['anigif'] ? $is_anigif : false, $is_gif_caution);
// }}}
// {{{ 関数
@@ -643,27 +646,24 @@ function ic2_checkSizeOvered($tmpfile, $params)
// }}}
// {{{ ic2_display()
-function ic2_display($path, $params)
+function ic2_display($url, $params)
{
global $_conf, $ini, $thumb, $dpr, $redirect, $id, $uri, $file, $thumbnailer;
- if (P2_OS_WINDOWS) {
- $path = str_replace('\\', '/', $path);
- }
- if (strncmp($path, '/', 1) == 0) {
+ if (strncmp($url, '/', 1) === 0) {
$s = empty($_SERVER['HTTPS']) ? '' : 's';
- $to = 'http' . $s . '://' . $_SERVER['HTTP_HOST'] . $path;
+ $to = 'http' . $s . '://' . $_SERVER['HTTP_HOST'] . $url;
} else {
$dir = dirname(P2Util::getMyUrl());
- if (strncasecmp($path, './', 2) == 0) {
- $to = $dir . substr($path, 1);
- } elseif (strncasecmp($path, '../', 3) == 0) {
- $to = dirname($dir) . substr($path, 2);
+ if (strncasecmp($url, './', 2) == 0) {
+ $to = $dir . substr($url, 1);
+ } elseif (strncasecmp($url, '../', 3) == 0) {
+ $to = dirname($dir) . substr($url, 2);
} else {
- $to = $dir . '/' . $path;
+ $to = $dir . '/' . $url;
}
}
- $name = basename($path);
+ $name = basename($url);
$ext = strrchr($name, '.');
switch ($redirect) {
@@ -685,8 +685,8 @@ function ic2_display($path, $params)
}
}
header("Content-Disposition: inline; filename=\"{$name}\"");
- header('Content-Length: ' . filesize($path));
- readfile($path);
+ header('Content-Length: ' . filesize($url));
+ readfile($url);
exit;
default:
if (!class_exists('HTML_Template_Flexy', false)) {
@@ -814,7 +814,7 @@ function ic2_display($path, $params)
$link = null;
} else {
$t = 1;
- $link = $path;
+ $link = $url;
}
$r = ($ini['General']['redirect'] == 1) ? 1 : 2;
$preview = "{$_SERVER['SCRIPT_NAME']}?o=1&r={$r}&t={$t}&{$img_q}{$k_at_a}";
@@ -823,7 +823,7 @@ function ic2_display($path, $params)
$flexy->setData('info', null);
} else {
$flexy->setData('preview', null);
- $flexy->setData('link', $path);
+ $flexy->setData('link', $url);
$flexy->setData('info', null);
}
@@ -967,20 +967,20 @@ function ic2_error($code, $optmsg = '', $write_log = true)
// }}}
// {{{ ic2_finish()
-function ic2_finish($filepath, $thumb, $params, $force, $anigif = false, $gif_caution = false)
+function ic2_finish($fileurl, $thumb, $params, $force, $anigif = false, $gif_caution = false)
{
global $thumbnailer;
extract($params);
if ($thumb == 0) {
- ic2_display($filepath, $params);
+ ic2_display($fileurl, $params);
} else {
- $thumbpath = $thumbnailer->convert($size, $md5, $mime, $width, $height, $force, $anigif, $gif_caution);
- if (PEAR::isError($thumbpath)) {
- ic2_error('x02', $thumbpath->getMessage());
+ $thumburl = $thumbnailer->convert($size, $md5, $mime, $width, $height, $force, $anigif, $gif_caution);
+ if (PEAR::isError($thumburl)) {
+ ic2_error('x02', $thumburl->getMessage());
}
- ic2_display($thumbpath, $params);
+ ic2_display($thumburl, $params);
}
}
View
6 ic2_fitimage.php → rep2/ic2_fitimage.php
@@ -5,7 +5,7 @@
// {{{ p2基本設定読み込み&認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
require_once P2EX_LIB_DIR . '/ic2/bootstrap.php';
$_login->authorize();
@@ -23,7 +23,7 @@
$icdb = new IC2_DataObject_Images();
$thumbnailer = new IC2_Thumbnailer(IC2_Thumbnailer::SIZE_DEFAULT);
-if (preg_match('/^' . preg_quote($thumbnailer->sourcedir, '/') . '/', $url) && file_exists($url)) {
+if (preg_match('/^' . preg_quote($thumbnailer->sourceuri, '/') . '/', $url) && file_exists($url)) {
$info = getimagesize($url);
$x = $info[0];
$y = $info[1];
@@ -32,7 +32,7 @@
} elseif (preg_match('{(?:[\w.]*/)?ic2\.php\?(?:.*&)?ur[il]=([^&]+)(?:&|$)}', $url, $m)) {
$url = rawurldecode($m[1]);
if ($icdb->get($url)) {
- $url = $thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ $url = $thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
$x = (int)$icdb->width;
$y = (int)$icdb->height;
} else {
View
2  ic2_getcount.php → rep2/ic2_getcount.php
@@ -5,7 +5,7 @@
// {{{ p2基本設定読み込み&認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
View
22 ic2_getinfo.php → rep2/ic2_getinfo.php
@@ -5,7 +5,7 @@
// {{{ p2基本設定読み込み&認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
@@ -59,25 +59,31 @@
$thumbnailer = new IC2_Thumbnailer();
}
-$src = $thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
-$thumb = $thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+$size = (int)$icdb->size;
+$md5 = $icdb->md5;
+$mime = $icdb->mime;
+
+$srcPath = $thumbnailer->srcPath($size, $md5, $mime);
+$thumbPath = $thumbnailer->thumbPath($size, $md5, $mime);
+$srcUrl = $thumbnailer->srcUrl($size, $md5, $mime);
+$thumbUrl = $thumbnailer->thumbUrl($size, $md5, $mime);
echo json_encode(array(
'id' => (int)$icdb->id,
'uri' => $icdb->uri,
'host' => $icdb->host,
'name' => $icdb->name,
- 'size' => (int)$icdb->size,
- 'md5' => $icdb->md5,
+ 'size' => $size,
+ 'md5' => $md5,
'width' => (int)$icdb->width,
'height' => (int)$icdb->height,
- 'mime' => $icdb->mime,
+ 'mime' => $mime,
'rank' => (int)$icdb->rank,
'time' => (int)$icdb->time,
'memo' => $icdb->memo,
'url' => $icdb->uri,
- 'src' => ($src && file_exists($src)) ? $src : null,
- 'thumb' => ($thumb && file_exists($thumb)) ? $thumb : null,
+ 'src' => ($srcPath && file_exists($srcPath)) ? $srcUrl : null,
+ 'thumb' => ($thumbPath && file_exists($thumbPath)) ? $thumbUrl : null,
));
exit;
View
14 ic2_getter.php → rep2/ic2_getter.php
@@ -7,7 +7,7 @@
define('P2_OUTPUT_XHTML', 1);
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
@@ -316,13 +316,13 @@
// 既にキャッシュされているとき
} elseif ($icdb->get($url)) {
- $_src_url = $thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
- if (file_exists($_src_url)) {
- $src_url = $_src_url;
+ $_src_path = $thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime);
+ if (file_exists($_src_path)) {
+ $src_url = $thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime);
}
- $_thumb_url = $thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
- if (file_exists($_thumb_url)) {
- $thumb_url = $_thumb_url;
+ $_thumb_path = $thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime);
+ if (file_exists($_thumb_path)) {
+ $thumb_url = $thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
}
if (preg_match('/(\d+)x(\d+)/', $thumbnailer->calc($icdb->width, $icdb->height), $thumb_xy)) {
$thumb_x = $thumb_xy[1];
View
2  ic2_manager.php → rep2/ic2_manager.php
@@ -7,7 +7,7 @@
define('P2_OUTPUT_XHTML', 1);
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
View
2  ic2_mkthumb.php → rep2/ic2_mkthumb.php
@@ -5,7 +5,7 @@
// {{{ p2基本設定読み込み&認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
ini_set('display_errors', true);
View
2  ic2_setrank.php → rep2/ic2_setrank.php
@@ -5,7 +5,7 @@
// {{{ p2基本設定読み込み&認証
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
View
6 ic2_setter.php → rep2/ic2_setter.php
@@ -7,7 +7,7 @@
define('P2_OUTPUT_XHTML', 1);
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
@@ -280,8 +280,8 @@ function ic2_register_uploaded_file($file)
$file['name'] = p2h($file['name']);
$file['memo'] = $f_memo;
$file['rank'] = $f_rank;
- $file['img_src'] = $thumbnailer->srcPath($file['size'], $file['md5'], $file['mime']);
- $file['thumb'] = $thumbnailer->thumbPath($file['size'], $file['md5'], $file['mime']);
+ $file['img_src'] = $thumbnailer->srcUrl($file['size'], $file['md5'], $file['mime']);
+ $file['thumb'] = $thumbnailer->thumbUrl($file['size'], $file['md5'], $file['mime']);
if (!file_exists($file['thumb'])) {
$file['thumb'] = 'ic2.php?r=1&t=1&file=' . $file['size'] . '_' . $file['md5'];
}
View
2  ic2_viewtable.php → rep2/ic2_viewtable.php
@@ -7,7 +7,7 @@
define('P2_OUTPUT_XHTML', 1);
-require_once './conf/conf.inc.php';
+require_once __DIR__ . '/../init.php';
$_login->authorize();
View
0  img/100.gif → rep2/img/100.gif
File renamed without changes
View
0  img/100.png → rep2/img/100.png
File renamed without changes
View
0  img/101.gif → rep2/img/101.gif
File renamed without changes
View
0  img/101.png → rep2/img/101.png
File renamed without changes
View
0  img/200.gif → rep2/img/200.gif
File renamed without changes
View
0  img/200.png → rep2/img/200.png
File renamed without changes
View
0  img/201.gif → rep2/img/201.gif
File renamed without changes
View
0  img/201.png → rep2/img/201.png
File renamed without changes
View
0  img/202.gif → rep2/img/202.gif
File renamed without changes
View
0  img/202.png → rep2/img/202.png
File renamed without changes
View
0  img/203.gif → rep2/img/203.gif
File renamed without changes
View
0  img/203.png → rep2/img/203.png
File renamed without changes
View
0  img/204.gif → rep2/img/204.gif
File renamed without changes
View
0  img/204.png → rep2/img/204.png
File renamed without changes
View
0  img/206.gif → rep2/img/206.gif
File renamed without changes
View
0  img/206.png → rep2/img/206.png
File renamed without changes
View
0  img/300.gif → rep2/img/300.gif
File renamed without changes
View
0  img/300.png → rep2/img/300.png
File renamed without changes
View
0  img/301.gif → rep2/img/301.gif
File renamed without changes
View
0  img/301.png → rep2/img/301.png
File renamed without changes
View
0  img/302.gif → rep2/img/302.gif
File renamed without changes
View
0  img/302.png → rep2/img/302.png
File renamed without changes
View
0  img/303.gif → rep2/img/303.gif
File renamed without changes
View
0  img/303.png → rep2/img/303.png
File renamed without changes
View
0  img/304.gif → rep2/img/304.gif
File renamed without changes
View
0  img/304.png → rep2/img/304.png
Diff not rendered
View
0  img/305.gif → rep2/img/305.gif
Diff not rendered
View
0  img/305.png → rep2/img/305.png
Diff not rendered
View
0  img/306.gif → rep2/img/306.gif
Diff not rendered
View
0  img/306.png → rep2/img/306.png
Diff not rendered
View
0  img/307.gif → rep2/img/307.gif
Diff not rendered
View
0  img/307.png → rep2/img/307.png
Diff not rendered
View
0  img/400.gif → rep2/img/400.gif
Diff not rendered
View
0  img/400.png → rep2/img/400.png
Diff not rendered
View
0  img/401.gif → rep2/img/401.gif
Diff not rendered
View
0  img/401.png → rep2/img/401.png
Diff not rendered
View
0  img/402.gif → rep2/img/402.gif
Diff not rendered
View
0  img/402.png → rep2/img/402.png
Diff not rendered
View
0  img/403.gif → rep2/img/403.gif
Diff not rendered
View
0  img/403.png → rep2/img/403.png
Diff not rendered
View
0  img/404.gif → rep2/img/404.gif
Diff not rendered
View
0  img/404.png → rep2/img/404.png
Diff not rendered
View
0  img/405.gif → rep2/img/405.gif
Diff not rendered
View
0  img/405.png → rep2/img/405.png
Diff not rendered