Skip to content

Commit a7621a0

Browse files
committed
Added files via upload
1 parent 3ee287c commit a7621a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+13711
-2
lines changed

Callbacks.inc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
4+
/**
5+
* Gallery Template Callbacks class placeholder
6+
* Needed for fake out the require_once() in Gallery's template class callback method
7+
* See OWA Gallery module for the actual callback class
8+
*/
9+
10+
?>

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# OpenWebAnalyticsCustomized
2-
Web analytic tool customized for Hackathon.
1+
# Open-Web-Analytics
2+
Official Git Repository for the Open Web Analytics Project.
3+
4+
See the wiki on Github for documentation.

action.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
//
4+
// Open Web Analytics - An Open Source Web Analytics Framework
5+
//
6+
// Copyright 2006 Peter Adams. All rights reserved.
7+
//
8+
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
// $Id$
17+
//
18+
19+
include_once('owa_env.php');
20+
require_once(OWA_BASE_DIR.'/owa_php.php');
21+
22+
/**
23+
* Special HTTP Requests Controler
24+
*
25+
* @author Peter Adams <[email protected]>
26+
* @copyright Copyright &copy; 2006 Peter Adams <[email protected]>
27+
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
28+
* @category owa
29+
* @package owa
30+
* @version $Revision$
31+
* @since owa 1.0.0
32+
* @depricated
33+
*/
34+
35+
$owa = new owa_php;
36+
37+
$owa->e->debug('Special action request received by action.php...');
38+
39+
if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) {
40+
41+
// run controller or view and echo page content
42+
echo $owa->handleRequestFromURL();
43+
} else {
44+
// unload owa
45+
$owa->restInPeace();
46+
}
47+
48+
?>

api.php

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
//
4+
// Open Web Analytics - An Open Source Web Analytics Framework
5+
//
6+
// Copyright 2006 Peter Adams. All rights reserved.
7+
//
8+
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
// $Id$
17+
//
18+
19+
include_once('owa_env.php');
20+
require_once(OWA_BASE_DIR.'/owa_php.php');
21+
22+
/**
23+
* REST API
24+
*
25+
* @author Peter Adams <[email protected]>
26+
* @copyright Copyright &copy; 2010 Peter Adams <[email protected]>
27+
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
28+
* @category owa
29+
* @package owa
30+
* @version $Revision$
31+
* @since owa 1.3.0
32+
* @link http://wiki.openwebanalytics.com/index.php?title=REST_API
33+
*/
34+
35+
// define entry point cnstant
36+
define('OWA_API', true);
37+
// invoke OWA
38+
$owa = new owa_php;
39+
40+
if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) {
41+
42+
// run api command and echo page content
43+
//echo $owa->handleRequest('', 'base.apiRequest');
44+
if($_GET['owa_format'] == 'jsonp')
45+
{
46+
echo "callback(";
47+
sleep(2);
48+
$jsonp = $owa->handleRequest('', 'base.apiRequest');
49+
echo $jsonp.")";
50+
}
51+
else{
52+
echo $owa->handleRequest('', 'base.apiRequest');
53+
}
54+
55+
} else {
56+
// unload owa
57+
$owa->restInPeace();
58+
}
59+
60+
?>

backupCustomChanges.txt

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
$dbhost = '127.0.0.1';
3+
$dbuser = 'root';
4+
$dbpass = '';
5+
6+
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
7+
8+
if(! $conn ) {
9+
die('Could not connect: ' . mysql_error());
10+
}
11+
12+
$sql = 'SELECT action_name, action_label, action_group, numeric_value FROM owa_action_fact';
13+
mysql_select_db('owa');
14+
$retval = mysql_query( $sql, $conn );
15+
16+
if(! $retval ) {
17+
die('Could not get data: ' . mysql_error());
18+
}
19+
20+
$actionsXML = new SimpleXMLElement("<actions></actions>");
21+
$actionsXML->addAttribute('version', '0.0.0.1');
22+
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
23+
$actionsXML->addChild('action');
24+
$actionsXML->action->addChild('Name',$row['action_name']);
25+
$actionsXML->action->addChild('Label',$row['action_label']);
26+
$actionsXML->action->addChild('Group',$row['action_group']);
27+
$actionsXML->action->addChild('Value',$row['numeric_value']);
28+
}
29+
30+
$actionsIntro = $actionsXML->addChild('content');
31+
$actionsIntro->addAttribute('type', 'latest');
32+
Header('Content-type: text/xml');
33+
echo $actionsXML->asXML();
34+
35+
mysql_close($conn);
36+
?>

blank.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
// silence is golden.
3+
?>

cli.php

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
//
4+
// Open Web Analytics - An Open Source Web Analytics Framework
5+
//
6+
// Copyright 2006 Peter Adams. All rights reserved.
7+
//
8+
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
// $Id$
17+
//
18+
19+
require_once('owa_env.php');
20+
require_once(OWA_DIR.'owa_caller.php');
21+
require_once(OWA_BASE_CLASS_DIR.'cliController.php');
22+
23+
/**
24+
* OWA Comand Line Interface (CLI)
25+
*
26+
* @author Peter Adams <[email protected]>
27+
* @copyright Copyright &copy; 2010 Peter Adams <[email protected]>
28+
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
29+
* @category owa
30+
* @package owa
31+
* @version $Revision$
32+
* @since owa 1.2.1
33+
*/
34+
35+
define('OWA_CLI', true);
36+
37+
if (!empty($_POST)) {
38+
exit();
39+
} elseif (!empty($_GET)) {
40+
exit();
41+
} elseif (!empty($argv)) {
42+
$params = array();
43+
// get params from the command line args
44+
// $argv is a php super global variable
45+
46+
for ($i=1; $i<count($argv);$i++)
47+
{
48+
$it = explode("=",$argv[$i]);
49+
$params[$it[0]] = $it[1];
50+
}
51+
unset($params['action']);
52+
unset($params['do']);
53+
54+
} else {
55+
// No params found
56+
exit();
57+
}
58+
59+
// Initialize owa
60+
$owa = new owa_caller;
61+
62+
if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) {
63+
64+
// setting CLI mode to true
65+
$owa->setSetting('base', 'cli_mode', true);
66+
// setting user auth
67+
$owa->setCurrentUser('admin', 'cli-user');
68+
// run controller or view and echo page content
69+
$s = owa_coreAPI::serviceSingleton();
70+
$s->loadCliCommands();
71+
72+
if (array_key_exists('cmd', $params)) {
73+
74+
$cmd = $s->getCliCommandClass($params['cmd']);
75+
76+
if ($cmd) {
77+
$params['do'] = $cmd;
78+
echo $owa->handleRequest($params);
79+
} else {
80+
echo "Invalid command name.";
81+
}
82+
83+
} else {
84+
echo "Missing a command argument.";
85+
}
86+
87+
} else {
88+
// unload owa
89+
$owa->restInPeace();
90+
}
91+
92+
?>

customActionDataApi.php

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
$dbhost = '162.44.168.214';
3+
$dbuser = 'actionAdmin';
4+
$dbpass = 'ims';
5+
6+
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
7+
8+
if(! $conn ) {
9+
die('Could not connect: ' . mysql_error());
10+
}
11+
12+
$sql = 'SELECT action_name, action_label, action_group, numeric_value FROM owa_action_fact';
13+
mysql_select_db('owa');
14+
$retval = mysql_query( $sql, $conn );
15+
16+
if(! $retval ) {
17+
die('Could not get data: ' . mysql_error());
18+
}
19+
20+
$doc = new DOMDocument('1.0','UTF-8');
21+
$doc->preserveWhiteSpace = false;
22+
$doc->formatOutput = true;
23+
$root = $doc->createElement('actions');
24+
$root = $doc->appendChild($root);
25+
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
26+
// add node for each row
27+
$occ = $doc->createElement('action');
28+
$occ = $root->appendChild($occ);
29+
30+
$child = $doc->createElement('Name');
31+
$child = $occ->appendChild($child);
32+
$value = $doc->createTextNode($row['action_name']);
33+
$value = $child->appendChild($value);
34+
35+
$child = $doc->createElement('Label');
36+
$child = $occ->appendChild($child);
37+
$value = $doc->createTextNode($row['action_label']);
38+
$value = $child->appendChild($value);
39+
40+
$child = $doc->createElement('Group');
41+
$child = $occ->appendChild($child);
42+
$value = $doc->createTextNode($row['action_group']);
43+
$value = $child->appendChild($value);
44+
45+
$child = $doc->createElement('Value');
46+
$child = $occ->appendChild($child);
47+
$value = $doc->createTextNode($row['numeric_value']);
48+
$value = $child->appendChild($value);
49+
}
50+
$fullData = $doc->saveXML();
51+
//echo $fullData;
52+
53+
$xml = simplexml_load_string($fullData);
54+
$json = json_encode($xml);
55+
echo $json;
56+
mysql_close($conn);
57+
?>

daemon.php

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
//
3+
// Open Web Analytics - An Open Source Web Analytics Framework
4+
//
5+
// Copyright 2006-2011 Peter Adams. All rights reserved.
6+
//
7+
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// $Id$
16+
//
17+
18+
/**
19+
* OWA Daemon
20+
*
21+
* @author Peter Adams <[email protected]>
22+
* @copyright Copyright &copy; 2006-2011 Peter Adams <[email protected]>
23+
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
24+
* @category owa
25+
* @package owa
26+
* @version $Revision$
27+
* @since owa 1.4.0
28+
*/
29+
require_once('owa_env.php');
30+
require_once(OWA_DIR.'owa_php.php');
31+
require_once(OWA_BASE_CLASS_DIR.'daemon.php');
32+
33+
define('OWA_DAEMON', true);
34+
35+
if (!empty($_POST)) {
36+
exit();
37+
} elseif (!empty($_GET)) {
38+
exit();
39+
}
40+
41+
$owa = new owa_php();
42+
43+
if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) {
44+
// start daemon
45+
$daemon = new owa_daemon();
46+
$daemon->start();
47+
48+
} else {
49+
// unload owa
50+
$owa->restInPeace();
51+
}
52+
53+
?>

0 commit comments

Comments
 (0)