[csw-devel] SF.net SVN: opencsw:[352] utilities/packagesStatistics/tools
wbonnet at users.sourceforge.net
wbonnet at users.sourceforge.net
Wed Mar 2 14:16:03 CET 2011
Revision: 352
http://opencsw.svn.sourceforge.net/opencsw/?rev=352&view=rev
Author: wbonnet
Date: 2011-03-02 13:16:03 +0000 (Wed, 02 Mar 2011)
Log Message:
-----------
Move Lutefisk wrappers to the right place
Added Paths:
-----------
utilities/packagesStatistics/tools/db-config.php.sample
Removed Paths:
-------------
utilities/packagesStatistics/tools/db-config.php
utilities/packagesStatistics/tools/mirrorSurvey.php
utilities/packagesStatistics/tools/monthlyPackageCount.php
utilities/packagesStatistics/tools/monthlyPackageCreationUpdate.php
utilities/packagesStatistics/tools/packageSurvey.php
Deleted: utilities/packagesStatistics/tools/db-config.php
===================================================================
--- utilities/packagesStatistics/tools/db-config.php 2011-02-27 22:52:13 UTC (rev 351)
+++ utilities/packagesStatistics/tools/db-config.php 2011-03-02 13:16:03 UTC (rev 352)
@@ -1,42 +0,0 @@
-<?php
- /*
- * The contents of this file are subject to the COMMON DEVELOPMENT AND
- * DISTRIBUTION LICENSE (CDDL) (the "License"); you may not use this
- * file except in compliance with the License.
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPL"),
- * in which case the provisions of the GPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL, and not to allow others to
- * use your version of this file under the terms of the CDDL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CDDL, or the GPL.
- *
- * Copyright 2009 OpenCSW (http://www.opencsw.org). All rights reserved.
- * Use is subject to license terms.
- *
- *
- * Contributors list :
- *
- * William Bonnet wbonnet at opencsw.org
- *
- *
- * Version :
- *
- * $Id: $
- *
- */
-
- define('DB_SCHEMA', 'schema'); // Defines the database name
- define('DB_USER', 'user'); // Defines the user name
- define('DB_PASSWORD', 'password'); // Defines the password
- define('DB_HOST', 'localhost'); // Defines the hostnameof the database
-?>
Copied: utilities/packagesStatistics/tools/db-config.php.sample (from rev 321, utilities/packagesStatistics/tools/db-config.php)
===================================================================
--- utilities/packagesStatistics/tools/db-config.php.sample (rev 0)
+++ utilities/packagesStatistics/tools/db-config.php.sample 2011-03-02 13:16:03 UTC (rev 352)
@@ -0,0 +1,42 @@
+<?php
+ /*
+ * The contents of this file are subject to the COMMON DEVELOPMENT AND
+ * DISTRIBUTION LICENSE (CDDL) (the "License"); you may not use this
+ * file except in compliance with the License.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPL"),
+ * in which case the provisions of the GPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL, and not to allow others to
+ * use your version of this file under the terms of the CDDL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CDDL, or the GPL.
+ *
+ * Copyright 2009 OpenCSW (http://www.opencsw.org). All rights reserved.
+ * Use is subject to license terms.
+ *
+ *
+ * Contributors list :
+ *
+ * William Bonnet wbonnet at opencsw.org
+ *
+ *
+ * Version :
+ *
+ * $Id: $
+ *
+ */
+
+ define('DB_SCHEMA', 'schema'); // Defines the database name
+ define('DB_USER', 'user'); // Defines the user name
+ define('DB_PASSWORD', 'password'); // Defines the password
+ define('DB_HOST', 'localhost'); // Defines the hostnameof the database
+?>
Deleted: utilities/packagesStatistics/tools/mirrorSurvey.php
===================================================================
--- utilities/packagesStatistics/tools/mirrorSurvey.php 2011-02-27 22:52:13 UTC (rev 351)
+++ utilities/packagesStatistics/tools/mirrorSurvey.php 2011-03-02 13:16:03 UTC (rev 352)
@@ -1,81 +0,0 @@
-<?php
-/*
- * The contents of this file are subject to the COMMON DEVELOPMENT AND
- * DISTRIBUTION LICENSE (CDDL) (the "License"); you may not use this
- * file except in compliance with the License.
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPL"),
- * in which case the provisions of the GPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL, and not to allow others to
- * use your version of this file under the terms of the CDDL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CDDL, or the GPL.
-
- * Copyright 2009 OpenCSW (http://www.opencsw.org). All rights reserved.
- * Use is subject to license terms.
- *
- *
- * Contributors list :
- *
- * William Bonnet wbonnet at opencsw.org
- *
- *
- * Version :
- *
- * $Id: $
- *
- */
-
- // Test if the mirrorSurvey value is set
- if(isset($_GET["mirrorName"]))
- {
- // Yes, thus retrieve the mirror name
- $mirrorName = substr($_GET["mirrorName"], 0, 255); // Retrieve only the 255 chars of the mirror name
- // No need to get more since there is a size limit
- // Include the database parameters
- require("db-common.php");
-
- // Create the DAO object
- $statDAO = new mysqlDAO();
-
- // Connect to database
- $statDAO->connect();
-
- $mirrorArch = "";
- $mirrorOsVersion = "";
- $mirrorSource = "";
-
- if(isset($_GET["mirrorArch"]))
- {
- // If defined, thus retrieve the mirror arch
- $mirrorArch = substr($_GET["mirrorArch"], 0, 8); // Retrieve only the 8 chars of the version string
- }
-
- if(isset($_GET["mirrorOsVersion"]))
- {
- // If defined, thus retrieve the mirror os version
- $mirrorOsVersion = substr($_GET["mirrorOsVersion"], 0, 8); // Retrieve only the 8 chars of the version string
- }
-
- if(isset($_GET["mirrorSource"]))
- {
- // If defined, thus retrieve the mirror packages source
- $mirrorSource = substr($_GET["mirrorSource"], 0, 16); // Retrieve only the 16 chars of the version string
- }
-
- // Execute query
- $statDAO->increaseMirrorDownloadCounter($mirrorName, $mirrorArch, $mirrorOsVersion, $mirrorSource);
-
- // Disconnect from database
- $statDAO->disconnect();
- }
-?>
Deleted: utilities/packagesStatistics/tools/monthlyPackageCount.php
===================================================================
--- utilities/packagesStatistics/tools/monthlyPackageCount.php 2011-02-27 22:52:13 UTC (rev 351)
+++ utilities/packagesStatistics/tools/monthlyPackageCount.php 2011-03-02 13:16:03 UTC (rev 352)
@@ -1,88 +0,0 @@
-<?php
-
- // Includes the graphics library
- require_once "Artichow/LinePlot.class.php";
-
- // Include the database parameters
- require("db-common.php");
-
- // Defines the function to call for label output
- function setMonth($value) {
- global $stats;
-
- date_default_timezone_set('Europe/Paris');
- $str = date('M', mktime(0,0,0, $stats[11 - $value][1], 1)) . " '";
- $str .= date('y', mktime(0,0,0,0,1, $stats[11 - $value][2] + 1));
-
- return $str;
- }
-
- function setNumber($value) {
- return round($value);
- }
-
- function labelFormat($value) {
- return $value;
- }
-
- // Initialization of the graphics
- $graph = new Graph(800, 480);
- $graph->setAntiAliasing(FALSE);
-
- $group = new PlotGroup;
- $group->grid->setType(Line::DASHED);
-
- $group->setPadding(40, NULL, 20, NULL);
-
- $group->axis->left->setLabelNumber(8);
- $group->axis->left->setLabelPrecision(1);
- $group->axis->left->setTickStyle(Tick::OUT);
-
- // Statistics array population
- $statPackage = array(); // Initialize the number of packages array
-
- // Create the DAO object
- $statDAO = new mysqlDAO();
-
- // Connect to database
- $statDAO->connect();
-
- // Retrieve the statistics from the database
- $stats = $statDAO->getMonthlyPackageCountOverLastYear();
-
- // Disconnect from database
- $statDAO->disconnect();
-
- for ($idxCounter = 11 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data
- $statPackage[$idxCounter] = $stats[11 - $idxCounter][0]; // into the creation array
- }
-
- $plot = new LinePlot($statPackage);
-
- $plot->label->setFont(new Tuffy(7));
- $plot->label->setPadding(1, 1, 1, 1);
- $plot->label->setCallbackFunction("labelFormat");
- $plot->label->setBackgroundColor(
- new Color(227, 223, 241, 15)
- );
- $plot->setColor(new Green());
- $plot->setFillColor(new LightGreen(80));
-
- $plot->mark->setType(Mark::CIRCLE);
- $plot->mark->setFill(new MidGreen);
- $plot->mark->setSize(6);
-
- $group->legend->add($plot, "Number of available packages", Legend::MARK);
- $group->legend->setPosition(0.35, 0.15);
- $group->add($plot);
-
- $x = array(NULL, NULL, NULL, 10, 12, 14, 18, 26, 42);
-
- $group->axis->bottom->label->setCallbackFunction('setMonth');
- $group->axis->left->label->setCallbackFunction('setNumber');
-
- $graph->add($group);
-
- $graph->draw();
-
-?>
Deleted: utilities/packagesStatistics/tools/monthlyPackageCreationUpdate.php
===================================================================
--- utilities/packagesStatistics/tools/monthlyPackageCreationUpdate.php 2011-02-27 22:52:13 UTC (rev 351)
+++ utilities/packagesStatistics/tools/monthlyPackageCreationUpdate.php 2011-03-02 13:16:03 UTC (rev 352)
@@ -1,139 +0,0 @@
-<?php
-
- // Includes the graphics library
- require_once "Artichow/BarPlot.class.php";
-
- // Include the database parameters
- require("db-common.php");
-
- // Defines the function to call for label output
- function labelFormat($value) {
- return $value;
- }
-
- function setMonth($value) {
- global $stats;
-
- date_default_timezone_set('Europe/Paris');
- $str = date('M', mktime(0,0,0, $stats[11 - $value][2], 1)) . " '";
- $str .= date('y', mktime(0,0,0,0,1, $stats[11 - $value][3] + 1));
-
- return $str;
- }
-
- // Initialization of the graphics
- $graph = new Graph(800, 480);
- $graph->setAntiAliasing(FALSE);
-
- $group = new PlotGroup;
- $group->setSpace(5, 5, 5, 0);
- $group->setPadding(40, 20);
-
- $group->axis->left->setLabelPrecision(0);
-
- $colors = array(
- new Color(80, 105, 190, 10),
- new Color(105, 190, 80, 10)
- );
-
- $darkColor = array(
- new Color(40, 55, 120, 10),
- new Color(55, 120, 40, 10)
- );
-
- $axis = array(
- Plot::LEFT,
- );
-
- $group->axis->left->setColor($darkColor[0]);
- $group->axis->left->label->setColor($darkColor[0]);
-
- $group->setBackgroundGradient(
- new LinearGradient(
- new Color(225, 225, 225),
- new Color(255, 255, 255),
- 0
- )
- );
-
- // Statistics array population
- $statCreation = array(); // Initialize the creation data array
- $statUpdate = array(); // Initialize the update data array
-
- // Create the DAO object
- $statDAO = new mysqlDAO();
-
- // Connect to database
- $statDAO->connect();
-
- // Retrieve the statistics from the database
- $stats = $statDAO->getMonthlyPackageCreationAndUpdateOverLastYear();
-
- // Disconnect from database
- $statDAO->disconnect();
-
- for ($idxCounter = 11 ; $idxCounter >= 0 ; $idxCounter--) { // Loop used to copy data
- $statCreation[$idxCounter] = $stats[11 - $idxCounter][0]; // into the creation array
- $statUpdate[$idxCounter] = $stats[11 - $idxCounter][1]; // into the update array
- }
-
- // Add the "creations" serie on the graphic
- $plot = new BarPlot($statCreation, 1, 2);
- $plot->barBorder->setColor(new Color(0, 0, 0, 30));
-
- $plot->setBarPadding(0.1, 0.1);
- $plot->setBarSpace(5);
-
- $plot->barShadow->setSize(2);
- $plot->barShadow->setPosition(Shadow::RIGHT_TOP);
- $plot->barShadow->setColor(new Color(180, 180, 180, 10));
- $plot->barShadow->smooth(TRUE);
-
- $plot->label->set($statCreation);
- $plot->label->move(0, -6);
- $plot->label->setFont(new Tuffy(7));
- $plot->label->setAngle(0);
- $plot->label->setAlign(NULL, Label::TOP);
- $plot->label->setPadding(3, 1, 0, 6);
- $plot->label->setCallbackFunction("labelFormat");
-
- $plot->setBarColor($colors[0]);
- $plot->setYAxis($axis[0]);
-
- $group->legend->add($plot, "Packages creations", Legend::BACKGROUND);
- $group->legend->setPosition(0.30, 0.15);
- $group->legend->shadow->smooth(TRUE);
-
- $group->add($plot);
-
- // Add the "updates" serie on the graphic
- $plot = new BarPlot($statUpdate, 2, 2);
- $plot->barBorder->setColor(new Color(0, 0, 0, 30));
-
- $plot->setBarPadding(0.1, 0.1);
- $plot->setBarSpace(5);
-
- $plot->barShadow->setSize(2);
- $plot->barShadow->setPosition(Shadow::RIGHT_TOP);
- $plot->barShadow->setColor(new Color(180, 180, 180, 10));
- $plot->barShadow->smooth(TRUE);
-
- $plot->label->set($statUpdate);
- $plot->label->move(0, -6);
- $plot->label->setFont(new Tuffy(7));
- $plot->label->setAngle(0);
- $plot->label->setAlign(NULL, Label::TOP);
- $plot->label->setPadding(3, 1, 0, 6);
- $plot->label->setCallbackFunction("labelFormat");
-
- $plot->setBarColor($colors[1]);
- $plot->setYAxis($axis[0]);
-
- $group->legend->add($plot, "Packages updates", Legend::BACKGROUND);
- $group->add($plot);
-
- $group->axis->bottom->label->setCallbackFunction('setMonth');
-
- $graph->add($group);
- $graph->draw();
-?>
Deleted: utilities/packagesStatistics/tools/packageSurvey.php
===================================================================
--- utilities/packagesStatistics/tools/packageSurvey.php 2011-02-27 22:52:13 UTC (rev 351)
+++ utilities/packagesStatistics/tools/packageSurvey.php 2011-03-02 13:16:03 UTC (rev 352)
@@ -1,97 +0,0 @@
-<?php
-/*
- * The contents of this file are subject to the COMMON DEVELOPMENT AND
- * DISTRIBUTION LICENSE (CDDL) (the "License"); you may not use this
- * file except in compliance with the License.
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPL"),
- * in which case the provisions of the GPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL, and not to allow others to
- * use your version of this file under the terms of the CDDL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CDDL, or the GPL.
-
- * Copyright 2009 OpenCSW (http://www.opencsw.org). All rights reserved.
- * Use is subject to license terms.
- *
- *
- * Contributors list :
- *
- * William Bonnet wbonnet at opencsw.org
- *
- *
- * Version :
- *
- * $Id: $
- *
- */
-
- // Test if the packageSurvey value is set
- if(isset($_GET["packageName"]))
- {
- // Yes, thus retrieve the package name
- $packageName = substr($_GET["packageName"], 0, 32); // Retrieve only the 32 chars of the package name
- // No need to get more since there is a size limit
-
- // Include the database parameters
- require("db-common.php");
-
- // Create the DAO object
- $statDAO = new mysqlDAO();
-
- // Connect to database
- $statDAO->connect();
-
- $packageArch = "";
- $packageSource = "";
- $packageOsVersion = "";
- $targetOsVersion = "";
-
- if(isset($_GET["packageArch"]))
- {
- // If defined, thus retrieve the package arch
- $packageArch = substr($_GET["packageArch"], 0, 8); // Retrieve only the 8 chars of the version string
- }
-
- if(isset($_GET["packageOsVersion"]))
- {
- // If defined, thus retrieve the package os version
- $packageOsVersion = substr($_GET["packageOsVersion"], 0, 8); // Retrieve only the 8 chars of the version string
- }
-
- if(isset($_GET["targetOsVersion"]))
- {
- // If defined, thus retrieve the target os version
- $targetOsVersion = substr($_GET["targetOsVersion"], 0, 8); // Retrieve only the 8 chars of the version string
- }
-
- if(isset($_GET["packageSource"]))
- {
- // If defined, thus retrieve the target os version
- $packageSource = substr($_GET["packageSource"], 0, 8); // Retrieve only the 8 chars of the version string
- }
-
- if(isset($_GET["selectByUser"]))
- {
- // Execute query
- $statDAO->increasePackageSelectCounter($packageName, $packageOsVersion, $packageArch, $targetOsVersion, $packageSource);
- }
- else
- {
- // Execute query
- $statDAO->increasePackageFetchCounter($packageName, $packageOsVersion, $packageArch, $targetOsVersion, $packageSource);
- }
-
- // Disconnect from database
- $statDAO->disconnect();
- }
-?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list