public function testInsertOrgChannelField() { global $logger; $logger = new ShopbookLogger(); $logger->enabled = true; $logger->debug("Setting up PHP Unit Testing ..."); $orgDataField = new OrgDataField(4, 1, 2, "age", 4, 1, null, null, 2, $id = null); $arr = DAOFactory::getOrgDataFieldsDAO()->insertOrgChannelField($orgDataField); // Act //$b = $a->negate(); // Assert //$this->assertEquals(-1, $b->getAmount()); }
public function testInsertOrgChannelField() { global $logger; $logger = new ShopbookLogger(); $logger->enabled = true; $logger->debug("Setting up PHP Unit Testing ..."); $dataField = new DataField("age", 1, 0, "2014-12-1 12:12:12", "", "nothg", array(4, 1, 3)); //$dataFieldName, $dataFieldsTypeId, $defaultValue, $addedOn, $lastUpdate, $description, $fieldValidators, $id = null $arr = DAOFactory::getDataFieldsDAO()->insertDataField($dataField); // Act //$b = $a->negate(); // Assert //$this->assertEquals(-1, $b->getAmount()); }
public static function setup() { /* Setting up the app-configurations globally for use across classes */ global $configs; $configs = json_decode(file_get_contents('collap-configs.json'), true); /* Setting up the logger globally for use across classes */ global $logger; $logger = new ShopbookLogger(); $logger->enabled = true; $logger->debug("Setting up ..."); /* Setting up the cache object globally for use across classes */ global $cache; $cache = AppCacheRegistry::getCacheObject('redis'); /* Setting up the warnings payload as a global variable to be able to dump warnings along the API flow */ global $warnings_payload; /* Logging API stats */ $memoryUsage = memory_get_usage(true) / (1024 * 1024); $cpuLoad = Util::ServerLoad(); self::$pageTimer = new Timer('page_timer'); self::$pageTimer->start(); $logger->debug("Init Memory: {$memoryUsage} MB; Init CPU: {$cpuLoad}%"); }
require_once 'utils/ShopbookLogger.php'; require_once 'cache/AppCacheRegistry.class.php'; /* type 1. Landing Page 2. Search Page ***** .................................. admin.blueteam.com operate.blueteam.com */ /* Setting up the app-configurations globally for use across classes */ global $configs; $configs = json_decode(file_get_contents('blueteam-configs.json'), true); /* Setting up the logger globally for use across classes */ global $logger; $logger = new ShopbookLogger(); $logger->enabled = true; $logger->debug("Setting up ..."); $route = explode("/", $_SERVER[REQUEST_URI]); //router hack for uploads if (in_array('uploads', $route)) { $redir = $configs['BLUETEAM_BASE_URL']; $flag = false; foreach ($route as $key => $value) { if ($value == 'uploads') { $flag = true; } if ($flag) { $redir .= $value . "/"; } }
<?php include_once "controllers/HouseController.class.php"; include_once "controllers/HomeController.class.php"; require_once 'utils/Util.php'; require_once 'utils/Timer.php'; require_once 'utils/ShopbookLogger.php'; require_once 'cache/AppCacheRegistry.class.php'; /* Setting up the app-configurations globally for use across classes */ global $configs; $configs = json_decode(file_get_contents('house-swap-configs.json'), true); /* Setting up the logger globally for use across classes */ global $logger; $logger = new ShopbookLogger(); $logger->enabled = true; $logger->debug("Setting up ..."); $route = explode("/", $_SERVER[REQUEST_URI]); //var_dump($route); if (!isset($_SESSION['user_id']) && count($route) <= 1) { //langing page of collap $homeController = new HomeController(); $homeController->render(); } else { $page = explode("?", $route[1]); //single page app switch ($page[0]) { case "house": $houseController = new HouseController(); $houseController->render($route[2]); break; case "search":