com web/doc: Fixed charts generation: include/lib_revcheck. inc.php scripts/gen_picture_info.php scripts/gen_ picture_info_all_lang.php
| From: | sobak@php.net | Date: | Sun, 30 Mar 2014 07:51:16 +0000 |
| Subject: | com web/doc: Fixed charts generation: include/lib_revcheck. inc.php scripts/gen_picture_info.php scripts/gen_ picture_info_all_lang.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-2353@lists.php.net to get a copy of this message | ||
Commit: 487e76617c8a58b47a7a592c0fd6254947cba9d3
Author: Sobak <msobaczewski@gmail.com> Sun, 30 Mar 2014 09:51:16 +0200
Parents: 8a4b96c3f1c19959c4bb1c9a816abcd468c0c654
Branches: master
Link: http://git.php.net/?p=web/doc.git;a=commitdiff;h=487e76617c8a58b47a7a592c0fd6254947cba9d3
Log:
Fixed charts generation
Changed paths:
M include/lib_revcheck.inc.php
M scripts/gen_picture_info.php
M scripts/gen_picture_info_all_lang.php
Diff:
diff --git a/include/lib_revcheck.inc.php b/include/lib_revcheck.inc.php
index a34c5ad...f346897 100644
--- a/include/lib_revcheck.inc.php
+++ b/include/lib_revcheck.inc.php
@@ -181,7 +181,7 @@ function get_nb_EN_files($idx)
{
$sql = "SELECT COUNT(*) AS total FROM files WHERE lang = 'en'";
$res = $idx->query($sql);;
- $row = $result->fetchArray();
+ $row = $res->fetchArray();
return $row['total'];
}
diff --git a/scripts/gen_picture_info.php b/scripts/gen_picture_info.php
index 5bb47e3..c2dfe03 100644
--- a/scripts/gen_picture_info.php
+++ b/scripts/gen_picture_info.php
@@ -7,19 +7,20 @@ include '../include/init.inc.php';
include '../include/lib_revcheck.inc.php';
include '../include/lib_proj_lang.inc.php';
+$idx = new SQLite3(SQLITE_DIR . 'rev..php.sqlite');
+
$langs = array_keys($LANGUAGES);
foreach ($langs as $lang) {
- if (!generate_image($lang)) {
+ if (!generate_image($lang, $idx)) {
echo "Documentation for $lang language does not exist.\n";
} else {
echo "Generated images/revcheck/info_revcheck_php_" . $lang . ".png\n";
}
}
-function generate_image($lang) {
+function generate_image($lang, $idx) {
global $LANGUAGES;
- $idx = sqlite_open(SQLITE_DIR . 'rev.php.sqlite');
$Total_files = @get_nb_LANG_files($idx);
if (!isset($Total_files[$lang]) ) {
return FALSE;
diff --git a/scripts/gen_picture_info_all_lang.php b/scripts/gen_picture_info_all_lang.php
index 7f1c742...b39bad8 100644
--- a/scripts/gen_picture_info_all_lang.php
+++ b/scripts/gen_picture_info_all_lang.php
@@ -5,9 +5,9 @@ include '../include/jpgraph/src/jpgraph_bar.php';
include '../include/init.inc.php';
include '../include/lib_revcheck.inc.php';
-$idx = sqlite_open(SQLITE_DIR . 'rev.php.sqlite');
+$idx = new SQLite3(SQLITE_DIR . 'rev.php.sqlite');
-$language = revcheck_available_languages($idx, 'php');
+$language = revcheck_available_languages($idx);
sort($language);
$files_EN = get_nb_EN_files($idx);