com web/doc: Next optimizations: .gitignore scripts/gen_pictu re_info.php scripts/gen_picture_info_all_lang.p hp scripts/gen_translation_info.sh
scripts/rev.php scripts/set_ownership.sh www/trantools/index.php

From: Date: Fri, 28 Mar 2014 04:18:24 +0000
Subject: com web/doc: Next optimizations: .gitignore scripts/gen_pictu re_info.php scripts/gen_picture_info_all_lang.p hp scripts/gen_translation_info.sh
scripts/rev.php scripts/set_ownership.sh www/trantools/index.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-2346@lists.php.net to get a copy of this message
Commit: 0df3ca913287951df9c516907ad6186c73b1f7f0 Author: Sobak <msobaczewski@gmail.com> Fri, 28 Mar 2014 05:18:24 +0100 Parents: 1f8e47644616e510ee8005f3ac69fa0fc35ff630 Branches: master Link: http://git.php.net/?p=web/doc.git;a=commitdiff;h=0df3ca913287951df9c516907ad6186c73b1f7f0 Log: Next optimizations Changed paths: M .gitignore M scripts/gen_picture_info.php M scripts/gen_picture_info_all_lang.php D scripts/gen_translation_info.sh M scripts/rev.php D scripts/set_ownership.sh D www/trantools/index.php

diff --git a/.gitignore b/.gitignore index 13f83d3..02034bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,6 @@ -scripts/log.txt -www/trantools/maintainer_*.html -www/trantools/params_*.html -www/trantools/revcheck_*.html -www/trantools/reviewedcheck_*.html -www/trantools/transcheck_*.html -www/images/info_revcheck_* -www/images/users/*.jpg -www/phd/docs -www/robots.txt -www/orphan_notes.php -www/notes_stats-data.php -www/pearscs.phar -sqlite -files -cvs build-ops build-ops.php -config.cache -config.log -config.status -.*.swp -automate4te.cache -diff -.externalToolBuilders -.project -project.index -sqlite/*sqlite -shared \ No newline at end of file +shared +sqlite +svn +www/robots.txt \ No newline at end of file diff --git a/scripts/gen_picture_info.php b/scripts/gen_picture_info.php index 37fb181..d5f3c34 100644 --- a/scripts/gen_picture_info.php +++ b/scripts/gen_picture_info.php @@ -3,7 +3,6 @@ include '../include/jpgraph/src/jpgraph.php'; include '../include/jpgraph/src/jpgraph_pie.php'; include '../include/jpgraph/src/jpgraph_pie3d.php'; -$inCli = true; include '../include/init.inc.php'; include '../include/lib_revcheck.inc.php'; include '../include/lib_proj_lang.inc.php'; diff --git a/scripts/gen_picture_info_all_lang.php b/scripts/gen_picture_info_all_lang.php index 4df4bc7..7f1c742 100644 --- a/scripts/gen_picture_info_all_lang.php +++ b/scripts/gen_picture_info_all_lang.php @@ -2,7 +2,6 @@ include '../include/jpgraph/src/jpgraph.php'; include '../include/jpgraph/src/jpgraph_bar.php'; -$inCli = true; include '../include/init.inc.php'; include '../include/lib_revcheck.inc.php'; diff --git a/scripts/gen_translation_info.sh b/scripts/gen_translation_info.sh deleted file mode 100755 index afe4028..0000000 --- a/scripts/gen_translation_info.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -. `dirname $0`/../build-ops - -cd ${SVNDIR} - -TRANSPATH=${DOCWEB}/www/trantools; -LANGS=`$PHP -r 'include "phpweb/include/languages.inc"; echo implode( " ", array_keys( $LANGUAGES ) );'`; - -cd phpdoc-all - -for LANG in $LANGS; do - $PHP doc-base/scripts/check-trans.php ${LANG} > $TRANSPATH/transcheck_${LANG}.html - $PHP -derror_reporting=0 doc-base/scripts/revcheck.php ${LANG} > $TRANSPATH/revcheck_${LANG}.html - $PHP -derror_reporting=0 doc-base/scripts/revcheck.php ${LANG} --show-uptodate > $TRANSPATH/revcheck_extended_${LANG}.html - $PHP doc-base/scripts/check-trans-maint.php -n -l ${LANG} -m 1 > $TRANSPATH/maintainer_${LANG}.html - $PHP -derror_reporting=0 doc-base/scripts/check-trans-params.php ${LANG} 1 1 > $TRANSPATH/params_${LANG}.html - $PHP doc-base/scripts/reviewedcheck.php ${LANG} > $TRANSPATH/reviewedcheck_${LANG}.html - -done - diff --git a/scripts/rev.php b/scripts/rev.php index 2b7c3f9..6f5ec87 100644 --- a/scripts/rev.php +++ b/scripts/rev.php @@ -21,14 +21,12 @@ | Mehdi Achour <didou at php dot net> | | Maciej Sobaczewski <sobak at php dot net> | +----------------------------------------------------------------------+ - */ error_reporting(E_ALL); set_time_limit(0); -// define some common variables -$inCli = true; +// include required files include '../include/init.inc.php'; include '../include/lib_proj_lang.inc.php'; @@ -268,9 +266,7 @@ function do_revcheck($dir = '') { // Files first if (sizeof($entriesFiles) > 0 ) { - foreach($entriesFiles as $file) { - $path = $DOCS . 'en' . $dir . '/' . $file; $size = intval(filesize($path) / 1024); @@ -281,10 +277,8 @@ function do_revcheck($dir = '') { $SQL_BUFF .= "INSERT INTO files VALUES ('en', '$id', '$file', $revision, '$size','$date', NULL, NULL);\n"; foreach ($LANGS as $lang) { - $path = $DOCS . $lang . $dir . '/' . $file; if (is_file($path)) { - $size = intval(filesize($path) / 1024); $date = filemtime($path); list($revision, $maintainer, $status) = get_tags($path); @@ -299,19 +293,16 @@ function do_revcheck($dir = '') { // Directories.. if (sizeof($entriesDir) > 0) { - usort($entriesDir, 'dir_sort'); reset($entriesDir); foreach ($entriesDir as $Edir) { - $path = $DOCS . 'en/' . $dir . '/' . $Edir; $id++; echo "Adding directory: $dir/$Edir (id: $id)\n"; $SQL_BUFF .= "INSERT INTO dirs VALUES (" . $id . ", '$dir/$Edir');\n"; do_revcheck($dir . '/' . $Edir); - } } } @@ -371,7 +362,6 @@ function check_old_files($dir = '', $lang) { // Directories.. if (sizeof($entriesDir) > 0) { - usort($entriesDir, 'dir_sort_old'); reset($entriesDir); @@ -433,25 +423,17 @@ function get_original_rev($file) } } - -function getmicrotime() -{ - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); -} - /** * Script execution **/ -$time_start = getmicrotime(); +$time_start = microtime(true); $db_name = SQLITE_DIR . 'rev.php.sqlite'; $tmp_db = SQLITE_DIR . 'rev.php.tmp.sqlite'; // 1 - Drop the old database and create the new one if (is_file($tmp_db)) { - echo "Temporary database found: remove.\n"; if (!@unlink($tmp_db)) { @@ -481,13 +463,11 @@ foreach ($LANGS as $id => $lang) { do_revcheck(); // 4:1 - Recurse in the manuel seeking for old files for each language and fill $SQL_BUFF - foreach ($LANGS as $lang) { check_old_files('', $lang); } // 5 - Query $SQL_BUFF and exit - sqlite_query($idx, 'BEGIN TRANSACTION'); sqlite_query($idx, $SQL_BUFF); sqlite_query($idx, 'COMMIT'); @@ -498,8 +478,7 @@ echo "Copying temporary database to final database\n"; copy($tmp_db, $db_name); @unlink($tmp_db); -$time_end = getmicrotime(); -$time = $time_end - $time_start; +$time = microtime(true) - $time_start; echo "Time of generation: $time s\n"; echo "End\n"; \ No newline at end of file diff --git a/scripts/set_ownership.sh b/scripts/set_ownership.sh deleted file mode 100755 index 4f9aa5c..0000000 --- a/scripts/set_ownership.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# get paths -. `dirname $0`/../build-ops - -if [ `whoami` = 'root' ] -then - if [ ! -d $FILESDIR ] - then - echo "Making files dir: $FILESDIR" - mkdir $FILESDIR - fi - echo "Setting ownership of files dir ($FILESDIR) to $WWWUSER.$WWWGROUP" - chown -R $WWWUSER $FILESDIR - chgrp -R $WWWGROUP $FILESDIR - - if [ ! -d $SQLITEDIR ] - then - echo "Making SQLite dir: $SQLITEDIR" - mkdir $SQLITEDIR - fi - echo "Setting ownership of SQLite dir ($SQLITEDIR) to $WWWUSER.$WWWGROUP" - chown -R $WWWUSER $SQLITEDIR - chgrp -R $WWWGROUP $SQLITEDIR - - if [ ! -d $DOCWEB/www/images/users ] - then - echo "Making files dir: $DOCWEB/www/images/users" - mkdir $FILESDIR - fi - echo "Setting ownership of files dir ($DOCWEB/www/images/users) to $WWWUSER.$WWWGROUP" - chown -R $WWWUSER $DOCWEB/www/images/users - chgrp -R $WWWGROUP $DOCWEB/www/images/users - - echo "Done." -else - echo "Must be root." -fi diff --git a/www/trantools/index.php b/www/trantools/index.php deleted file mode 100644 index 9441d50..0000000 --- a/www/trantools/index.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: -+----------------------------------------------------------------------+ -| PHP Documentation Site Source Code | -+----------------------------------------------------------------------+ -| Copyright (c) 1997-2011 The PHP Group | -+----------------------------------------------------------------------+ -| This source file is subject to version 3.0 of the PHP license, | -| that is bundled with this package in the file LICENSE, and is | -| available at through the world-wide-web at | -| http://www.php.net/license/3_0.txt. | -| If you did not receive a copy of the PHP license and are unable to | -| obtain it through the world-wide-web, please send a note to | -| license@php.net so we can mail you a copy immediately. | -+----------------------------------------------------------------------+ -| Authors: Philip Olson <philip@php.net> | -+----------------------------------------------------------------------+ -$Id$ - -Usage: This exists to show the outputted files from the various - translation scripts found in phpdoc. - - See Also: docweb/scripts/gen_translation_info.sh - phpdoc/scripts/check-trans-* and revcheck.php - -TODO: Integrate with docweb, and make prettier (valid) output -*/ - -$files = glob("*.html"); - -if (count($files) < 1) { - echo "Where did all the generated translation files go?"; - exit; -} - -foreach ($files as $filename) { - - preg_match("@(.+)_(.+)\.html@", $filename, $matches); - - if (empty($matches[1]) || empty($matches[2])) { - continue; - } - - $name = $matches[1]; - $cc = $matches[2]; - - $keepers[$cc][] = $filename; -} - -foreach ($keepers as $cc => $kept) { - - if (!is_array($kept) || empty($kept)) { - continue; - } - - echo "<h3 id='$cc'>$cc</h3>\n"; - echo "<ul>\n"; - - foreach ($kept as $filename) { - echo "<li><a href='$filename'>$filename</a></li>\n"; - } - - echo "</ul>\n"; -}
« previous php.doc.web (#2346) next »