svn: /web/doc-editor/trunk/php/ AccountManager.php DBConnection.php RepositoryManager.php utility.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Mon, 04 Jan 2010 06:19:33 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=293067

Log:
Add debug possibility & fix project var position into statment

Changed paths:
    U   web/doc-editor/trunk/php/AccountManager.php
    U   web/doc-editor/trunk/php/DBConnection.php
    U   web/doc-editor/trunk/php/RepositoryManager.php
    U   web/doc-editor/trunk/php/utility.php

Modified: web/doc-editor/trunk/php/AccountManager.php
===================================================================
--- web/doc-editor/trunk/php/AccountManager.php	2010-01-04 06:09:59 UTC (rev 293066)
+++ web/doc-editor/trunk/php/AccountManager.php	2010-01-04 06:19:33 UTC (rev 293067)
@@ -2,6 +2,7 @@

 require_once dirname(__FILE__) . '/VCSFactory.php';
 require_once dirname(__FILE__) . '/DBConnection.php';
+require_once dirname(__FILE__) . '/ProjectManager.php';

 class AccountManager
 {

Modified: web/doc-editor/trunk/php/DBConnection.php
===================================================================
--- web/doc-editor/trunk/php/DBConnection.php	2010-01-04 06:09:59 UTC (rev 293066)
+++ web/doc-editor/trunk/php/DBConnection.php	2010-01-04 06:19:33 UTC (rev 293067)
@@ -1,6 +1,7 @@
 <?php

 require_once dirname(__FILE__) .'/conf.inc.php';
+require_once dirname(__FILE__) .'/utility.php';

 class DBConnection
 {

Modified: web/doc-editor/trunk/php/RepositoryManager.php
===================================================================
--- web/doc-editor/trunk/php/RepositoryManager.php	2010-01-04 06:09:59 UTC (rev 293066)
+++ web/doc-editor/trunk/php/RepositoryManager.php	2010-01-04 06:19:33 UTC (rev 293067)
@@ -565,6 +565,9 @@
      */
     public function updateFileInfo($files)
     {
+
+        $am = AccountManager::getInstance();
+
         foreach ($files as $file) {

             $info    = $file->getInfo();
@@ -585,8 +588,7 @@
                             `lang` = "%s" AND
                             `path` = "%s" AND
                             `name` = "%s"',
-                    AccountManager::getInstance()->project,
-                    $info['xmlid'], $info['rev'], $size, $date, $file->lang, $file->path, $file->name
+                    $info['xmlid'], $info['rev'], $size, $date, $am->project, $file->lang, $file->path, $file->name
                 );
                 DBConnection::getInstance()->query($s);

@@ -600,8 +602,7 @@
                             `lang` != "%s" AND
                             `path`  = "%s" AND
                             `name`  = "%s"',
-                    AccountManager::getInstance()->project,
-                    $info['rev'], $file->lang, $file->path, $file->name
+                    $info['rev'], $am->project, $file->lang, $file->path, $file->name
                 );
                 DBConnection::getInstance()->query($s);

@@ -636,10 +637,9 @@
                             `lang` = "%s" AND
                             `path` = "%s" AND
                             `name` = "%s"',
-                    AccountManager::getInstance()->project,
                     $info['xmlid'], $info['en-rev'], $enInfo['rev'], trim($info['reviewed']), $size, $date,
                     trim($info['maintainer']), trim($info['status']),   $size_diff,
-                    $date_diff, $file->lang, $file->path, $file->name
+                    $date_diff, $am->project, $file->lang, $file->path, $file->name
                 );
                 DBConnection::getInstance()->query($s);
             }

Modified: web/doc-editor/trunk/php/utility.php
===================================================================
--- web/doc-editor/trunk/php/utility.php	2010-01-04 06:09:59 UTC (rev 293066)
+++ web/doc-editor/trunk/php/utility.php	2010-01-04 06:19:33 UTC (rev 293067)
@@ -9,12 +9,12 @@
  */
 function debug($mess)
 {
-    $mess = '['.date('d/m/Y H:i:s').'] by '
-            .AccountManager::getInstance()->vcsLogin.' : '.$mess."\n";
+    $mess = '['.@date('d/m/Y H:i:s').'] by '
+            .AccountManager::getInstance()->vcsLogin.' : '.str_replace("\r\n", " ", $mess)."\n";

     $fp = fopen($GLOBALS['DOC_EDITOR_VCS_PATH'].'../.debug', 'a+');
     fwrite($fp, $mess);
     fclose($fp);
 }

-?>
+?>
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.