svnno****@sourc*****
svnno****@sourc*****
2010年 1月 14日 (木) 00:03:54 JST
Revision: 776 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=776 Author: rsk Date: 2010-01-14 00:03:54 +0900 (Thu, 14 Jan 2010) Log Message: ----------- expack: - 大åã®ã¯ã©ã¹ããªã¼ããã¼ãåã - Cookieã使ããªã端æ«ã§ã¯å¿ ãå¤é¨URLã²ã¼ããéãããã«å¤æ´ã Modified Paths: -------------- p2ex/trunk/aas.php p2ex/trunk/cli/fetch-subject-txt.php p2ex/trunk/conf/conf.inc.php p2ex/trunk/conf/conf_user_def.inc.php p2ex/trunk/edit_conf_user.php p2ex/trunk/editfavita.php p2ex/trunk/editpref.php p2ex/trunk/editrss.php p2ex/trunk/httpcmd.php p2ex/trunk/info.php p2ex/trunk/info_js.php p2ex/trunk/info_sp.php p2ex/trunk/lib/BrdCtl.php p2ex/trunk/lib/HostCheck.php p2ex/trunk/lib/Login.php p2ex/trunk/lib/P2Client.php p2ex/trunk/lib/P2DOM.php p2ex/trunk/lib/P2DataStore/AbstractDataStore.php p2ex/trunk/lib/P2DataStore/PostDataStore.php p2ex/trunk/lib/P2Util.php p2ex/trunk/lib/SettingTxt.php p2ex/trunk/lib/ShowBrdMenuPc.php p2ex/trunk/lib/ShowThread.php p2ex/trunk/lib/ShowThreadK.php p2ex/trunk/lib/ShowThreadPc.php p2ex/trunk/lib/SubjectTxt.php p2ex/trunk/lib/ThreadList.php p2ex/trunk/lib/ThreadRead.php p2ex/trunk/lib/bootstrap.php p2ex/trunk/lib/expack/tgrep/view.inc.php p2ex/trunk/lib/expack/tgrep/view_k.inc.php p2ex/trunk/lib/login2ch.inc.php p2ex/trunk/lib/login_first.inc.php p2ex/trunk/lib/menu.inc.php p2ex/trunk/lib/menu_iphone.inc.php p2ex/trunk/lib/p2util.inc.php p2ex/trunk/lib/post_form_options.inc.php p2ex/trunk/lib/read_footer_k.inc.php p2ex/trunk/lib/sort_threadlist.inc.php p2ex/trunk/lib/subject_new.inc.php p2ex/trunk/menu_async.php p2ex/trunk/menu_i.php p2ex/trunk/menu_k.php p2ex/trunk/post.php p2ex/trunk/read.php p2ex/trunk/read_async.php p2ex/trunk/read_copy_k.php p2ex/trunk/read_filter.php p2ex/trunk/read_new.php p2ex/trunk/read_new_k.php p2ex/trunk/read_res_hist.php p2ex/trunk/spm_k.php p2ex/trunk/subject.php Added Paths: ----------- p2ex/trunk/lib/P2CommandRunner.php p2ex/trunk/lib/P2DataStore/CookieDataStore.php Removed Paths: ------------- p2ex/trunk/cli/P2CommandRunner.php p2ex/trunk/lib/P2DataStore/CookieStore.php -------------- next part -------------- Modified: p2ex/trunk/aas.php =================================================================== --- p2ex/trunk/aas.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/aas.php 2010-01-13 15:03:54 UTC (rev 776) @@ -213,7 +213,6 @@ // XÇÝÝ if (empty($errors) && $_SERVER['REQUEST_METHOD'] != 'POST') { - require_once P2_LIB_DIR . '/ThreadRead.php'; $aThread = new ThreadRead; $aThread->setThreadPathInfo($host, $bbs, $key); if (!$aThread->readDat()) { Deleted: p2ex/trunk/cli/P2CommandRunner.php =================================================================== --- p2ex/trunk/cli/P2CommandRunner.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/cli/P2CommandRunner.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,111 +0,0 @@ -<?php -/** - * rep2expack - command runner - */ - -// {{{ CONSTANTS - -if (!defined('P2_CLI_DIR')) { - define('P2_CLI_DIR', dirname(__FILE__)); -} - -// }}} -// {{{ P2CommandRunner - -/** - * R}hCc[ðç¹é[eBeBNX - * - * @static - */ -class P2CommandRunner -{ - // {{{ fetchSubjectTxt() - - /** - * subject.txtÌÀñ_E[hðÀs·é - * - * @param string $mode - * @param array $_conf - * @return bool - */ - static public function fetchSubjectTxt($mode, array $_conf) - { - // R}h¶¬ - $args = array(escapeshellarg($_conf['expack.php_cli_path'])); - if ($_conf['expack.dl_pecl_http']) { - $args[] = '-d'; - $args[] = 'extension=' . escapeshellarg('http.' . PHP_SHLIB_SUFFIX); - } - $args[] = escapeshellarg(P2_CLI_DIR . DIRECTORY_SEPARATOR . 'fetch-subject-txt.php'); - - switch ($mode) { - case 'fav': - case 'recent': - case 'res_hist': - case 'merge_favita': - $args[] = sprintf('--mode=%s', $mode); - break; - default: - return false; - } - - if ($_conf['expack.misc.multi_favs']) { - switch ($mode) { - case 'fav': - $args[] = sprintf('--set=%d', $_conf['m_favlist_set']); - break; - case 'merge_favita': - $args[] = sprintf('--set=%d', $_conf['m_favita_set']); - break; - } - } - - // WG[oÍðWoÍÉ_CNg - $args[] = '2>&1'; - - $command = implode(' ', $args); - - //$GLOBALS['_info_msg_ht'] .= '<p>' . htmlspecialchars($command, ENT_QUOTES) . '</p>'; - - // Às - $pipe = popen($command, 'r'); - if (!is_resource($pipe)) { - p2die('R}hðÀsūܹñŵ½B', $command); - } - - $output = ''; - while (!feof($pipe)) { - $output .= fgets($pipe); - } - - $status = pclose($pipe); - if ($status != 0) { - $GLOBALS['_info_msg_ht'] .= sprintf('<p>%s(): ERROR(%d)</p>', __METHOD__, $status); - } - - if ($output !== '') { - if ($status == 2) { - $GLOBALS['_info_msg_ht'] .= $output; - } else { - $GLOBALS['_info_msg_ht'] .= '<p>' . nl2br(htmlspecialchars($output, ENT_QUOTES)) . '</p>'; - } - } - - return ($status == 0); - } - - // }}} -} - -// }}} - -/* - * Local Variables: - * mode: php - * coding: cp932 - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ -// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: Modified: p2ex/trunk/cli/fetch-subject-txt.php =================================================================== --- p2ex/trunk/cli/fetch-subject-txt.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/cli/fetch-subject-txt.php 2010-01-13 15:03:54 UTC (rev 776) @@ -18,10 +18,7 @@ define('P2_FETCH_SUBJECT_TXT_DEBUG', 0); define('P2_FETCH_SUBJECT_TXT_DEBUG_OUTPUT_FILE', '/tmp/p2_fetch_subject_txt.log'); -$P2_CONF_DIR = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'conf'; - -require_once $P2_CONF_DIR . DIRECTORY_SEPARATOR . 'conf.inc.php'; -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'P2HttpExt.php'; +require dirname(__FILE__) . '/../conf/conf.inc.php'; require_once 'Console/Getopt.php'; // }}} Modified: p2ex/trunk/conf/conf.inc.php =================================================================== --- p2ex/trunk/conf/conf.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/conf/conf.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -203,12 +203,12 @@ } $include_path .= P2_BASE_DIR; // fallback set_include_path($include_path); + spl_autoload_register('p2autoload'); // }}} // {{{ «`FbNÆfobO // [eBeBðÇÝÞ - include P2_LIB_DIR . '/P2Util.php'; include P2_LIB_DIR . '/p2util.inc.php'; // ®ì«ðmF (vð½µÄ¢éÈçRgAEgÂ) @@ -491,7 +491,54 @@ } // }}} +// {{{ p2autoload() +/** + * NX[_[ + * + * @string $name + * @return void + */ +function p2autoload($name) +{ + if (strncmp($name, 'Wap', 3) === 0) { + include P2_LIB_DIR . '/Wap.php'; + } + if (strncmp($name, 'P2Http', 6) === 0) { + include P2_LIB_DIR . '/P2HttpExt.php'; + } + if (preg_match('/^(?: + BbsMap | + BrdCtl | + BrdMenu | + DataPhp | + FavSetManager | + FileCtl | + HostCheck | + Login | + NgAbornCtl | + P2\\w+ | + PresetManager | + ResHist | + Session | + SettingTxt | + ShowBrdMenu\\w* | + ShowThread\\w* | + StrCtl | + StrSjis | + SubjectTxt | + Thread\\w* + )$/x', $name)) + { + include P2_LIB_DIR . '/' . $name . '.php'; + } + if (preg_match('/^\\w+DataStore$/', $name)) { + include P2_LIB_DIR . '/P2DataStore/' . $name . '.php'; + } +} + +// }}} + /* * Local Variables: * mode: php Modified: p2ex/trunk/conf/conf_user_def.inc.php =================================================================== --- p2ex/trunk/conf/conf_user_def.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/conf/conf_user_def.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -322,9 +322,8 @@ $conf_user_def['res_write_rec'] = 1; // (1) $conf_user_rad['res_write_rec'] = array('1' => '·é', '0' => 'µÈ¢'); -// OURLWv·éÛÉÊ·Q[gB -// i¼Ú:"", p2 ime(©®]):"p2", p2 ime(è®]):"p2m", p2 ime(pÌÝè®]):"p2pm", -// gate.php(©®]1b):"ex", gate.php(©®]0b):"exq", gate.php(è®]):"exm", gate.php(pÌÝè®]):"expm", Google:"google"j +// OURLWv·éÛÉÊ·Q[g +// u¼ÚvÅàCookieªg¦È¢[ÅÍ gate.php ðÊ· $conf_user_def['through_ime'] = "exm"; // ("exm") $conf_user_sel['through_ime'] = array( '' => '¼Ú', Modified: p2ex/trunk/edit_conf_user.php =================================================================== --- p2ex/trunk/edit_conf_user.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/edit_conf_user.php 2010-01-13 15:03:54 UTC (rev 776) @@ -334,7 +334,7 @@ array('rct_rec_num', 'ÅßÇñ¾XÌL^'), array('res_hist_rec_num', '«ÝðÌL^'), array('res_write_rec', '«ÝàeOðL^'), - array('through_ime', 'OURLWv·éÛÉÊ·Q[g'), + array('through_ime', 'OURLWv·éÛÉÊ·Q[g<br>u¼ÚvÅàCookieªg¦È¢[ÅÍ gate.php ðÊ·'), array('ime_manual_ext', 'Q[gÅ©®]µÈ¢g£qiJ}æØèÅAg£qÌOÌsIhÍsvj'), array('join_favrank', '<a href="http://akid.s17.xrea.com/favrank/favrank.html" target="_blank">¨CÉX¤L</a>ÉQÁ'), array('merge_favita', '¨CÉÂÌXêðÜÆßÄ\¦ (¨CÉÂÌÉæÁÄÍÉÔª©©é)'), Modified: p2ex/trunk/editfavita.php =================================================================== --- p2ex/trunk/editfavita.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/editfavita.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,7 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/StrCtl.php'; $_login->authorize(); // [UFØ @@ -19,7 +18,6 @@ } // ¨CÉÂÌzXgð¯ú if (isset($_GET['syncfavita']) or isset($_POST['syncfavita'])) { - require_once P2_LIB_DIR . '/BbsMap.php'; BbsMap::syncBrd($_conf['favita_brd']); } Modified: p2ex/trunk/editpref.php =================================================================== --- p2ex/trunk/editpref.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/editpref.php 2010-01-13 15:03:54 UTC (rev 776) @@ -22,8 +22,6 @@ // zXg̯ú if (isset($_POST['sync'])) { - require_once P2_LIB_DIR . '/BbsMap.php'; - $sync_boards = array(); $sync_indexes = array(); Modified: p2ex/trunk/editrss.php =================================================================== --- p2ex/trunk/editrss.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/editrss.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,7 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/StrCtl.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/httpcmd.php =================================================================== --- p2ex/trunk/httpcmd.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/httpcmd.php 2010-01-13 15:03:54 UTC (rev 776) @@ -275,10 +275,6 @@ return false; } - if (!class_exists('Thread', false)) { - include P2_LIB_DIR . '/Thread.php'; - } - $aThread = new Thread(); $aThread->setThreadPathInfo($host, $bbs, $key); $lines = FileCtl::file_read_lines($aThread->keyidx, FILE_IGNORE_NEW_LINES); @@ -315,10 +311,6 @@ return false; } - if (!class_exists('ThreadRead', false)) { - include P2_LIB_DIR . '/ThreadRead.php'; - } - $data = array(); $aThread = new ThreadRead(); Modified: p2ex/trunk/info.php =================================================================== --- p2ex/trunk/info.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/info.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,7 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/Thread.php'; require_once P2_LIB_DIR . '/dele.inc.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/info_js.php =================================================================== --- p2ex/trunk/info_js.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/info_js.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,7 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/Thread.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/info_sp.php =================================================================== --- p2ex/trunk/info_sp.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/info_sp.php 2010-01-13 15:03:54 UTC (rev 776) @@ -58,8 +58,6 @@ if ($popup == 1 || $_conf['expack.spm.ngaborn_confirm'] == 0) { $_GET['popup'] = 2; - require_once P2_LIB_DIR . '/Thread.php'; - require_once P2_LIB_DIR . '/ThreadRead.php'; $aThread = new ThreadRead; $aThread->setThreadPathInfo($host, $bbs, $key); $aThread->readDat($aThread->keydat); @@ -112,7 +110,6 @@ if (strpos($mode, '_msg') !== false) { if (isset($_GET['selected_string'])) { - require_once P2_LIB_DIR . '/StrCtl.php'; $aborn_str = trim($_GET['selected_string']); $aborn_str = preg_replace('/\r\n|\r|\n/u', ' <br> ', $aborn_str); // $selected_stringÍJavaScriptÌencodeURIComponent()ÖÅURLGR[h³êĨèA Modified: p2ex/trunk/lib/BrdCtl.php =================================================================== --- p2ex/trunk/lib/BrdCtl.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/BrdCtl.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,7 +1,5 @@ <?php -require_once P2_LIB_DIR . '/BrdMenu.php'; - // {{{ BrdCtl /** Modified: p2ex/trunk/lib/HostCheck.php =================================================================== --- p2ex/trunk/lib/HostCheck.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/HostCheck.php 2010-01-13 15:03:54 UTC (rev 776) @@ -2,7 +2,6 @@ // ANZX³zXgð`FbN·éÖQNX require_once P2_CONF_DIR . '/conf_hostcheck.php'; -require_once P2_LIB_DIR . '/P2KeyValueStore.php'; // {{{ HostCheck Modified: p2ex/trunk/lib/Login.php =================================================================== --- p2ex/trunk/lib/Login.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/Login.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,7 +1,5 @@ <?php -require_once P2_LIB_DIR . '/Session.php'; - // {{{ Login /** @@ -846,11 +844,6 @@ */ private function _checkIp($type) { - if (!class_exists('HostCheck', false)) { - require P2_LIB_DIR . '/HostCheck.php'; - } - - // PHPÍNXE\bhEÖÌ嶬¶ðæʵȢª... $method = 'isAddress' . ucfirst(strtolower($type)); if (method_exists('HostCheck', $method)) { return HostCheck::$method(); Modified: p2ex/trunk/lib/P2Client.php =================================================================== --- p2ex/trunk/lib/P2Client.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/P2Client.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,7 +1,5 @@ <?php require_once 'HTTP/Client.php'; -require_once dirname(__FILE__) . '/P2DOM.php'; -require_once dirname(__FILE__) . '/P2KeyValueStore.php'; // {{{ P2Client Copied: p2ex/trunk/lib/P2CommandRunner.php (from rev 775, p2ex/trunk/cli/P2CommandRunner.php) =================================================================== --- p2ex/trunk/lib/P2CommandRunner.php (rev 0) +++ p2ex/trunk/lib/P2CommandRunner.php 2010-01-13 15:03:54 UTC (rev 776) @@ -0,0 +1,111 @@ +<?php +/** + * rep2expack - command runner + */ + +// {{{ CONSTANTS + +if (!defined('P2_CLI_DIR')) { + define('P2_CLI_DIR', realpath(dirname(__FILE__) . '/../cli')); +} + +// }}} +// {{{ P2CommandRunner + +/** + * R}hCc[ðç¹é[eBeBNX + * + * @static + */ +class P2CommandRunner +{ + // {{{ fetchSubjectTxt() + + /** + * subject.txtÌÀñ_E[hðÀs·é + * + * @param string $mode + * @param array $_conf + * @return bool + */ + static public function fetchSubjectTxt($mode, array $_conf) + { + // R}h¶¬ + $args = array(escapeshellarg($_conf['expack.php_cli_path'])); + if ($_conf['expack.dl_pecl_http']) { + $args[] = '-d'; + $args[] = 'extension=' . escapeshellarg('http.' . PHP_SHLIB_SUFFIX); + } + $args[] = escapeshellarg(P2_CLI_DIR . DIRECTORY_SEPARATOR . 'fetch-subject-txt.php'); + + switch ($mode) { + case 'fav': + case 'recent': + case 'res_hist': + case 'merge_favita': + $args[] = sprintf('--mode=%s', $mode); + break; + default: + return false; + } + + if ($_conf['expack.misc.multi_favs']) { + switch ($mode) { + case 'fav': + $args[] = sprintf('--set=%d', $_conf['m_favlist_set']); + break; + case 'merge_favita': + $args[] = sprintf('--set=%d', $_conf['m_favita_set']); + break; + } + } + + // WG[oÍðWoÍÉ_CNg + $args[] = '2>&1'; + + $command = implode(' ', $args); + + //$GLOBALS['_info_msg_ht'] .= '<p>' . htmlspecialchars($command, ENT_QUOTES) . '</p>'; + + // Às + $pipe = popen($command, 'r'); + if (!is_resource($pipe)) { + p2die('R}hðÀsūܹñŵ½B', $command); + } + + $output = ''; + while (!feof($pipe)) { + $output .= fgets($pipe); + } + + $status = pclose($pipe); + if ($status != 0) { + $GLOBALS['_info_msg_ht'] .= sprintf('<p>%s(): ERROR(%d)</p>', __METHOD__, $status); + } + + if ($output !== '') { + if ($status == 2) { + $GLOBALS['_info_msg_ht'] .= $output; + } else { + $GLOBALS['_info_msg_ht'] .= '<p>' . nl2br(htmlspecialchars($output, ENT_QUOTES)) . '</p>'; + } + } + + return ($status == 0); + } + + // }}} +} + +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: Modified: p2ex/trunk/lib/P2DOM.php =================================================================== --- p2ex/trunk/lib/P2DOM.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/P2DOM.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,7 +1,5 @@ <?php -require_once dirname(__FILE__) . '/P2Exception.php'; - // {{{ P2DOM /** Modified: p2ex/trunk/lib/P2DataStore/AbstractDataStore.php =================================================================== --- p2ex/trunk/lib/P2DataStore/AbstractDataStore.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/P2DataStore/AbstractDataStore.php 2010-01-13 15:03:54 UTC (rev 776) @@ -7,8 +7,6 @@ * P2DataStoreÍrep2Åg¤½ßÉÝv³êÄ¢éB */ -require_once P2_LIB_DIR . '/P2KeyValueStore.php'; - // {{{ AbstractDataStore abstract class AbstractDataStore Copied: p2ex/trunk/lib/P2DataStore/CookieDataStore.php (from rev 775, p2ex/trunk/lib/P2DataStore/CookieStore.php) =================================================================== --- p2ex/trunk/lib/P2DataStore/CookieDataStore.php (rev 0) +++ p2ex/trunk/lib/P2DataStore/CookieDataStore.php 2010-01-13 15:03:54 UTC (rev 776) @@ -0,0 +1,125 @@ +<?php +/** + * rep2expack - CookieÇNX + */ + +// {{{ CookieDataStore + +class CookieDataStore extends AbstractDataStore +{ + // {{{ getKVS() + + /** + * CookieðÛ¶·éP2KeyValueStoreIuWFNgðæ¾·é + * + * @param void + * @return P2KeyValueStore + */ + static public function getKVS() + { + return self::_getKVS($GLOBALS['_conf']['cookie_db_path']); + } + + // }}} + // {{{ AbstractDataStore.php ©çÌRsy / PHP 5.3 ÌxÃI©ðgÁÄíµ½¢ + // {{{ get() + + /** + * f[^ðæ¾·é + * + * @param string $key + * @return mixed + * @see P2KeyValueStore::get() + */ + static public function get($key) + { + return self::getKVS()->get($key); + } + + // }}} + // {{{ set() + + /** + * f[^ðÛ¶·é + * + * @param string $key + * @param mixed $value + * @return bool + * @see P2KeyValueStore::exists(), + * P2KeyValueStore::set(), + * P2KeyValueStore::update() + */ + static public function set($key, $value) + { + $kvs = self::getKVS(); + if ($kvs->exists($key)) { + return $kvs->update($key, $value); + } else { + return $kvs->set($key, $value); + } + } + + // }}} + // {{{ delete() + + /** + * f[^ðí·é + * + * @param string $key + * @return bool + * @see P2KeyValueStore::delete() + */ + static public function delete($key) + { + return self::getKVS()->delete($key); + } + + // }}} + // {{{ clear() + + /** + * ·×ÄÌf[^ܽÍL[ªwè³ê½Úª«ÅnÜéf[^ðí·é + * + * @param string $prefix + * @return int + * @see P2KeyValueStore::clear() + */ + static public function clear($prefix = null) + { + $kvs = self::getKVS(); + + if ($prefix === null) { + return $kvs->clear(); + } + + $pattern = str_replace(array( '%', '_', '\\'), + array('\\%', '\\_', '\\\\'), + $kvs->encodeKey($prefix)); + $query = 'DELETE FROM $__table WHERE $__key LIKE :pattern ESCAPE :escape'; + $stmt = $kvs->prepare($query); + $stmt->bindValue(':pattern', $pattern); + $stmt->bindValue(':escape', '\\'); + + if ($stmt->execute()) { + return $stmt->rowCount(); + } else { + return false; + } + } + + // }}} + // }}} Rsy±±ÜÅ +} + +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: Deleted: p2ex/trunk/lib/P2DataStore/CookieStore.php =================================================================== --- p2ex/trunk/lib/P2DataStore/CookieStore.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/P2DataStore/CookieStore.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,127 +0,0 @@ -<?php -/** - * rep2expack - CookieÇNX - */ - -require_once P2_LIB_DIR . '/P2DataStore/AbstractDataStore.php'; - -// {{{ CookieStore - -class CookieStore extends AbstractDataStore -{ - // {{{ getKVS() - - /** - * CookieðÛ¶·éP2KeyValueStoreIuWFNgðæ¾·é - * - * @param void - * @return P2KeyValueStore - */ - static public function getKVS() - { - return self::_getKVS($GLOBALS['_conf']['cookie_db_path']); - } - - // }}} - // {{{ AbstractDataStore.php ©çÌRsy / PHP 5.3 ÌxÃI©ðgÁÄíµ½¢ - // {{{ get() - - /** - * f[^ðæ¾·é - * - * @param string $key - * @return mixed - * @see P2KeyValueStore::get() - */ - static public function get($key) - { - return self::getKVS()->get($key); - } - - // }}} - // {{{ set() - - /** - * f[^ðÛ¶·é - * - * @param string $key - * @param mixed $value - * @return bool - * @see P2KeyValueStore::exists(), - * P2KeyValueStore::set(), - * P2KeyValueStore::update() - */ - static public function set($key, $value) - { - $kvs = self::getKVS(); - if ($kvs->exists($key)) { - return $kvs->update($key, $value); - } else { - return $kvs->set($key, $value); - } - } - - // }}} - // {{{ delete() - - /** - * f[^ðí·é - * - * @param string $key - * @return bool - * @see P2KeyValueStore::delete() - */ - static public function delete($key) - { - return self::getKVS()->delete($key); - } - - // }}} - // {{{ clear() - - /** - * ·×ÄÌf[^ܽÍL[ªwè³ê½Úª«ÅnÜéf[^ðí·é - * - * @param string $prefix - * @return int - * @see P2KeyValueStore::clear() - */ - static public function clear($prefix = null) - { - $kvs = self::getKVS(); - - if ($prefix === null) { - return $kvs->clear(); - } - - $pattern = str_replace(array( '%', '_', '\\'), - array('\\%', '\\_', '\\\\'), - $kvs->encodeKey($prefix)); - $query = 'DELETE FROM $__table WHERE $__key LIKE :pattern ESCAPE :escape'; - $stmt = $kvs->prepare($query); - $stmt->bindValue(':pattern', $pattern); - $stmt->bindValue(':escape', '\\'); - - if ($stmt->execute()) { - return $stmt->rowCount(); - } else { - return false; - } - } - - // }}} - // }}} Rsy±±ÜÅ -} - -// }}} - -/* - * Local Variables: - * mode: php - * coding: cp932 - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ -// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: Modified: p2ex/trunk/lib/P2DataStore/PostDataStore.php =================================================================== --- p2ex/trunk/lib/P2DataStore/PostDataStore.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/P2DataStore/PostDataStore.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,8 +3,6 @@ * rep2expack - «Ýf[^ÇNX */ -require_once P2_LIB_DIR . '/P2DataStore/AbstractDataStore.php'; - // {{{ PostDataStore class PostDataStore extends AbstractDataStore Modified: p2ex/trunk/lib/P2Util.php =================================================================== --- p2ex/trunk/lib/P2Util.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/P2Util.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,8 +1,5 @@ <?php -require_once P2_LIB_DIR . '/DataPhp.php'; -require_once P2_LIB_DIR . '/FileCtl.php'; - // {{{ P2Util /** @@ -84,9 +81,6 @@ } // DL - if (!class_exists('WapRequest', false)) { - require P2_LIB_DIR . '/Wap.php'; - } $wap_ua = new WapUserAgent(); $wap_ua->setTimeout($_conf['fsockopen_time_limit']); $wap_req = new WapRequest(); @@ -223,7 +217,6 @@ // ¼LongÌæ¾ if (!isset($p2_setting['itaj'])) { - require_once P2_LIB_DIR . '/BbsMap.php'; $itaj = BbsMap::getBbsName($host, $bbs); if ($itaj != $bbs) { self::$_itaNames[$id] = $p2_setting['itaj'] = $itaj; @@ -562,25 +555,27 @@ // p2imeÍAenc, m, url ÌøªÅè³êÄ¢éÌÅÓ switch ($gate) { - case '2ch': + /* + case '2ch': // ime.nu $url_r = preg_replace('|^(\w+)://(.+)$|', '$1://ime.nu/$2', $url); break; - case 'p2': - case 'p2pm': - $url_r = $_conf['p2ime_url'].'?enc=1&url='.$url_en; + */ + case 'p2': // ©®] + case 'p2pm': // pÌÝè®] + $url_r = $_conf['p2ime_url'] . '?enc=1&url=' . $url_en; break; - case 'p2m': - $url_r = $_conf['p2ime_url'].'?enc=1&m=1&url='.$url_en; + case 'p2m': // è®] + $url_r = $_conf['p2ime_url'] . '?enc=1&m=1&url=' . $url_en; break; - case 'ex': - case 'expm': - $url_r = $_conf['expack.ime_url'].'?u='.$url_en.'&d=1'; + case 'ex': // ©®]1b + case 'expm': // pÌÝè®] + $url_r = $_conf['expack.ime_url'] . '?u=' . $url_en . '&d=1'; break; - case 'exq': - $url_r = $_conf['expack.ime_url'].'?u='.$url_en.'&d=0'; + case 'exq': // ©®]0b + $url_r = $_conf['expack.ime_url'] . '?u=' . $url_en . '&d=0'; break; - case 'exm': - $url_r = $_conf['expack.ime_url'].'?u='.$url_en.'&d=-1'; + case 'exm': // è®] + $url_r = $_conf['expack.ime_url'] . '?u=' . $url_en; break; case 'google': $url_r = 'http://www.google.co.jp/'; @@ -592,7 +587,11 @@ $url_r .= $url_en; break; default: - $url_r = $url; + if ($_conf['use_cookies']) { + $url_r = $url; + } else { + $url_r = $_conf['expack.ime_url'] . '?u=' . $url_en; + } } return $url_r; @@ -1825,10 +1824,6 @@ { global $_conf; - if (!class_exists('P2Client', false)) { - require P2_LIB_DIR . '/P2Client.php'; - } - if (!is_dir($_conf['db_dir'])) { FileCtl::mkdir_r($_conf['db_dir']); } Modified: p2ex/trunk/lib/SettingTxt.php =================================================================== --- p2ex/trunk/lib/SettingTxt.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/SettingTxt.php 2010-01-13 15:03:54 UTC (rev 776) @@ -119,7 +119,6 @@ if ($code == 302) { // zXgÌÚ]ðÇÕ - require_once P2_LIB_DIR . '/BbsMap.php'; $new_host = BbsMap::getCurrentHost($this->_host, $this->_bbs); if ($new_host != $this->_host) { $aNewSettingTxt = new SettingTxt($new_host, $this->_bbs); Modified: p2ex/trunk/lib/ShowBrdMenuPc.php =================================================================== --- p2ex/trunk/lib/ShowBrdMenuPc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/ShowBrdMenuPc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -108,11 +108,9 @@ // V ð\¦·éêEÜÆßÄvtFb` if ($_conf['enable_menu_new'] && !empty($_GET['new'])) { if ($_conf['expack.use_pecl_http'] == 1) { - require_once P2_LIB_DIR . '/P2HttpExt.php'; P2HttpRequestPool::fetchSubjectTxt($favitas); $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } elseif ($_conf['expack.use_pecl_http'] == 2) { - require_once P2_CLI_DIR . '/P2CommandRunner.php'; if (P2CommandRunner::fetchSubjectTxt('merge_favita', $_conf)) { $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } Modified: p2ex/trunk/lib/ShowThread.php =================================================================== --- p2ex/trunk/lib/ShowThread.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/ShowThread.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,9 +3,6 @@ * rep2- Xbhð\¦·é NX */ -require_once P2_LIB_DIR . '/HostCheck.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; - // {{{ ShowThread abstract class ShowThread Modified: p2ex/trunk/lib/ShowThreadK.php =================================================================== --- p2ex/trunk/lib/ShowThreadK.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/ShowThreadK.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,8 +3,6 @@ * rep2 - gÑpÅXbhð\¦·é NX */ -require_once P2_LIB_DIR . '/ShowThread.php'; -require_once P2_LIB_DIR . '/StrCtl.php'; require_once P2EX_LIB_DIR . '/ExpackLoader.php'; ExpackLoader::loadAAS(); @@ -70,9 +68,6 @@ $this->BBS_NONAME_NAME = null; if (!$_conf['mobile.bbs_noname_name']) { - if (!class_exists('SettingTxt', false)) { - require P2_LIB_DIR . '/SettingTxt.php'; - } $st = new SettingTxt($this->thread->host, $this->thread->bbs); $st->setSettingArray(); if (!empty($st->setting_array['BBS_NONAME_NAME'])) { Modified: p2ex/trunk/lib/ShowThreadPc.php =================================================================== --- p2ex/trunk/lib/ShowThreadPc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/ShowThreadPc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,8 +3,6 @@ * rep2 - Xbhð\¦·é NX PCp */ -require_once P2_LIB_DIR . '/ShowThread.php'; -require_once P2_LIB_DIR . '/StrCtl.php'; require_once P2EX_LIB_DIR . '/ExpackLoader.php'; ExpackLoader::loadAAS(); Modified: p2ex/trunk/lib/SubjectTxt.php =================================================================== --- p2ex/trunk/lib/SubjectTxt.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/SubjectTxt.php 2010-01-13 15:03:54 UTC (rev 776) @@ -131,7 +131,6 @@ $code = $req->getResponseCode(); if ($code == 302) { // zXgÌÚ]ðÇÕ - require_once P2_LIB_DIR . '/BbsMap.php'; $new_host = BbsMap::getCurrentHost($this->host, $this->bbs); if ($new_host != $this->host) { $aNewSubjectTxt = new SubjectTxt($new_host, $this->bbs); Modified: p2ex/trunk/lib/ThreadList.php =================================================================== --- p2ex/trunk/lib/ThreadList.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/ThreadList.php 2010-01-13 15:03:54 UTC (rev 776) @@ -1,5 +1,5 @@ <?php -require_once P2_LIB_DIR . '/Thread.php'; +require_once P2_LIB_DIR . '/sort_threadlist.inc.php'; // {{{ ThreadList @@ -156,8 +156,6 @@ // ¨CÉÂðÜÆßÄÇÝÝ case 'merge_favita': - require_once P2_LIB_DIR . '/SubjectTxt.php'; - $favitas = array(); if (file_exists($_conf['favita_brd'])) { @@ -170,11 +168,9 @@ if (empty($_REQUEST['norefresh']) && !(empty($_REQUEST['refresh']) && isset($_REQUEST['word']))) { if ($_conf['expack.use_pecl_http'] == 1) { - require_once P2_LIB_DIR . '/P2HttpExt.php'; P2HttpRequestPool::fetchSubjectTxt($favitas); $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } elseif ($_conf['expack.use_pecl_http'] == 2) { - require_once P2_CLI_DIR . '/P2CommandRunner.php'; if (P2CommandRunner::fetchSubjectTxt('merge_favita', $_conf)) { $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } @@ -284,7 +280,6 @@ // ICãÌ subject.txt ðÇÝÞispmodeÅÈ¢êj default: if (!$this->spmode) { - require_once P2_LIB_DIR . '/SubjectTxt.php'; $aSubjectTxt = new SubjectTxt($this->host, $this->bbs); $lines = $aSubjectTxt->subject_lines; } @@ -382,16 +377,14 @@ } if ($cmp) { - if (!function_exists($cmp)) { - require P2_LIB_DIR . '/sort_threadlist.inc.php'; - } if ($do_benchmark) { $before = microtime(true); } if ($use_multisort) { - $cmp = 'multi_' . $cmp; + $cmp = 'p2_multi_' . $cmp; $cmp($this, $reverse); } else { + $cmp = 'p2_' . $cmp; usort($this->threads, $cmp); } } Modified: p2ex/trunk/lib/ThreadRead.php =================================================================== --- p2ex/trunk/lib/ThreadRead.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/ThreadRead.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,8 +3,6 @@ * rep2 - Xbh [h NX */ -require_once P2_LIB_DIR . '/Thread.php'; - // {{{ ThreadRead /** @@ -270,7 +268,6 @@ } elseif ($code == "302") { // Found // zXgÌÚ]ðÇÕ - require_once P2_LIB_DIR . '/BbsMap.php'; $new_host = BbsMap::getCurrentHost($this->host, $this->bbs); if ($new_host != $this->host) { fclose($fp); @@ -784,9 +781,6 @@ // {{{ read.cgi ©çHTMLðæ¾ $read_response_html = ''; - if (!class_exists('WapRequest', false)) { - require P2_LIB_DIR . '/Wap.php'; - } $wap_ua = new WapUserAgent(); $wap_ua->setAgent($_conf['p2ua']); // ±±ÍA"Monazilla/" ð¯éÆNG $wap_ua->setTimeout($_conf['fsockopen_time_limit']); @@ -1025,11 +1019,9 @@ } if ($_conf['ktai']) { - require_once P2_LIB_DIR . '/ShowThreadK.php'; $aShowThread = new ShowThreadK($this); $aShowThread->am_autong = false; } else { - require_once P2_LIB_DIR . '/ShowThreadPc.php'; $aShowThread = new ShowThreadPc($this); } Modified: p2ex/trunk/lib/bootstrap.php =================================================================== --- p2ex/trunk/lib/bootstrap.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/bootstrap.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,8 +5,6 @@ */ require_once 'Net/UserAgent/Mobile.php'; -require_once P2_LIB_DIR . '/Session.php'; -require_once P2_LIB_DIR . '/Login.php'; // {{{ [U[Ýè Ç @@ -80,9 +78,6 @@ // {{{ zXg`FbN if ($_conf['secure']['auth_host'] || $_conf['secure']['auth_bbq']) { - if (!class_exists('HostCheck', false)) { - include P2_LIB_DIR . '/HostCheck.php'; - } if (($_conf['secure']['auth_host'] && HostCheck::getHostAuth() == false) || ($_conf['secure']['auth_bbq'] && HostCheck::getHostBurned() == true) ) { @@ -160,7 +155,7 @@ $_conf['accept_charset'] = 'Shift_JIS'; $_conf['extra_headers_ht'] = ''; -$support_cookies = true; +$_conf['use_cookies'] = true; $mobile = Net_UserAgent_Mobile::singleton(); @@ -193,11 +188,11 @@ // NTT docomo i[h if ($mobile->isDoCoMo()) { - $support_cookies = false; + $_conf['use_cookies'] = false; // au EZweb //} elseif ($mobile->isEZweb()) { - // $support_cookies = true; + // $_conf['use_cookies'] = true; // SoftBank Mobile } elseif ($mobile->isSoftBank()) { @@ -206,17 +201,17 @@ $_conf['accesskey'] = 'DIRECTKEY'; // 3GC^[ÆW^[ÈOÍCookieðT|[gµÈ¢ if (!$mobile->isTypeW()) { - $support_cookies = false; + $_conf['use_cookies'] = false; } } // WILLCOM AIR-EDGE //} elseif ($mobile->isWillcom()) { - // $support_cookies = true; + // $_conf['use_cookies'] = true; // »Ì¼ //} else { - // $support_cookies = true; + // $_conf['use_cookies'] = true; } } @@ -640,16 +635,13 @@ // }}} -$_p2session = new Session(null, null, $support_cookies); +$_p2session = new Session(null, null, $_conf['use_cookies']); // }}} // {{{ ¨CÉZbg // ¡Ì¨CÉZbgðg¤Æ« if ($_conf['expack.misc.multi_favs']) { - if (!class_exists('FavSetManager', false)) { - include P2_LIB_DIR . '/FavSetManager.php'; - } // ØèÖ¦\¦pÉSĄ̈CÉXE¨CÉÂðÇÝñŨ FavSetManager::loadAllFavSet(); // ¨CÉZbgðØèÖ¦é Modified: p2ex/trunk/lib/expack/tgrep/view.inc.php =================================================================== --- p2ex/trunk/lib/expack/tgrep/view.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/expack/tgrep/view.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -132,7 +132,6 @@ <tbody> <?php $R = true; -require_once P2_LIB_DIR . '/Thread.php'; foreach ($threads as $o => $t) { $new = ''; $turl = sprintf('%s?host=%s&bbs=%s&key=%d', $_conf['read_php'], $t->host, $t->bbs, $t->tkey); Modified: p2ex/trunk/lib/expack/tgrep/view_k.inc.php =================================================================== --- p2ex/trunk/lib/expack/tgrep/view_k.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/expack/tgrep/view_k.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -73,7 +73,6 @@ <!-- ThreadList and Pager --> <div><a href="#bottom" align="right" title="ºÖ"<?php echo $_conf['k_accesskey_at']['bottom']; ?>><?php echo $_conf['k_accesskey_st']['bottom']; ?>¥</a></div> <?php -require_once P2_LIB_DIR . '/Thread.php'; foreach ($threads as $o => $t) { $new = ''; $turl = sprintf('%s?host=%s&bbs=%s&key=%d', $_conf['read_php'], $t->host, $t->bbs, $t->tkey); Modified: p2ex/trunk/lib/login2ch.inc.php =================================================================== --- p2ex/trunk/lib/login2ch.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/login2ch.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,9 +3,6 @@ * rep2 - 2chOC */ -require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/Wap.php'; - // {{{ login2ch() /** Modified: p2ex/trunk/lib/login_first.inc.php =================================================================== --- p2ex/trunk/lib/login_first.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/login_first.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,8 +3,6 @@ * rep2 - ÅÌOCæÊð\¦·é */ -require_once P2_LIB_DIR . '/Login.php'; - // {{{ printLoginFirst() /** Modified: p2ex/trunk/lib/menu.inc.php =================================================================== --- p2ex/trunk/lib/menu.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/menu.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -6,9 +6,6 @@ * menu.php, menu_side.php æèÇÝÜêé */ -require_once P2_LIB_DIR . '/BrdCtl.php'; -require_once P2_LIB_DIR . '/ShowBrdMenuPc.php'; - $_login->authorize(); //[UFØ //============================================================== @@ -251,10 +248,8 @@ if ($_conf['enable_menu_new'] == 1 && $_GET['new']) { // Àñ_E[hÌÝè if ($_conf['expack.use_pecl_http'] == 1) { - require_once P2_LIB_DIR . '/P2HttpExt.php'; $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } elseif ($_conf['expack.use_pecl_http'] == 2) { - require_once P2_CLI_DIR . '/P2CommandRunner.php'; $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } Modified: p2ex/trunk/lib/menu_iphone.inc.php =================================================================== --- p2ex/trunk/lib/menu_iphone.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/menu_iphone.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -98,8 +98,6 @@ { global $_conf; - require_once P2_LIB_DIR . '/BrdCtl.php'; - $brd_menus = BrdCtl::read_brds(); if (!$brd_menus) { @@ -162,8 +160,6 @@ { global $_conf; - require_once P2_LIB_DIR . '/BrdCtl.php'; - $brd_menus = BrdCtl::read_brds(); $word_ht = htmlspecialchars($word, ENT_QUOTES); Modified: p2ex/trunk/lib/p2util.inc.php =================================================================== --- p2ex/trunk/lib/p2util.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/p2util.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -401,10 +401,6 @@ */ function p2_set_filtering_word($word, $method = 'regex') { - if (!class_exists('StrCtl', false)) { - require P2_LIB_DIR . '/StrCtl.php'; - } - $word_fm = StrCtl::wordForMatch($word, $method); if (strlen($word_fm) == 0) { @@ -480,10 +476,6 @@ */ function p2_get_highlighting_regex(array $words) { - if (!class_exists('StrCtl', false)) { - require P2_LIB_DIR . '/StrCtl.php'; - } - $featured_words = array_filter($words, '_p2_get_highlighting_regex_filter'); if (count($featured_words) == 0) { $featured_words = $words; Modified: p2ex/trunk/lib/post_form_options.inc.php =================================================================== --- p2ex/trunk/lib/post_form_options.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/post_form_options.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,10 +3,6 @@ * rep2 - X«ÝtH[Ì@\ÇÝÝ */ -require_once P2_LIB_DIR . '/SettingTxt.php'; -require_once P2_LIB_DIR . '/StrCtl.php'; -require_once P2_LIB_DIR . '/P2DataStore/PostDataStore.php'; - $js = array(); $fake_time = -10; // time ð10ªOÉU @@ -275,8 +271,6 @@ $q_resnum = $_GET['resnum']; $hd['MESSAGE'] = ">>" . $q_resnum . "\r\n"; if (!empty($_GET['inyou'])) { - require_once P2_LIB_DIR . '/Thread.php'; - require_once P2_LIB_DIR . '/ThreadRead.php'; $aThread = new ThreadRead; $aThread->setThreadPathInfo($host, $bbs, $key); $aThread->readDat($aThread->keydat); Modified: p2ex/trunk/lib/read_footer_k.inc.php =================================================================== --- p2ex/trunk/lib/read_footer_k.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/read_footer_k.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -104,9 +104,6 @@ } // SPM if ($_conf['expack.spm.enabled']) { - if (!class_exists('ShowThreadK', false)) { - require P2_LIB_DIR . '/ShowThreadK.php'; - } echo ShowThreadK::getSpmElementHtml(); } } Modified: p2ex/trunk/lib/sort_threadlist.inc.php =================================================================== --- p2ex/trunk/lib/sort_threadlist.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/sort_threadlist.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -3,8 +3,6 @@ * rep2 - XbhXgð\[g·éÖQ */ -require_once P2_LIB_DIR . '/ThreadList.php'; - // {{{ V \[g /** @@ -14,7 +12,7 @@ * @param Thread $b * @return int */ -function cmp_midoku($a, $b) +function p2_cmp_midoku($a, $b) { if ($a->new == $b->new) { if (($a->unum == $b->unum) or ($a->unum < 0) && ($b->unum < 0)) { @@ -34,7 +32,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_midoku(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_midoku(ThreadList $aThreadList, $reverse = false) { $new = array(); $unum = array(); @@ -63,7 +61,7 @@ * @param Thread $b * @return int */ -function cmp_res($a, $b) +function p2_cmp_res($a, $b) { if ($a->rescount == $b->rescount) { return ($a->torder > $b->torder) ? 1 : -1; @@ -79,7 +77,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_res(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_res(ThreadList $aThreadList, $reverse = false) { $rescount = array(); $torder = array(); @@ -105,7 +103,7 @@ * @param Thread $b * @return int */ -function cmp_title($a, $b) +function p2_cmp_title($a, $b) { if ($a->ttitle == $b->ttitle) { return ($a->torder > $b->torder) ? 1 : -1; @@ -121,7 +119,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_title(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_title(ThreadList $aThreadList, $reverse = false) { $ttitle = array(); $torder = array(); @@ -154,7 +152,7 @@ * @param Thread $b * @return int */ -function cmp_ita($a, $b) +function p2_cmp_ita($a, $b) { if ($a->host != $b->host) { return strcmp($a->host, $b->host); @@ -174,7 +172,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_ita(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_ita(ThreadList $aThreadList, $reverse = false) { $host = array(); $itaj = array(); @@ -203,7 +201,7 @@ * @param Thread $b * @return int */ -function cmp_fav($a, $b) +function p2_cmp_fav($a, $b) { if ($a->fav == $b->fav) { return ($a->torder > $b->torder) ? 1 : -1; @@ -219,7 +217,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_fav(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_fav(ThreadList $aThreadList, $reverse = false) { $fav = array(); $torder = array(); @@ -245,7 +243,7 @@ * @param Thread $b * @return int */ -function cmp_dayres_midoku($a, $b) +function p2_cmp_dayres_midoku($a, $b) { if ($a->new == $b->new) { if (($a->unum == $b->unum) or ($a->unum >= 1) && ($b->unum >= 1)) { @@ -265,7 +263,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_dayres_midoku(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_dayres_midoku(ThreadList $aThreadList, $reverse = false) { $new = array(); $hasu = array(); @@ -294,7 +292,7 @@ * @param Thread $b * @return int */ -function cmp_dayres($a, $b) +function p2_cmp_dayres($a, $b) { if ($a->new == $b->new) { return ($a->dayres < $b->dayres) ? 1 : -1; @@ -310,7 +308,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_dayres(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_dayres(ThreadList $aThreadList, $reverse = false) { $new = array(); $dayres = array(); @@ -332,7 +330,7 @@ /** * key\[g (usortÌR[obNÖ) */ -function cmp_key($a, $b) +function p2_cmp_key($a, $b) { return ($a->key < $b->key) ? 1 : -1; } @@ -344,7 +342,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_key(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_key(ThreadList $aThreadList, $reverse = false) { $key = array(); @@ -363,7 +361,7 @@ /** * No.\[g (usortÌR[obNÖ) */ -function cmp_no($a, $b) +function p2_cmp_no($a, $b) { return ($a->torder > $b->torder) ? 1 : -1; } @@ -375,7 +373,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_no(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_no(ThreadList $aThreadList, $reverse = false) { $torder = array(); @@ -394,7 +392,7 @@ /** * Þ«\[g (usortÌR[obNÖ) */ -function cmp_similarity($a, $b) +function p2_cmp_similarity($a, $b) { if ($a->similarity == $b->similarity) { return ($a->key < $b->key) ? 1 : -1; @@ -410,7 +408,7 @@ * @param bool $reverse * @return void */ -function multi_cmp_similarity(ThreadList $aThreadList, $reverse = false) +function p2_multi_cmp_similarity(ThreadList $aThreadList, $reverse = false) { $similarity = array(); $key = array(); Modified: p2ex/trunk/lib/subject_new.inc.php =================================================================== --- p2ex/trunk/lib/subject_new.inc.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/lib/subject_new.inc.php 2010-01-13 15:03:54 UTC (rev 776) @@ -6,9 +6,6 @@ * subject.php ÆZíÈÌÅêÉÊ|ðÝé */ -require_once P2_LIB_DIR . '/ThreadList.php'; -require_once P2_LIB_DIR . '/Thread.php'; - $_newthre_num = 0; $shinchaku_num = 0; $ta_num = 0; @@ -155,9 +152,6 @@ // subject.txtª¢DLÈçƵÄf[^ðzñÉi[ if (!isset($subject_txts[$subject_id])) { $subject_txts[$subject_id] = array(); - if (!class_exists('SubjectTxt', false)) { - require P2_LIB_DIR . '/SubjectTxt.php'; - } $aSubjectTxt = new SubjectTxt($aThread->host, $aThread->bbs); //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('subthre_read'); // Modified: p2ex/trunk/menu_async.php =================================================================== --- p2ex/trunk/menu_async.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/menu_async.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,8 +5,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/BrdCtl.php'; -require_once P2_LIB_DIR . '/ShowBrdMenuPc.php'; $_login->authorize(); //[UFØ Modified: p2ex/trunk/menu_i.php =================================================================== --- p2ex/trunk/menu_i.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/menu_i.php 2010-01-13 15:03:54 UTC (rev 776) @@ -63,8 +63,6 @@ // $hashesÌ澪¢ÀÈÌÅóB /* if (isset($hashes) && is_array($hashes) && count($hashes)) { - require_once P2_LIB_DIR . '/StrCtl.php'; - $js = ''; $last = array_pop($hashes); while (($hash = array_shift($hashes)) !== null) { Modified: p2ex/trunk/menu_k.php =================================================================== --- p2ex/trunk/menu_k.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/menu_k.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,8 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/BrdCtl.php'; -require_once P2_LIB_DIR . '/ShowBrdMenuK.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/post.php =================================================================== --- p2ex/trunk/post.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/post.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,8 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/P2DataStore/CookieStore.php'; -require_once P2_LIB_DIR . '/P2DataStore/PostDataStore.php'; $_login->authorize(); // [UFØ @@ -186,17 +184,17 @@ } else { // cookie ÇÝÝ $cookie_key = $_login->user_u . '/' . P2Util::normalizeHostName($host); - if ($p2cookies = CookieStore::get($cookie_key)) { + if ($p2cookies = CookieDataStore::get($cookie_key)) { if (is_array($p2cookies)) { if (array_key_exists('expires', $p2cookies)) { // úÀØêÈçjü if (time() > strtotime($p2cookies['expires'])) { - CookieStore::delete($cookie_key); + CookieDataStore::delete($cookie_key); $p2cookies = null; } } } else { - CookieStore::delete($cookie_key); + CookieDataStore::delete($cookie_key); $p2cookies = null; } } else { @@ -208,7 +206,7 @@ // cookie Û¶ if ($p2cookies) { - CookieStore::set($cookie_key, $p2cookies); + CookieDataStore::set($cookie_key, $p2cookies); } } @@ -900,7 +898,6 @@ { global $host, $bbs, $ttitle; - require_once P2_LIB_DIR . '/SubjectTxt.php'; $aSubjectTxt = new SubjectTxt($host, $bbs); foreach ($aSubjectTxt->subject_lines as $l) { @@ -910,6 +907,7 @@ } } } + return false; } Modified: p2ex/trunk/read.php =================================================================== --- p2ex/trunk/read.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,8 +5,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/NgAbornCtl.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; $_login->authorize(); // [UFØ @@ -240,7 +238,6 @@ $GLOBALS['filter_hits'] = NULL; } - require_once P2_LIB_DIR . '/ShowThreadK.php'; $aShowThread = new ShowThreadK($aThread); if ($is_ajax) { @@ -317,7 +314,6 @@ //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection("datToHtml"); if ($aThread->rescount) { - require_once P2_LIB_DIR . '/ShowThreadPc.php'; $aShowThread = new ShowThreadPc($aThread); if ($_conf['expack.spm.enabled']) { Modified: p2ex/trunk/read_async.php =================================================================== --- p2ex/trunk/read_async.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read_async.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,10 +5,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/NgAbornCtl.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; -require_once P2_LIB_DIR . '/ShowThreadPc.php'; -//require_once P2_LIB_DIR . '/ShowThreadTree.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/read_copy_k.php =================================================================== --- p2ex/trunk/read_copy_k.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read_copy_k.php 2010-01-13 15:03:54 UTC (rev 776) @@ -4,7 +4,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/read_filter.php =================================================================== --- p2ex/trunk/read_filter.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read_filter.php 2010-01-13 15:03:54 UTC (rev 776) @@ -6,8 +6,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; -require_once P2_LIB_DIR . '/ShowThreadPc.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/read_new.php =================================================================== --- p2ex/trunk/read_new.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read_new.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,10 +5,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/NgAbornCtl.php'; -require_once P2_LIB_DIR . '/ThreadList.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; -require_once P2_LIB_DIR . '/ShowThreadPc.php'; require_once P2_LIB_DIR . '/read_new.inc.php'; $_login->authorize(); // [UFØ @@ -322,9 +318,6 @@ // subject.txt ª¢DLÈçƵÄf[^ðzñÉi[ if (empty($subject_txts[$subject_id])) { - if (!class_exists('SubjectTxt', false)) { - require P2_LIB_DIR . '/SubjectTxt.php'; - } $aSubjectTxt = new SubjectTxt($aThread->host, $aThread->bbs); $subject_txts[$subject_id] = $aSubjectTxt->subject_lines; Modified: p2ex/trunk/read_new_k.php =================================================================== --- p2ex/trunk/read_new_k.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read_new_k.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,10 +5,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/NgAbornCtl.php'; -require_once P2_LIB_DIR . '/ThreadList.php'; -require_once P2_LIB_DIR . '/ThreadRead.php'; -require_once P2_LIB_DIR . '/ShowThreadK.php'; require_once P2_LIB_DIR . '/read_new.inc.php'; $_login->authorize(); // [UFØ @@ -300,9 +296,6 @@ // subject.txtª¢DLÈçƵÄf[^ðzñÉi[ if (empty($subject_txts[$subject_id])) { - if (!class_exists('SubjectTxt', false)) { - require P2_LIB_DIR . '/SubjectTxt.php'; - } $aSubjectTxt = new SubjectTxt($aThread->host, $aThread->bbs); $subject_txts[$subject_id] = $aSubjectTxt->subject_lines; Modified: p2ex/trunk/read_res_hist.php =================================================================== --- p2ex/trunk/read_res_hist.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/read_res_hist.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,7 +5,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/ResHist.php'; require_once P2_LIB_DIR . '/read_res_hist.inc.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/spm_k.php =================================================================== --- p2ex/trunk/spm_k.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/spm_k.php 2010-01-13 15:03:54 UTC (rev 776) @@ -5,7 +5,6 @@ require_once './conf/conf.inc.php'; require_once P2_LIB_DIR . '/spm_k.inc.php'; -require_once P2_LIB_DIR . '/Thread.php'; $_login->authorize(); // [UFØ Modified: p2ex/trunk/subject.php =================================================================== --- p2ex/trunk/subject.php 2010-01-13 05:09:32 UTC (rev 775) +++ p2ex/trunk/subject.php 2010-01-13 15:03:54 UTC (rev 776) @@ -7,9 +7,6 @@ */ require_once './conf/conf.inc.php'; -require_once P2_LIB_DIR . '/Thread.php'; -require_once P2_LIB_DIR . '/ThreadList.php'; -require_once P2_LIB_DIR . '/NgAbornCtl.php'; //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('HEAD'); @@ -272,7 +269,6 @@ if (empty($_REQUEST['norefresh']) && !(empty($_REQUEST['refresh']) && isset($_REQUEST['word']))) { if ($_conf['expack.use_pecl_http'] == 1) { - require_once P2_LIB_DIR . '/P2HttpExt.php'; switch ($spmode) { case 'fav': P2HttpRequestPool::fetchSubjectTxt($_conf['favlist_idx']); @@ -292,7 +288,6 @@ break; } } elseif ($_conf['expack.use_pecl_http'] == 2) { - require_once P2_CLI_DIR . '/P2CommandRunner.php'; if (P2CommandRunner::fetchSubjectTxt($spmode, $_conf)) { $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } @@ -556,7 +551,6 @@ if (!isset($subject_txts[$subject_id])) { $subject_txts[$subject_id] = array(); - require_once P2_LIB_DIR . '/SubjectTxt.php'; $aSubjectTxt = new SubjectTxt($aThread->host, $aThread->bbs); //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('subthre_read');