svn: /web/doc-editor/trunk/php/ class.php
[email protected] (Yannick Torres)
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <[email protected]> |
yannick Wed, 11 Nov 2009 21:32:59 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=290543
Log:
Remove clearLocalChange's method from class.php. This method is present in RepositoryManager.php as clearLocalChange's method
Changed paths:
U web/doc-editor/trunk/php/class.php
Modified: web/doc-editor/trunk/php/class.php
===================================================================
--- web/doc-editor/trunk/php/class.php 2009-11-11 21:31:30 UTC (rev 290542)
+++ web/doc-editor/trunk/php/class.php 2009-11-11 21:32:59 UTC (rev 290543)
@@ -1372,84 +1372,6 @@
}
/**
- * Delete local change of a file.
- *
- * @param $type The type of the file. Can be 'update', 'delete' or new'
- * @param $path The path of the file.
- * @param $file The name of the file.
- * @return An array witch contain informations about this file.
- */
- function clearLocalChange($type, $path, $file) {
-
- // Extract the lang
- $t = explode('/',$path);
- $lang = $t[0];
- array_shift($t);
-
- // Add first /
- $path = '/'.implode('/', $t);
-
- // We need delete row from pendingCommit table
- $s = sprintf('SELECT `id` FROM `pendingCommit` WHERE `lang`="%s" AND `path`="%s" AND name="%s"', $lang, $path, $file);
- $r = $this->db->query($s);
- $a = $r->fetch_object();
-
- // We need delete row from pendingCommit table
- $s = sprintf('DELETE FROM `pendingCommit` WHERE `id`="%s"', $a->id);
- $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s);
-
- // If type == delete or new, we stop here and return
- if( $type == 'delete' || $type == 'new' ) {
- return;
- }
-
- // We need delete file on filesystem
- $doc = DOC_EDITOR_CVS_PATH.$lang.$path.$file.".new";
-
- @unlink($doc);
-
- // We need check for error in this file
-
- $en_content = file_get_contents(DOC_EDITOR_CVS_PATH.'en'.$path.$file);
- $lang_content = file_get_contents(DOC_EDITOR_CVS_PATH.$lang.$path.$file);
-
- $info = $this->getInfoFromContent($lang_content);
-
- $anode[0] = array( 'lang' => $lang,
- 'path' => $path,
- 'name' => $file,
- 'en_content' => $en_content,
- 'lang_content' => $lang_content,
- 'maintainer' => $info['maintainer']
- );
-
- $errorTools = new ToolsError($this->db);
- $error = $errorTools->updateFilesError($anode, 'nocommit');
-
- // We need reload original lang_revision
- $s = sprintf('SELECT `revision`, `maintainer`, `reviewed` FROM `files` WHERE `lang`="%s" AND `path`="%s" AND `name`="%s"', $lang, $path, $file);
- $r = $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s);
- $a = $r->fetch_object();
-
- $info = array();
- $info['rev'] = $a->revision;
- $info['maintainer'] = $a->maintainer;
- $info['reviewed'] = $a->reviewed;
-
- if (isset($error['first'])) {
- $info['errorState'] = true;
- $info['errorFirst'] = $error['first'];
- } else {
- $info['errorState'] = false;
- $info['errorFirst'] = '-No error-';
- }
-
- // We return original lang_revision & maintainer
- return $info;
-
- }
-
- /**
* Highlights the given commit log
*
* @param $message The commit log