[P2-php-svn] [805] expack:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 25日 (月) 23:10:16 JST


Revision: 805
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=805
Author:   rsk
Date:     2010-01-25 23:10:15 +0900 (Mon, 25 Jan 2010)

Log Message:
-----------
expack:
- コマンドラインでの並列ダウンロードでプロキシ設定が
  無効になっていたのを修正。
- E_NOTICE削減中。

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/ic2.php
    p2ex/trunk/lib/bootstrap.php
    p2ex/trunk/lib/sb_footer.inc.php
    p2ex/trunk/post.php
    p2ex/trunk/read.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-01-25 12:33:41 UTC (rev 804)
+++ p2ex/trunk/conf/conf.inc.php	2010-01-25 14:10:15 UTC (rev 805)
@@ -301,11 +301,6 @@
         }
     }
 
-    // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ƒ‚[ƒh‚Å‚Í‚±‚±‚Ü‚Å
-    if (defined('P2_CLI_RUN')) {
-        return;
-    }
-
     // }}}
 
     include P2_LIB_DIR . '/bootstrap.php';

Modified: p2ex/trunk/ic2.php
===================================================================
--- p2ex/trunk/ic2.php	2010-01-25 12:33:41 UTC (rev 804)
+++ p2ex/trunk/ic2.php	2010-01-25 14:10:15 UTC (rev 805)
@@ -459,8 +459,7 @@
     ic2_finish($filepath, $thumb, $params, false);
 }
 
-$params = array('uri' => $uri, 'host' => $host, 'name' => $name, 'size' => $size, 'md5' => $md5,
-                'width' => $width, 'height' => $height, 'mime' => $mime, 'memo' => $memo);
+$params = compact('uri', 'host', 'name', 'size', 'md5', 'width', 'height', 'mime', 'memo');
 
 // ƒtƒ@ƒCƒ‹ƒTƒCƒY‚ªãŒÀ‚ð‰z‚¦‚Ä‚¢‚È‚¢‚©Šm”F
 ic2_checkSizeOvered($tmpfile, $params);
@@ -623,7 +622,7 @@
     } else {
         $maxsize = (int)$maxsize;
     }
-    if (0 < $maxsize && $maxsize < $conent_length) {
+    if (0 < $maxsize) {
         $isError = true;
         $errmsg = "ƒtƒ@ƒCƒ‹ƒTƒCƒY‚ª‘å‚«‚·‚¬‚Ü‚·B(file:{$size}; max:{$maxsize};)";
     }

Modified: p2ex/trunk/lib/bootstrap.php
===================================================================
--- p2ex/trunk/lib/bootstrap.php	2010-01-25 12:33:41 UTC (rev 804)
+++ p2ex/trunk/lib/bootstrap.php	2010-01-25 14:10:15 UTC (rev 805)
@@ -18,7 +18,9 @@
 
     // ‰½‚ç‚©‚Ì——R‚ц[ƒU[Ý’èƒtƒ@ƒCƒ‹‚ª‰ó‚ê‚Ä‚¢‚½‚ç
     if (!is_array($conf_user)) {
-        if (unlink($_conf['conf_user_file'])) {
+        if (defined('P2_CLI_RUN')) {
+            p2die("ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹ {$dispname} ‚ª“ǂݍž‚ß‚È‚©‚Á‚½‚©A‰ó‚ê‚Ä‚¢‚Ü‚·B");
+        } elseif (unlink($_conf['conf_user_file'])) {
             P2Util::pushInfoHtml('<p>ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹‚ª‰ó‚ê‚Ä‚¢‚½‚̂ō폜‚µ‚Ü‚µ‚½B</p>');
             $conf_user = array();
         } else {
@@ -36,7 +38,7 @@
         $config_version = '000000.0000';
     }
 
-    if ($config_version !== $_conf['p2expack']) {
+    if ($config_version !== $_conf['p2expack'] && !defined('P2_CLI_RUN')) {
         // Ý’è‚̍XV
         if ($migrators = p2_check_migration($config_version)) {
             $conf_user = p2_invoke_migrators($migrators, $conf_user);
@@ -58,6 +60,11 @@
     $save_conf_user = true;
 }
 
+// ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ƒ‚[ƒh‚Å‚Í‚±‚±‚Ü‚Å
+if (defined('P2_CLI_RUN')) {
+    return;
+}
+
 // V‚µ‚¢ƒ†[ƒU[Ý’è‚ðƒVƒŠƒAƒ‰ƒCƒY‚µ‚Ä•Û‘¶
 if ($save_conf_user) {
     $conf_save = array('.' => $_conf['p2expack']);

Modified: p2ex/trunk/lib/sb_footer.inc.php
===================================================================
--- p2ex/trunk/lib/sb_footer.inc.php	2010-01-25 12:33:41 UTC (rev 804)
+++ p2ex/trunk/lib/sb_footer.inc.php	2010-01-25 14:10:15 UTC (rev 805)
@@ -82,7 +82,7 @@
 // ƒXƒyƒVƒƒƒ‹ƒ‚[ƒh‚Å‚È‚¯‚ê‚΃tƒH[ƒ€“ü—͕⊮========================
 $ini_url_text = '';
 if (!$aThreadList->spmode) {
-    if (P2Util::isHostJbbsShitaraba($aThread->host)) { // ‚µ‚½‚ç‚Î
+    if (P2Util::isHostJbbsShitaraba($aThreadList->host)) { // ‚µ‚½‚ç‚Î
         $ini_url_text = "http://{$aThreadList->host}/bbs/read.cgi?BBS={$aThreadList->bbs}&KEY=";
     } elseif (P2Util::isHostMachiBbs($aThreadList->host)) { // ‚Ü‚¿BBS
         $ini_url_text = "http://{$aThreadList->host}/bbs/read.pl?BBS={$aThreadList->bbs}&KEY=";

Modified: p2ex/trunk/post.php
===================================================================
--- p2ex/trunk/post.php	2010-01-25 12:33:41 UTC (rev 804)
+++ p2ex/trunk/post.php	2010-01-25 14:10:15 UTC (rev 805)
@@ -377,7 +377,7 @@
         $send_path = $bbs_cgi_url;
     } else {
         $send_host = $URL['host'];
-        $send_port = $URL['port'];
+        $send_port = isset($URL['port']) ? $URL['port'] : 80;
         $send_path = $URL['path'] . $URL['query'];
     }
 
@@ -446,10 +446,13 @@
     //echo '<h4>$request</h4><p>' . $request . "</p>"; //for debug
     fputs($fp, $request);
 
+    $start_here = false;
+    $post_seikou = false;
+
     while (!p2_stream_eof($fp, $timed_out)) {
 
         if ($start_here) {
-
+            $wr = '';
             while (!p2_stream_eof($fp, $timed_out)) {
                 $wr .= fread($fp, 164000);
             }
@@ -459,7 +462,6 @@
         } else {
             $l = fgets($fp, 164000);
             //echo $l .'<br>'; // for debug
-            $response_header_ht .= $l . '<br>';
             // ƒNƒbƒL[ƒLƒ^
             if (preg_match('/Set-Cookie: (.+?)\\r\\n/', $l, $matches)) {
                 //echo '<p>' . $matches[0] . '</p>'; //
@@ -478,7 +480,7 @@
                     }
                 }
                 if ($p2cookies) {
-                    unset($cookies_to_send);
+                    $cookies_to_send = '';
                     foreach ($p2cookies as $cname => $cvalue) {
                         if ($cname != 'expires') {
                             $cookies_to_send .= " {$cname}={$cvalue};";
@@ -610,6 +612,7 @@
 EOJS;
 
     } else {
+        $popup_ht = '';
         $_conf['extra_headers_ht'] .= <<<EOP
 <meta http-equiv="refresh" content="1;URL={$location_noenc}">
 EOP;
@@ -651,6 +654,7 @@
         if ($reload) {
             echo $popup_ht;
         }
+        $kakunin_ht = '';
     } else {
         $kakunin_ht = <<<EOP
 <p><a href="{$location_ht}">Šm”F</a></p>

Modified: p2ex/trunk/read.php
===================================================================
--- p2ex/trunk/read.php	2010-01-25 12:33:41 UTC (rev 804)
+++ p2ex/trunk/read.php	2010-01-25 14:10:15 UTC (rev 805)
@@ -70,7 +70,7 @@
         if ($res_filter) {
             $res_filter_cont = serialize($res_filter);
         }
-        if ($res_filter_cont && !$popup_filter) {
+        if ($res_filter_cont && empty($popup_filter)) {
             if (FileCtl::file_write_contents($cachefile, $res_filter_cont) === false) {
                 p2die('cannot write file.');
             }



P2-php-svn メーリングリストの案内
Back to archive index