[csw-devel] SF.net SVN: opencsw:[353] web/wordpresscsw/tools/statistics

wbonnet at users.sourceforge.net wbonnet at users.sourceforge.net
Wed Mar 2 14:16:35 CET 2011


Revision: 353
          http://opencsw.svn.sourceforge.net/opencsw/?rev=353&view=rev
Author:   wbonnet
Date:     2011-03-02 13:16:35 +0000 (Wed, 02 Mar 2011)

Log Message:
-----------
Move Lutefisk wrappers to the right place

Added Paths:
-----------
    web/wordpresscsw/tools/statistics/mirrorSurvey.php
    web/wordpresscsw/tools/statistics/packageSurvey.php

Copied: web/wordpresscsw/tools/statistics/mirrorSurvey.php (from rev 321, utilities/packagesStatistics/tools/mirrorSurvey.php)
===================================================================
--- web/wordpresscsw/tools/statistics/mirrorSurvey.php	                        (rev 0)
+++ web/wordpresscsw/tools/statistics/mirrorSurvey.php	2011-03-02 13:16:35 UTC (rev 353)
@@ -0,0 +1,81 @@
+<?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();
+    }
+?>

Copied: web/wordpresscsw/tools/statistics/packageSurvey.php (from rev 321, utilities/packagesStatistics/tools/packageSurvey.php)
===================================================================
--- web/wordpresscsw/tools/statistics/packageSurvey.php	                        (rev 0)
+++ web/wordpresscsw/tools/statistics/packageSurvey.php	2011-03-02 13:16:35 UTC (rev 353)
@@ -0,0 +1,97 @@
+<?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