Skip to content

Commit

Permalink
Make insights stream pluggable
Browse files Browse the repository at this point in the history
* Add new pluggable Insights Generator plugin
* Abstract all the insights logic into individual "plugin" PHP files
* Set up hooks for the Insight Generator plugin to dynamically call the individual insight plugin files
  • Loading branch information
ginatrapani committed Jul 22, 2012
1 parent 992b6e6 commit 446d058
Show file tree
Hide file tree
Showing 31 changed files with 1,409 additions and 392 deletions.
4 changes: 2 additions & 2 deletions extras/dev/makemodel/classes/class.ModelMaker.php
Expand Up @@ -3,7 +3,7 @@
*
* ThinkUp/extras/dev/makemodel/classes/class.ModelMaker.php
*
* Copyright (c) 2009-2010 Gina Trapani
* Copyright (c) 2011-2012 Gina Trapani
*
* LICENSE:
*
Expand All @@ -22,7 +22,7 @@
*
* @author Gina Trapani <ginatrapani[at]gmail[dot]com>
* @license http://www.gnu.org/licenses/gpl.html
* @copyright 2009-2010 Gina Trapani
* @copyright 2011-2012 Gina Trapani
*
* ModelMaker
*
Expand Down
4 changes: 2 additions & 2 deletions extras/dev/makemodel/makemodel.php
Expand Up @@ -3,7 +3,7 @@
*
* ThinkUp/extras/dev/makemodel/makemodel.php
*
* Copyright (c) 2009-2010 Gina Trapani
* Copyright (c) 2011-2012 Gina Trapani
*
* LICENSE:
*
Expand All @@ -22,7 +22,7 @@
*
* @author Gina Trapani <ginatrapani[at]gmail[dot]com>
* @license http://www.gnu.org/licenses/gpl.html
* @copyright 2009-2010 Gina Trapani
* @copyright 2011-2012 Gina Trapani
*
* Usage:
* makemode.php <table_name> <object_name> [<parent_object_name>]
Expand Down
25 changes: 25 additions & 0 deletions extras/dev/ramdisk/parse_config.php
@@ -1,4 +1,29 @@
<?php
/**
*
* ThinkUp/extras/dev/ramdisk/parse_config.php
*
* Copyright (c) 2009-2012 mwilkie
*
* LICENSE:
*
* This file is part of ThinkUp (http://thinkupapp.com).
*
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any
* later version.
*
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see
* <http://www.gnu.org/licenses/>.
*
* @author mwilkie <mark[at]bitterpill[dot]org>
* @license http://www.gnu.org/licenses/gpl.html
* @copyright 2009-2012 mwilkie
*/
require_once 'webapp/config.inc.php';

array_shift($argv);
Expand Down
25 changes: 25 additions & 0 deletions extras/scripts/getversion.php
@@ -1,4 +1,29 @@
<?php
/**
*
* ThinkUp/extras/scripts/getversion.php
*
* Copyright (c) 2009-2012 Gina Trapani
*
* LICENSE:
*
* This file is part of ThinkUp (http://thinkupapp.com).
*
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any
* later version.
*
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see
* <http://www.gnu.org/licenses/>.
*
* @author Gina Trapani <ginatrapani[at]gmail[dot]com>
* @license http://www.gnu.org/licenses/gpl.html
* @copyright 2009-2012 Gina Trapani
*/
chdir(dirname(dirname(dirname(__FILE__))));
require_once 'webapp/install/version.php';

Expand Down
18 changes: 9 additions & 9 deletions tests/TestOfAccountConfigurationController.php
Expand Up @@ -349,7 +349,7 @@ public function testAuthControlLoggedInNotAdmin() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand All @@ -372,7 +372,7 @@ public function testAuthControlLoggedInAdmin() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -463,7 +463,7 @@ public function testAuthControlLoggedInChangePasswordSuccess() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -498,7 +498,7 @@ public function testAuthControlLoggedInChangePasswordOldPwdDoesntMatch() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -527,7 +527,7 @@ public function testAuthControlLoggedInChangePasswordOldPwdEmpty() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -556,7 +556,7 @@ public function testAuthControlLoggedInChangePasswordNewPwdsDontMatch() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -586,7 +586,7 @@ public function testAuthControlLoggedInChangePasswordNewPwdTooShort() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -617,7 +617,7 @@ public function testAuthControlLoggedInChangePasswordNewPwdNotAlphanumeric() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down Expand Up @@ -698,7 +698,7 @@ public function testResetAPIKey() {
//test if view variables were set correctly
$v_mgr = $controller->getViewManager();
$this->assertIsA($v_mgr->getTemplateDataItem('installed_plugins'), 'array');
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 7);
$this->assertEqual(sizeof($v_mgr->getTemplateDataItem('installed_plugins')), 8);

$owner = $v_mgr->getTemplateDataItem('owner');
$this->assertIsA($owner, 'Owner');
Expand Down
13 changes: 8 additions & 5 deletions tests/TestOfPluginMySQLDAO.php
Expand Up @@ -61,7 +61,7 @@ public function testGetInstalledPlugins() {
$dao = new PluginMySQLDAO();

$plugins = $dao->getInstalledPlugins();
$this->assertEqual(count($plugins), 7);
$this->assertEqual(count($plugins), 8);

usort($plugins, 'TestOfPluginMySQLDAO::pluginSort');
$this->assertEqual($plugins[0]->name,"Expand URLs");
Expand All @@ -79,11 +79,14 @@ public function testGetInstalledPlugins() {
$this->assertEqual($plugins[4]->name,"Hello ThinkUp");
$this->assertEqual($plugins[4]->folder_name,"hellothinkup");

$this->assertEqual($plugins[5]->name,"Twitter");
$this->assertEqual($plugins[5]->folder_name,"twitter");
$this->assertEqual($plugins[5]->name,"Insights Generator");
$this->assertEqual($plugins[5]->folder_name,"insightsgenerator");

$this->assertEqual($plugins[6]->name,"Twitter Realtime");
$this->assertEqual($plugins[6]->folder_name,"twitterrealtime");
$this->assertEqual($plugins[6]->name,"Twitter");
$this->assertEqual($plugins[6]->folder_name,"twitter");

$this->assertEqual($plugins[7]->name,"Twitter Realtime");
$this->assertEqual($plugins[7]->folder_name,"twitterrealtime");
}

public function testInsertPugin() {
Expand Down

0 comments on commit 446d058

Please sign in to comment.