svn: /web/doc-editor/trunk/php/ class.php

From: Date: Wed, 11 Nov 2009 21:45:54 +0000
Subject: svn: /web/doc-editor/trunk/php/ class.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-1148@lists.php.net to get a copy of this message
yannick Wed, 11 Nov 2009 21:45:54 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290551 Log: Remove revDoRevCheck's method from class.php. This method is present in RepositoryManager.php as applyRevCheck'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:44:49 UTC (rev 290550) +++ web/doc-editor/trunk/php/class.php 2009-11-11 21:45:54 UTC (rev 290551) @@ -65,165 +65,6 @@ } /** - * Apply the Revcheck tools recursively on all lang - * - * @param $dir The directory from which we start. - * @return Nothing. - */ - function revDoRevCheck( $dir = '' ) { - if ($dh = @opendir(DOC_EDITOR_CVS_PATH . 'en/' . $dir)) { - - $entriesDir = array(); - $entriesFiles = array(); - - while (($file = readdir($dh)) !== false) { - - if ( !$this->isParsed('en', $dir, $file) ) { - continue; - } - - if ($file != '.' && $file != '..' && $file != 'CVS' && $dir != '/functions') { - - if (is_dir(DOC_EDITOR_CVS_PATH . 'en' . $dir.'/' .$file)) { - $entriesDir[] = $file; - } elseif (is_file(DOC_EDITOR_CVS_PATH . 'en' . $dir.'/' .$file)) { - $entriesFiles[] = $file; - } - } - } - - // Files first - if (sizeof($entriesFiles) > 0 ) { - - foreach($entriesFiles as $file) { - - $path = DOC_EDITOR_CVS_PATH . 'en' . $dir . '/' . $file; - - $en_size = intval(filesize($path) / 1024); - $en_date = filemtime($path); - - $infoEN = $this->getInfoFromFile($path); - $en_revision = ($infoEN['rev'] == 'NULL') ? 'NULL' : "'".$infoEN['rev']."'"; - $xmlid = ($infoEN['xmlid'] == 'NULL') ? 'NULL' : "'".$infoEN['xmlid']."'"; - - $tmp = explode('/', $dir); - - $ToolsCheckDoc = new ToolsCheckDoc($this->db); - $ToolsCheckDocResult = $ToolsCheckDoc->checkDoc($infoEN['content'], $dir); - - // Sql insert. - $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, - "'$dir/'", - "'$file'", - $en_revision, - $en_size, - $en_date, - "NULL", - "NULL", - $ToolsCheckDocResult['check_oldstyle'], - $ToolsCheckDocResult['check_undoc'], - $ToolsCheckDocResult['check_roleerror'], - $ToolsCheckDocResult['check_badorder'], - $ToolsCheckDocResult['check_noseealso'], - $ToolsCheckDocResult['check_noreturnvalues'], - $ToolsCheckDocResult['check_noparameters'], - $ToolsCheckDocResult['check_noexamples'], - $ToolsCheckDocResult['check_noerrors'] - ); - - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - reset($this->availableLanguage); - - // Do for all language - while (list(, $lang) = each($this->availableLanguage)) { - - $path = DOC_EDITOR_CVS_PATH . $lang . $dir . '/' . $file; - - if (is_file($path)) { - - // Initial revcheck method - $size = intval(filesize($path) / 1024); - $date = filemtime($path); - - $size_diff = $en_size - $size; - $date_diff = (intval((time() - $en_date) / 86400)) - (intval((time() - $date) / 86400)); - - $infoLANG = $this->getInfoFromFile($path); - $revision = ($infoLANG['en-rev'] == 'NULL') ? 'NULL' : "'".$infoLANG['en-rev']."'"; - $maintainer = ($infoLANG['maintainer'] == 'NULL') ? 'NULL' : "'".$infoLANG['maintainer']."'"; - $status = ($infoLANG['status'] == 'NULL') ? 'NULL' : "'".$infoLANG['status']."'"; - $xmlid = ($infoLANG['xmlid'] == 'NULL') ? 'NULL' : "'".$infoLANG['xmlid']."'"; - $reviewed = ($infoLANG['reviewed'] == 'NULL') ? 'NULL' : "'".$infoLANG['reviewed']."'"; - - $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, - "'$dir/'", - "'$file'", - $revision, - $en_revision, - $reviewed, - $size, - $size_diff, - $date, - $date_diff, - $maintainer, - $status - ); - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - // Check for error in this file ONLY if this file is uptodate - if ($revision == $en_revision ) { - - $error = new ToolsError($this->db); - $error->setParams($infoEN['content'], $infoLANG['content'], $lang, $dir.'/', $file, $maintainer); - $error->run(); - $error->saveError(); - - } - - } else { - - $s = sprintf('INSERT INTO files (lang, path, name, revision, size, mdate, maintainer, status) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)', - "'$lang'", - "'$dir/'", - "'$file'", - "NULL", - "NULL", - "NULL", - "NULL", - "NULL" - ); - $this->db->query($s) or die('Error: '.$this->db->error.'|'.$s); - - } - - } - - - - } - } - - // Directories.. - if (sizeof($entriesDir) > 0) { - - reset($entriesDir); - - foreach ($entriesDir as $Edir) { - - $this->revDoRevCheck($dir . '/' . $Edir); - - } - } - } - @closedir($dh); - } - - /** * Parse a string to find all attributs. * * @param $tags_attrs The string to parse.

« previous php.doc.web (#1148) next »