forked from Open-Web-Analytics/Open-Web-Analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding OFC, sparklines, revamped metrics, revamped db, etc.
- Loading branch information
padams
committed
Aug 16, 2008
1 parent
94f9ddf
commit 4f50949
Showing
147 changed files
with
15,992 additions
and
966 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Sparkline PHP Graphing Library | ||
# Copyright 2004 James Byers <[email protected]> | ||
# http://sparkline.org | ||
# | ||
# Sparkline is distributed under a BSD License. See LICENSE for details. | ||
# | ||
# $Id: CHANGES,v 1.2 2005/06/02 20:57:51 jbyers Exp $ | ||
# | ||
|
||
2005-06-02 James Byers <[email protected]> | ||
|
||
* Version 0.2 released | ||
* Corrected line chart behavior for small data sets [1096890] | ||
* Library will create log file if possible [1163412] | ||
* Fixed error message on bad log file [1096895] | ||
* Corrected bitmask on DEBUG_ALL | ||
* Revised structure of SetFeature | ||
|
||
2004-11-08 James Byers <[email protected]> | ||
|
||
* Version 0.1 released |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Sparkline PHP Graphing Library | ||
# Copyright 2004 James Byers <[email protected]> | ||
# http://sparkline.org | ||
# | ||
# Sparkline is distributed under a BSD License. See LICENSE for details. | ||
# | ||
# $Id: DESIGN,v 1.3 2004/11/09 07:10:42 jbyers Exp $ | ||
# | ||
|
||
Not much to see. It's 0.1, after all. | ||
|
||
Flow | ||
------------------------------------------------------------------------------ | ||
|
||
Instantiate appropriate Sparkline subclass | ||
Load data, set parameters, all Set* calls | ||
Render | ||
convert coordinates | ||
calculate image size | ||
create image handle | ||
set colors | ||
fill background | ||
draw graph | ||
draw features | ||
Optionally call Draw* functions | ||
Output / OutputFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Copyright (c) 2004 James Byers <[email protected]> | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
* Neither the name of James Byers nor the names of its contributors | ||
may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Sparkline PHP Graphing Library | ||
# Copyright 2004 James Byers <[email protected]> | ||
# http://sparkline.org | ||
# | ||
# Sparkline is distributed under a BSD License. See LICENSE for details. | ||
# | ||
# $Id: README,v 1.2 2004/11/09 07:10:42 jbyers Exp $ | ||
# | ||
|
||
Installation: | ||
------------- | ||
|
||
Sparkline does not have any installation requirements. See the | ||
samples directory for usage ideas. | ||
|
||
Requirements: | ||
------------- | ||
|
||
Sparkline requires PHP 4.0.6 or newer and GD 2.0 built as a PHP | ||
module. | ||
|
||
Troubleshooting and Support: | ||
---------------------------- | ||
|
||
See http://sparkline.org for troubleshooting advice and support. | ||
|
||
Bugs, Features: | ||
--------------- | ||
|
||
Please submit bugs to the bug tracker: | ||
|
||
http://sourceforge.net/tracker/?group_id=122936&atid=694962 | ||
|
||
Please submit feature requests to the RFE tracker: | ||
|
||
http://sourceforge.net/tracker/?group_id=122936&atid=694965 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<?php | ||
/* | ||
* Sparkline PHP Graphing Library | ||
* Copyright 2004 James Byers <[email protected]> | ||
* http://sparkline.org | ||
* | ||
* Sparkline is distributed under a BSD License. See LICENSE for details. | ||
* | ||
* $Id: Object.php,v 1.8 2005/06/02 21:01:42 jbyers Exp $ | ||
* | ||
*/ | ||
|
||
define('DEBUG_NONE', 0); // nothing | ||
define('DEBUG_ERROR', 1); // major errors | ||
define('DEBUG_WARNING', 2); // warnings | ||
define('DEBUG_STATS', 4); // dataset, rendering statistics | ||
define('DEBUG_CALLS', 8); // major function calls | ||
define('DEBUG_SET', 16); // all Set methods | ||
define('DEBUG_DRAW', 32); // all Draw methods | ||
define('DEBUG_ALL', 2047); // everything | ||
|
||
function error_handler($errno, $errstr, $errfile, $errline) { | ||
switch ($errno) { | ||
case E_ERROR: | ||
$message = "ERROR: "; | ||
break; | ||
case E_WARNING: | ||
$message = "WARNING: "; | ||
break; | ||
case E_PARSE: | ||
$message = "PARSE: "; | ||
break; | ||
case E_NOTICE: | ||
$message = "NOTICE: "; | ||
break; | ||
case E_USER_ERROR: | ||
$message = "UERROR: "; | ||
break; | ||
case E_USER_WARNING: | ||
$message = "UWARNING: "; | ||
break; | ||
case E_USER_NOTICE: | ||
$message = "UNOTICE: "; | ||
break; | ||
default: | ||
$message = "UNKNOWN: "; | ||
break; | ||
} // switch | ||
|
||
$message .= "$errstr in $errfile at line $errline\n"; | ||
|
||
if (($errno != E_NOTICE) && // suppress notices | ||
(error_reporting() != 0)) { // respect supressed errors (@) | ||
log_write($message, 'PHP'); | ||
} | ||
} // function error_handler | ||
|
||
function log_write($string, $type = '', $date = false) { | ||
global $LOGFILE; | ||
|
||
if (isset($LOGFILE)) { | ||
if ($date == false) { | ||
$date = time(); | ||
} | ||
|
||
$message = date('d/m/Y:H:i:s', $date) . " $type: $string \n"; | ||
error_log($message, 3, $LOGFILE); | ||
} | ||
} // function log_write | ||
|
||
class Object { | ||
|
||
var $isError; | ||
var $logFile; | ||
var $errorList; | ||
var $debugList; | ||
var $debugLevel; | ||
var $startTime; | ||
|
||
//////////////////////////////////////////////////////////////////////////// | ||
// constructor | ||
// | ||
function Object($catch_errors = true) { | ||
$this->isError = false; | ||
$this->logFile = null; | ||
$this->logDate = ''; | ||
$this->errorList = array(); | ||
$this->debugList = array(); | ||
$this->debugLevel = DEBUG_NONE; | ||
$this->startTime = $this->microTimer(); | ||
|
||
// if ($catch_errors) { | ||
set_error_handler('error_handler'); | ||
//} | ||
} // function Object | ||
|
||
//////////////////////////////////////////////////////////////////////////// | ||
// utility | ||
// | ||
function microTimer() { | ||
list($usec, $sec) = explode(" ", microtime()); | ||
return ((float)$usec + (float)$sec); | ||
} // function microTimer | ||
|
||
//////////////////////////////////////////////////////////////////////////// | ||
// error handling | ||
// | ||
function SetDebugLevel($level, $file = null) { | ||
global $LOGFILE; | ||
|
||
if ($level >= DEBUG_NONE && | ||
$level <= DEBUG_ALL) { | ||
$this->debugLevel = $level; | ||
} | ||
|
||
if ($file != null) { | ||
if ((!file_exists($file) && !touch($file)) || | ||
!is_writable($file)) { | ||
die("error log file '$file' is not writable to the web server user"); | ||
} else { | ||
$this->logFile = $file; | ||
$LOGFILE = $file; | ||
} | ||
} | ||
} // function SetDebugLevel | ||
|
||
function Debug($string, $level = DEBUG_WARNING) { | ||
$this->debugList[] = $string; | ||
if ($this->debugLevel & $level && | ||
$this->logFile != null) { | ||
log_write($string, 'DEBUG'); | ||
} | ||
} // function Debug | ||
|
||
function Error($string) { | ||
$this->isError = true; | ||
$this->errorList[] = $string; | ||
if ($this->debugLevel & DEBUG_ERROR && | ||
$this->logFile != null) { | ||
log_write($string, 'ERROR'); | ||
} | ||
} // function Error | ||
|
||
function GetDebug() { | ||
return $this->debugList; | ||
} // function GetDebug | ||
|
||
function GetError() { | ||
return $this->errorList; | ||
} // function GetError | ||
|
||
function IsError() { | ||
return $this->isError; | ||
} // function IsError | ||
|
||
} // class Object | ||
|
||
?> |
Oops, something went wrong.