cvs: doc-editor /install doc-editor.sql firstRun.php /php ExtJsController.php class.php
| From: | Yannick Torres | Date: | Thu, 23 Apr 2009 20:03:41 +0000 |
| Subject: | cvs: doc-editor /install doc-editor.sql firstRun.php /php ExtJsController.php class.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3851@lists.php.net to get a copy of this message | ||
yannick Thu Apr 23 20:03:41 2009 UTC
Modified files:
/doc-editor/install doc-editor.sql firstRun.php
/doc-editor/php class.php ExtJsController.php
Log:
- Remove unecessary table
http://cvs.php.net/viewvc.cgi/doc-editor/install/doc-editor.sql?r1=1.4&r2=1.5&diff_format=u Index: doc-editor/install/doc-editor.sql diff -u doc-editor/install/doc-editor.sql:1.4 doc-editor/install/doc-editor.sql:1.5 --- doc-editor/install/doc-editor.sql:1.4 Thu Apr 16 17:41:14 2009 +++ doc-editor/install/doc-editor.sql Thu Apr 23 20:03:40 2009 @@ -22,20 +22,6 @@ -- -------------------------------------------------------- -- --- Structure of table `dirs` --- - -CREATE TABLE IF NOT EXISTS `dirs` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `project` varchar(255) NOT NULL, - `parentDir` int(11) NOT NULL, - `name` varchar(255) NOT NULL, - KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- -- Structure of table `errorfiles` -- @@ -63,7 +49,6 @@ `project` varchar(255) NOT NULL, `lang` varchar(10) NOT NULL, `xmlid` varchar(255) DEFAULT NULL, - `dir` int(11) unsigned NOT NULL, `path` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `revision` int(11) unsigned DEFAULT NULL, http://cvs.php.net/viewvc.cgi/doc-editor/install/firstRun.php?r1=1.3&r2=1.4&diff_format=u Index: doc-editor/install/firstRun.php diff -u doc-editor/install/firstRun.php:1.3 doc-editor/install/firstRun.php:1.4 --- doc-editor/install/firstRun.php:1.3 Sat Apr 18 13:27:47 2009 +++ doc-editor/install/firstRun.php Thu Apr 23 20:03:40 2009 @@ -32,7 +32,10 @@ } flush(); //We apply all tools for all language -$phpDoc->revStart(); +$phpDoc->revDoRevCheck(); + +// Search for Old Files +$phpDoc->checkOldFiles(); if ($isCLI) { echo "\n * Parsing translation data..."; http://cvs.php.net/viewvc.cgi/doc-editor/php/class.php?r1=1.40&r2=1.41&diff_format=u Index: doc-editor/php/class.php diff -u doc-editor/php/class.php:1.40 doc-editor/php/class.php:1.41 --- doc-editor/php/class.php:1.40 Wed Apr 22 21:35:17 2009 +++ doc-editor/php/class.php Thu Apr 23 20:03:40 2009 @@ -82,33 +82,49 @@ $lock->release(); } + /** + * Check is the File/Folder must be parsed or not. + * + * @param $lang The lang for this File/Folder. + * @param $dir The checked Folder. + * @param $file The checked File. + * @return Booleen TRUE if the File/Folder must be parsed, FALSE otherwise. + */ + function isParsed($lang, $dir, $file) { + + if ( + (!is_dir(DOC_EDITOR_CVS_PATH . $lang . $dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' ) + || strpos($file, 'entities.') === 0 + || $dir == '/chmonly' || $dir == '/internals' || $dir == '/internals2' + || $file == 'contributors.ent' || $file == 'contributors.xml' + || ($dir == '/appendices' && ($file == 'reserved.constants.xml' || $file == 'extensions.xml')) + || $file == 'README' + || $file == 'DO_NOT_TRANSLATE' + || $file == 'rsusi.txt' + || $file == 'missing-ids.xml' + || $file == 'license.xml' + || $file == 'versions.xml' + ) { + return FALSE; + } else { + return TRUE; + } + } /** * Apply the Revcheck tools recursively on all lang * @param $dir The directory from which we start. - * @param $idDir Directory id from the database. * @return Nothing. */ - function revDoRevCheck( $dir = '', $idDir ) { - if ($dh = opendir(DOC_EDITOR_CVS_PATH . 'en/' . $dir)) { + function revDoRevCheck( $dir = '' ) { + if ($dh = @opendir(DOC_EDITOR_CVS_PATH . 'en/' . $dir)) { $entriesDir = array(); $entriesFiles = array(); while (($file = readdir($dh)) !== false) { - if ( - (!is_dir(DOC_EDITOR_CVS_PATH . 'en' . $dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' ) - || strpos($file, 'entities.') === 0 - || $dir == '/chmonly' || $dir == '/internals' || $dir == '/internals2' - || $file == 'contributors.ent' || $file == 'contributors.xml' - || ($dir == '/appendices' && ($file == 'reserved.constants.xml' || $file == 'extensions.xml')) - || $file == 'README' - || $file == 'DO_NOT_TRANSLATE' - || $file == 'rsusi.txt' - || $file == 'missing-ids.xml' - || $file == 'license.xml' - || $file == 'versions.xml' - ) { + + if ( !$this->isParsed('en', $dir, $file) ) { continue; } @@ -142,10 +158,9 @@ $ToolsCheckDocResult = $ToolsCheckDoc->checkDoc($infoEN['content'], $dir); // Sql insert. - $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `dir`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`, `check_oldstyle`, `check_undoc`, `check_roleerror`, `check_badorder`, `check_noseealso`, `check_noreturnvalues`, `check_noparameters`, `check_noexamples`, `check_noerrors`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', + $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`, `check_oldstyle`, `check_undoc`, `check_roleerror`, `check_badorder`, `check_noseealso`, `check_noreturnvalues`, `check_noparameters`, `check_noexamples`, `check_noerrors`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', "'en'", $xmlid, - "'$idDir'", "'$dir/'", "'$file'", $en_revision, @@ -189,10 +204,9 @@ $xmlid = ($infoLANG['xmlid'] == 'NULL') ? 'NULL' : "'".$infoLANG['xmlid']."'"; $reviewed = ($infoLANG['reviewed'] == 'NULL') ? 'NULL' : "'".$infoLANG['reviewed']."'"; - $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `dir`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `size`, `size_diff`, `mdate`, `mdate_diff`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', + $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `size`, `size_diff`, `mdate`, `mdate_diff`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', "'$lang'", $xmlid, - "'$idDir'", "'$dir/'", "'$file'", $revision, @@ -219,9 +233,8 @@ } else { - $s = sprintf('INSERT INTO `files` (`lang`, `dir`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)', + $s = sprintf('INSERT INTO `files` (`lang`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)', "'$lang'", - "'$idDir'", "'$dir/'", "'$file'", "NULL", @@ -248,33 +261,12 @@ foreach ($entriesDir as $Edir) { - $path = DOC_EDITOR_CVS_PATH . 'en/' . $dir . '/' . $Edir; - - $s = sprintf('INSERT INTO `dirs` (`parentDir`, `name`) VALUES (%s, "%s")', $idDir, $Edir); - - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - $last_id = $this->db->insert_id; - $this->revDoRevCheck($dir . '/' . $Edir, $last_id); + $this->revDoRevCheck($dir . '/' . $Edir); } } } - closedir($dh); - } - - /** - * Part of the revcheck tools. Start the Revcheck tools. - * @return Nothing. - */ - function revStart() { - - $s = sprintf('INSERT INTO `dirs` (`parentDir`, `name`) VALUES (%s, "/")', 0); - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - $firstDir = $this->db->insert_id; - $this->revDoRevCheck('', $firstDir); - + @closedir($dh); } /** @@ -647,33 +639,32 @@ return $tag_attrs_processed; } - function revCheckOldFiles($dir = '') { + function checkOldFiles() { + + while (list(, $lang) = each($this->availableLanguage)) { + + $this->doCheckOldFiles('', $lang); + + } + } + + function doCheckOldFiles($dir = '', $lang) { - if ($dh = opendir(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir)) { + if ($dh = @opendir(DOC_EDITOR_CVS_PATH . $lang . $dir)) { $entriesDir = array(); $entriesFiles = array(); while (($file = readdir($dh)) !== false) { - if ( - (!is_dir(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' ) - || strpos($file, 'entities.') === 0 - || $dir == '/chmonly' || $dir == '/internals' || $dir == '/internals2' - || $file == 'contributors.ent' || $file == 'contributors.xml' - || ($dir == '/appendices' && ($file == 'reserved.constants.xml' || $file == 'extensions.xml')) - || $file == 'README' - || $file == 'DO_NOT_TRANSLATE' - || $file == 'rsusi.txt' - || $file == 'missing-ids.xml' - ) { + if ( !$this->isParsed($lang, $dir, $file) ) { continue; } if ($file != '.' && $file != '..' && $file != 'CVS' && $dir != '/functions') { - if (is_dir(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir.'/' .$file)) { + if (is_dir(DOC_EDITOR_CVS_PATH . $lang . $dir.'/' .$file)) { $entriesDir[] = $file; - } elseif (is_file(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir.'/' .$file)) { + } elseif (is_file(DOC_EDITOR_CVS_PATH . $lang . $dir.'/' .$file)) { $entriesFiles[] = $file; } } @@ -683,13 +674,17 @@ if (!empty($entriesFiles)) { foreach($entriesFiles as $file) { $path_en = DOC_EDITOR_CVS_PATH . 'en/' . $dir . '/' . $file; - $path = DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir . '/' . $file; + $path = DOC_EDITOR_CVS_PATH . $lang . $dir . '/' . $file; if (!@is_file($path_en)) { $size = intval(filesize($path) / 1024); - - $s = sprintf('INSERT INTO `old_files` (`lang`, `dir`, `file`, `size`, `userID`) VALUES ("%s", "%s", "%s", "%s", %s)', $lang, $dir, $file, $size, $this->userID); - + + $s = sprintf('INSERT INTO `files` (`lang`, `path`, `name`, `status`) VALUES (%s, %s, %s, %s)', + "'".$lang."'", + "'$dir/'", + "'$file'", + "'NotInEN'" + ); $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); } } @@ -698,11 +693,11 @@ // Directories.. if (!empty($entriesDir)) { foreach ($entriesDir as $Edir) { - $this->revCheckOldFiles($dir . '/' . $Edir); + $this->doCheckOldFiles($dir . '/' . $Edir, $lang); } } } - closedir($dh); + @closedir($dh); } /** @@ -1278,7 +1273,7 @@ LEFT JOIN `files` b ON - a.dir = b.dir + a.path = b.path AND a.name = b.name WHERE @@ -1313,7 +1308,7 @@ LEFT JOIN `files` b ON - a.dir = b.dir + a.path = b.path AND a.name = b.name WHERE @@ -1353,7 +1348,7 @@ LEFT JOIN `files` b ON - a.dir = b.dir + a.path = b.path AND a.name = b.name WHERE http://cvs.php.net/viewvc.cgi/doc-editor/php/ExtJsController.php?r1=1.22&r2=1.23&diff_format=u Index: doc-editor/php/ExtJsController.php diff -u doc-editor/php/ExtJsController.php:1.22 doc-editor/php/ExtJsController.php:1.23 --- doc-editor/php/ExtJsController.php:1.22 Wed Apr 22 20:55:57 2009 +++ doc-editor/php/ExtJsController.php Thu Apr 23 20:03:40 2009 @@ -158,8 +158,12 @@ $lock = new LockFile('lock_apply_tools'); if ($lock->lock()) { + // Start Revcheck - $this->phpDoc->revStart(); + $this->phpDoc->revDoRevCheck(); + + // Search for Old Files + $this->phpDoc->checkOldFiles(); // Parse translators $this->phpDoc->revParseTranslation(); @@ -167,10 +171,6 @@ // Set lastUpdate date/time $this->phpDoc->setLastUpdate(); - // Check errors in files - // $tool = new ToolsError($_SESSION['lang']); - // $tool->run('/'); - } $lock->release();
dir
- Add checkOldFiles functionnaly to check for files witch is present in LANG and not in EN
http://cvs.php.net/viewvc.cgi/doc-editor/install/doc-editor.sql?r1=1.4&r2=1.5&diff_format=u Index: doc-editor/install/doc-editor.sql diff -u doc-editor/install/doc-editor.sql:1.4 doc-editor/install/doc-editor.sql:1.5 --- doc-editor/install/doc-editor.sql:1.4 Thu Apr 16 17:41:14 2009 +++ doc-editor/install/doc-editor.sql Thu Apr 23 20:03:40 2009 @@ -22,20 +22,6 @@ -- -------------------------------------------------------- -- --- Structure of table `dirs` --- - -CREATE TABLE IF NOT EXISTS `dirs` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `project` varchar(255) NOT NULL, - `parentDir` int(11) NOT NULL, - `name` varchar(255) NOT NULL, - KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- -- Structure of table `errorfiles` -- @@ -63,7 +49,6 @@ `project` varchar(255) NOT NULL, `lang` varchar(10) NOT NULL, `xmlid` varchar(255) DEFAULT NULL, - `dir` int(11) unsigned NOT NULL, `path` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `revision` int(11) unsigned DEFAULT NULL, http://cvs.php.net/viewvc.cgi/doc-editor/install/firstRun.php?r1=1.3&r2=1.4&diff_format=u Index: doc-editor/install/firstRun.php diff -u doc-editor/install/firstRun.php:1.3 doc-editor/install/firstRun.php:1.4 --- doc-editor/install/firstRun.php:1.3 Sat Apr 18 13:27:47 2009 +++ doc-editor/install/firstRun.php Thu Apr 23 20:03:40 2009 @@ -32,7 +32,10 @@ } flush(); //We apply all tools for all language -$phpDoc->revStart(); +$phpDoc->revDoRevCheck(); + +// Search for Old Files +$phpDoc->checkOldFiles(); if ($isCLI) { echo "\n * Parsing translation data..."; http://cvs.php.net/viewvc.cgi/doc-editor/php/class.php?r1=1.40&r2=1.41&diff_format=u Index: doc-editor/php/class.php diff -u doc-editor/php/class.php:1.40 doc-editor/php/class.php:1.41 --- doc-editor/php/class.php:1.40 Wed Apr 22 21:35:17 2009 +++ doc-editor/php/class.php Thu Apr 23 20:03:40 2009 @@ -82,33 +82,49 @@ $lock->release(); } + /** + * Check is the File/Folder must be parsed or not. + * + * @param $lang The lang for this File/Folder. + * @param $dir The checked Folder. + * @param $file The checked File. + * @return Booleen TRUE if the File/Folder must be parsed, FALSE otherwise. + */ + function isParsed($lang, $dir, $file) { + + if ( + (!is_dir(DOC_EDITOR_CVS_PATH . $lang . $dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' ) + || strpos($file, 'entities.') === 0 + || $dir == '/chmonly' || $dir == '/internals' || $dir == '/internals2' + || $file == 'contributors.ent' || $file == 'contributors.xml' + || ($dir == '/appendices' && ($file == 'reserved.constants.xml' || $file == 'extensions.xml')) + || $file == 'README' + || $file == 'DO_NOT_TRANSLATE' + || $file == 'rsusi.txt' + || $file == 'missing-ids.xml' + || $file == 'license.xml' + || $file == 'versions.xml' + ) { + return FALSE; + } else { + return TRUE; + } + } /** * Apply the Revcheck tools recursively on all lang * @param $dir The directory from which we start. - * @param $idDir Directory id from the database. * @return Nothing. */ - function revDoRevCheck( $dir = '', $idDir ) { - if ($dh = opendir(DOC_EDITOR_CVS_PATH . 'en/' . $dir)) { + function revDoRevCheck( $dir = '' ) { + if ($dh = @opendir(DOC_EDITOR_CVS_PATH . 'en/' . $dir)) { $entriesDir = array(); $entriesFiles = array(); while (($file = readdir($dh)) !== false) { - if ( - (!is_dir(DOC_EDITOR_CVS_PATH . 'en' . $dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' ) - || strpos($file, 'entities.') === 0 - || $dir == '/chmonly' || $dir == '/internals' || $dir == '/internals2' - || $file == 'contributors.ent' || $file == 'contributors.xml' - || ($dir == '/appendices' && ($file == 'reserved.constants.xml' || $file == 'extensions.xml')) - || $file == 'README' - || $file == 'DO_NOT_TRANSLATE' - || $file == 'rsusi.txt' - || $file == 'missing-ids.xml' - || $file == 'license.xml' - || $file == 'versions.xml' - ) { + + if ( !$this->isParsed('en', $dir, $file) ) { continue; } @@ -142,10 +158,9 @@ $ToolsCheckDocResult = $ToolsCheckDoc->checkDoc($infoEN['content'], $dir); // Sql insert. - $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `dir`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`, `check_oldstyle`, `check_undoc`, `check_roleerror`, `check_badorder`, `check_noseealso`, `check_noreturnvalues`, `check_noparameters`, `check_noexamples`, `check_noerrors`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', + $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`, `check_oldstyle`, `check_undoc`, `check_roleerror`, `check_badorder`, `check_noseealso`, `check_noreturnvalues`, `check_noparameters`, `check_noexamples`, `check_noerrors`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', "'en'", $xmlid, - "'$idDir'", "'$dir/'", "'$file'", $en_revision, @@ -189,10 +204,9 @@ $xmlid = ($infoLANG['xmlid'] == 'NULL') ? 'NULL' : "'".$infoLANG['xmlid']."'"; $reviewed = ($infoLANG['reviewed'] == 'NULL') ? 'NULL' : "'".$infoLANG['reviewed']."'"; - $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `dir`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `size`, `size_diff`, `mdate`, `mdate_diff`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', + $s = sprintf('INSERT INTO `files` (`lang`, `xmlid`, `path`, `name`, `revision`, `en_revision`, `reviewed`, `size`, `size_diff`, `mdate`, `mdate_diff`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', "'$lang'", $xmlid, - "'$idDir'", "'$dir/'", "'$file'", $revision, @@ -219,9 +233,8 @@ } else { - $s = sprintf('INSERT INTO `files` (`lang`, `dir`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)', + $s = sprintf('INSERT INTO `files` (`lang`, `path`, `name`, `revision`, `size`, `mdate`, `maintainer`, `status`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)', "'$lang'", - "'$idDir'", "'$dir/'", "'$file'", "NULL", @@ -248,33 +261,12 @@ foreach ($entriesDir as $Edir) { - $path = DOC_EDITOR_CVS_PATH . 'en/' . $dir . '/' . $Edir; - - $s = sprintf('INSERT INTO `dirs` (`parentDir`, `name`) VALUES (%s, "%s")', $idDir, $Edir); - - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - $last_id = $this->db->insert_id; - $this->revDoRevCheck($dir . '/' . $Edir, $last_id); + $this->revDoRevCheck($dir . '/' . $Edir); } } } - closedir($dh); - } - - /** - * Part of the revcheck tools. Start the Revcheck tools. - * @return Nothing. - */ - function revStart() { - - $s = sprintf('INSERT INTO `dirs` (`parentDir`, `name`) VALUES (%s, "/")', 0); - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - $firstDir = $this->db->insert_id; - $this->revDoRevCheck('', $firstDir); - + @closedir($dh); } /** @@ -647,33 +639,32 @@ return $tag_attrs_processed; } - function revCheckOldFiles($dir = '') { + function checkOldFiles() { + + while (list(, $lang) = each($this->availableLanguage)) { + + $this->doCheckOldFiles('', $lang); + + } + } + + function doCheckOldFiles($dir = '', $lang) { - if ($dh = opendir(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir)) { + if ($dh = @opendir(DOC_EDITOR_CVS_PATH . $lang . $dir)) { $entriesDir = array(); $entriesFiles = array(); while (($file = readdir($dh)) !== false) { - if ( - (!is_dir(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' ) - || strpos($file, 'entities.') === 0 - || $dir == '/chmonly' || $dir == '/internals' || $dir == '/internals2' - || $file == 'contributors.ent' || $file == 'contributors.xml' - || ($dir == '/appendices' && ($file == 'reserved.constants.xml' || $file == 'extensions.xml')) - || $file == 'README' - || $file == 'DO_NOT_TRANSLATE' - || $file == 'rsusi.txt' - || $file == 'missing-ids.xml' - ) { + if ( !$this->isParsed($lang, $dir, $file) ) { continue; } if ($file != '.' && $file != '..' && $file != 'CVS' && $dir != '/functions') { - if (is_dir(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir.'/' .$file)) { + if (is_dir(DOC_EDITOR_CVS_PATH . $lang . $dir.'/' .$file)) { $entriesDir[] = $file; - } elseif (is_file(DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir.'/' .$file)) { + } elseif (is_file(DOC_EDITOR_CVS_PATH . $lang . $dir.'/' .$file)) { $entriesFiles[] = $file; } } @@ -683,13 +674,17 @@ if (!empty($entriesFiles)) { foreach($entriesFiles as $file) { $path_en = DOC_EDITOR_CVS_PATH . 'en/' . $dir . '/' . $file; - $path = DOC_EDITOR_CVS_PATH . $this->cvsLang . $dir . '/' . $file; + $path = DOC_EDITOR_CVS_PATH . $lang . $dir . '/' . $file; if (!@is_file($path_en)) { $size = intval(filesize($path) / 1024); - - $s = sprintf('INSERT INTO `old_files` (`lang`, `dir`, `file`, `size`, `userID`) VALUES ("%s", "%s", "%s", "%s", %s)', $lang, $dir, $file, $size, $this->userID); - + + $s = sprintf('INSERT INTO `files` (`lang`, `path`, `name`, `status`) VALUES (%s, %s, %s, %s)', + "'".$lang."'", + "'$dir/'", + "'$file'", + "'NotInEN'" + ); $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); } } @@ -698,11 +693,11 @@ // Directories.. if (!empty($entriesDir)) { foreach ($entriesDir as $Edir) { - $this->revCheckOldFiles($dir . '/' . $Edir); + $this->doCheckOldFiles($dir . '/' . $Edir, $lang); } } } - closedir($dh); + @closedir($dh); } /** @@ -1278,7 +1273,7 @@ LEFT JOIN `files` b ON - a.dir = b.dir + a.path = b.path AND a.name = b.name WHERE @@ -1313,7 +1308,7 @@ LEFT JOIN `files` b ON - a.dir = b.dir + a.path = b.path AND a.name = b.name WHERE @@ -1353,7 +1348,7 @@ LEFT JOIN `files` b ON - a.dir = b.dir + a.path = b.path AND a.name = b.name WHERE http://cvs.php.net/viewvc.cgi/doc-editor/php/ExtJsController.php?r1=1.22&r2=1.23&diff_format=u Index: doc-editor/php/ExtJsController.php diff -u doc-editor/php/ExtJsController.php:1.22 doc-editor/php/ExtJsController.php:1.23 --- doc-editor/php/ExtJsController.php:1.22 Wed Apr 22 20:55:57 2009 +++ doc-editor/php/ExtJsController.php Thu Apr 23 20:03:40 2009 @@ -158,8 +158,12 @@ $lock = new LockFile('lock_apply_tools'); if ($lock->lock()) { + // Start Revcheck - $this->phpDoc->revStart(); + $this->phpDoc->revDoRevCheck(); + + // Search for Old Files + $this->phpDoc->checkOldFiles(); // Parse translators $this->phpDoc->revParseTranslation(); @@ -167,10 +171,6 @@ // Set lastUpdate date/time $this->phpDoc->setLastUpdate(); - // Check errors in files - // $tool = new ToolsError($_SESSION['lang']); - // $tool->run('/'); - } $lock->release();