function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     switch ($config->api_provider()) {
         case 'coinbase':
             $this->provider = $loader->load('coinbaseapi');
             break;
         default:
             echo '<div class="errormsg">The API provided is not valid, please set up a valid API provider in the configuration.</div>';
             $this->provider = new fakeapi();
             break;
     }
 }
 private function __get($var)
 {
     if ($var == "params") {
         return $this->params;
     }
     return loader::load($var);
 }
Example #3
0
 public function addScalableButtonCSS()
 {
     $basepath = base::baseUrl();
     echo "<style type=\"text/css\"> @import \"{$basepath}/core/styles/btn.php\"; </style>";
     $lib = loader::load("library");
     $lib->jsm->loadButtonJS();
 }
 public function render()
 {
     $id = $this->options['id'];
     $type = $this->options['type'];
     $data = $this->options['data'];
     $style = $this->options['style'];
     $class = $this->options['class'];
     $callback = $this->options['callback'];
     $name = $this->options['name'];
     $theme = $this->options['theme'];
     $refreshinterval = $this->options['refreshinterval'];
     $position = $this->options['position'];
     if ($type == "text" || $type == "html") {
         //process text based widgets
         $output = "<div id='{$id}' class='widget {$class}' style='{$style}'>";
         if (!empty($name)) {
             $output .= "<h2 class='widgettitle'>{$name}</h2>";
         }
         $output .= "<div class='widgetdata'>{$data}</div>";
         $output .= "</div>";
     } else {
         if ($type == "rss") {
             $url = $data;
             $config = loader::load("config");
             $googleApiKey = $config->google_api;
             $output = "\n\t\t\t\t\n\t\t\t\t<div id='{$id}' class='widget {$class}' style='{$style}'>\n\t\t\t\t<h2 class='widgettitle'>{$name}</h2>\n\t\t\t\t<div class='widgetdata'>\n\t\t\t\t<script type=\"text/javascript\" src=\"http://www.google.com/jsapi?key={$googleApiKey}\"></script>\n\t\t\t    <script type=\"text/javascript\">\n\t\t\t\t    \$('#{$id}').gFeed({  \n\t\t\t\t        url: '{$data}', \n\t\t\t\t        title: ''\n\t\t\t\t    });     \n\t\t\t    </script>\n\t\t\t    </div>\n\t\t\t    ";
         }
     }
     return $output;
 }
Example #5
0
 private function __get($model)
 {
     $_model = $model;
     $model .= "model";
     $modelfile = "app/models/{$model}.php";
     $this->nullmodel = false;
     //echo getcwd();
     if (!file_exists($modelfile)) {
         $this->nullmodel = true;
         $modelfile = "core/models/nullmodel.php";
     }
     $config = loader::load("config");
     if (file_exists($modelfile)) {
         include_once $modelfile;
         if (empty($this->loaded[$model])) {
             if (!$this->nullmodel) {
                 $this->loaded[$model] = new $model();
             } else {
                 $this->loaded[$model] = new nullmodel($_model);
             }
         }
         $modelobj = $this->loaded[$model];
         if ($config->auto_model_association) {
             $post = array_merge($_POST, $_GET);
             $strictness = $config->auto_model_association_strict;
             $this->associate($modelobj, $post, $strictness);
             //auto association
         }
         return $modelobj;
     } else {
         throw new Exception("Model {$model} is not found");
     }
 }
 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     require_once 'functions/classes/coinbase/Coinbase.php';
     $this->provider = Coinbase::withApiKey($config->api_key(), $config->api_secret());
 }
 public static function setUp()
 {
     $config = loader::load("config");
     if ($config->unit_test_enabled) {
         self::$results = array();
         self::$testmode = true;
     }
 }
 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     $this->key = $config->api_key();
     $this->coin = $config->coin_code();
 }
Example #9
0
 function __construct()
 {
     $loader = new loader();
     $this->api = $loader->load('selectapi');
     $this->template = $loader->load('template');
     $this->config = $loader->load('configuration');
     $this->log = $loader->load('log');
     $this->_message = '';
     $this->_hasMessage = false;
     if (isset($_GET['next'])) {
         if ($this->validate()) {
             $useraddr = $_POST['address'];
             $amount = $this->config->faucet_amount();
             $this->sendMoney($useraddr, $amount);
         }
     }
 }
Example #10
0
 function logIP()
 {
     $time = time();
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     $ip = $_SERVER[$config->ip_forward()];
     $this->saveLog($ip, $time);
 }
 public function base()
 {
     $this->use_view = false;
     echo "Hello";
     $session = loader::load("session");
     echo $session->name2;
     $session->name2 = "abcd44dm44444";
     //echo $session->name2;
 }
 function addTechnorati()
 {
     $title = urlencode($title);
     $docUrl = urlencode(getCurrentURL());
     $url = "http://www.technorati.com/faves?add={$docUrl}";
     $image = loader::load("image");
     $bookmarkimage = $image->displayImageWithAlt("technorati.png", "Bookmark this page on StumbleUpon", null, null, $url, "_blank", true);
     return $bookmarkimage;
 }
Example #13
0
 /**
  * Constructor, used if you're not calling the class statically
  *
  * @param string $accessKey Access key
  * @param string $secretKey Secret key
  * @param boolean $useSSL Whether or not to use SSL
  * @return void
  */
 public function __construct($accessKey = null, $secretKey = null, $useSSL = true)
 {
     $config = loader::load("config");
     $key = $config->s3_key;
     $secret = $config->s3_secret;
     if (empty($key) || empty($secret)) {
         throw new Exception("Please check your configuration file. Either S3 key or S3 secret is empty.");
     }
     self::setAuth($key, $secret);
 }
 function base()
 {
     $this->use_view = false;
     $cache = loader::load("cache");
     $cache->set("abcd", "Hello World", 2);
     $cache->set("abcd2", "Hello World2", 5);
     sleep(3);
     if ($cache->isExpired("abcd")) {
         echo "This key has been expired after 2 seconds";
     }
     echo $cache->get("abcd") . ":" . $cache->get("abcd2");
 }
Example #15
0
 public function __construct()
 {
     global $debug;
     if (file_exists("app/config/routes.php")) {
         include_once "app/config/routes.php";
     }
     $path = array_keys($_GET);
     $config = loader::load("config");
     if (!isset($path[0])) {
         $default_controller = $config->default_controller;
         if (!empty($default_controller)) {
             $path[0] = $default_controller;
         } else {
             $path[0] = "index";
         }
     }
     $route = $path[0];
     $sanitzing_pattern = $config->allowed_url_chars;
     $route = preg_replace($sanitzing_pattern, "", $route);
     $route = str_replace("^", "", $route);
     $this->route = $route;
     //echo $route;
     $routParts = split("/", $route);
     $this->controller = $routParts[0];
     $this->action = isset($routParts[1]) ? $routParts[1] : "base";
     array_shift($routParts);
     array_shift($routParts);
     $this->params = $routParts;
     /* match user defined routing pattern */
     if (isset($routes)) {
         foreach ($routes as $_route) {
             $_pattern = "~{$_route[0]}~";
             $_destination = $_route[1];
             if (preg_match($_pattern, $route)) {
                 $newroute = preg_replace($_pattern, "{$_destination}", $route);
                 //$newrouteparts = split("/",$_destination);
                 $newrouteparts = split("/", $newroute);
                 //base::pr($newrouteparts);
                 $this->controller = $newrouteparts[0];
                 $this->action = $newrouteparts[1];
                 array_shift($newrouteparts);
                 array_shift($newrouteparts);
                 $this->params = $newrouteparts;
                 break;
             }
         }
     }
     if ($this->params[count($this->params) - 1] == "debug") {
         $debug = true;
         //die(Debug);
     }
 }
Example #16
0
 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     if ($config->debug_mode()) {
         // Show warnings and errors.
         error_reporting(E_ERROR | E_WARNING);
     } else {
         // Hide all errors, warnings, notices, etc from view of public.
         error_reporting(0);
     }
 }
Example #17
0
 public function setDbState($state)
 {
     //must be 'development'/'production'/'test' or whatever
     if (empty($this->dbengine)) {
         return 0;
     }
     $config = loader::load("config");
     $dbengineinfo = $config->db;
     if (isset($dbengineinfo[$state])) {
         $this->state = $state;
     } else {
         throw new Exception("No such state in config filed called ['db']['{$state}']");
     }
 }
Example #18
0
 public function __construct()
 {
     $config = loader::load("config");
     $cacheengine = $config->cache_source;
     if (!empty($cacheengine)) {
         //retrieve the cache settings
         $key = "cache_{$cacheengine}";
         $cacheinfo = $config->{$key};
         //base::pr($cacheinfo);
         $cacheobject = "cache{$cacheengine}";
         $this->cacheengine = new $cacheobject();
         $this->cacheengine->setup($cacheinfo);
     } else {
         throw new Exception("Please provide cache engine details in configuration file");
     }
 }
Example #19
0
function getCurrentURL()
{
    $router = loader::load("router");
    $url = base::baseUrl() . "/" . $router->getRoute();
    return $url;
}
Example #20
0
 function __construct()
 {
     $config = loader::load("config");
     $this->gzipenabled = $config->js_gzip_enabled;
     $this->addGenericVars();
 }
Example #21
0
 function loadConfig()
 {
     $config = loader::load($config);
     return $config;
 }
Example #22
0
<?php

/**
 * orchid bootstrap file. used internally to process request and dispatch
 * with the help of router and dispatcher.
 * 
 * @author 		Hasin Hayder [http://hasin.wordpress.com]
 * @copyright 	New BSD License
 * @version 	0.1	
 */
include "core/ini.php";
initializer::initialize();
$router = loader::load("router");
dispatcher::dispatch($router);
 public function join($fields, $tablesAndClauses, $where = null, $orderby = null, $limit = "0")
 {
     $db = loader::load("db");
     $stmt = "SELECT {$fields} FROM {$this->tablename}";
     if (!empty($where)) {
         $where = "WHERE {$where}";
     }
     if (!empty($orderby)) {
         $orderby = "ORDER BY {$orderby}";
     }
     if ($limit != "0" && $limit != "") {
         $_limit = "LIMIT {$limit}";
     }
     foreach ($tablesAndClauses as $table => $clause) {
         $stmt .= " {$clause['type']} {$table} ON {$clause['condition']} ";
     }
     $stmt .= " {$where} {$orderby} {$_limit}";
     $results = array();
     $_results = array();
     $db->execute($stmt);
     //echo $stmt;
     if ($limit == 0) {
         $limit = $db->count();
     }
     if ($limit == 0) {
         return array();
     }
     for ($i = 0; $i < $limit; $i++) {
         $data = $db->getRow();
         if (!empty($data)) {
             $_results[] = $data;
         }
     }
     if (count($_results) == 1) {
         foreach ($_results[0] as $key => $value) {
             $this->{$key} = $value;
         }
         $results = $_results[0];
         //for accessing like getName(), getField()
     }
     if (!empty($results)) {
         $this->results = $results;
     }
     return $_results;
 }
 public static function dispatch($router)
 {
     global $app, $debug, $debugparts;
     ob_start();
     $config = loader::load("config");
     if ($config->session_auto_start) {
         $session = loader::load("session");
         //if (isset($_REQUEST['PHPSESSID'])) {
         //session_id($_REQUEST['PHPSESSID']);
         //}
         $session->start();
     }
     $char_encoding = $config->char_encoding;
     if (empty($char_encoding)) {
         $char_encoding = "utf-8";
     }
     header("Content-Type: text/html; charset={$char_encoding}");
     if ($config->global_profile) {
         $start = microtime(true);
     }
     $controller = $router->getController();
     $action = $router->getAction();
     $params = $router->getParams();
     if (count($params) >= 1) {
         if ("unittest" == $params[count($params) - 1] || '1' == $_POST['unittest']) {
             unittest::setUp();
         }
     }
     $redirect = true;
     while ($redirect) {
         $controllerfile = "app/controllers/{$controller}.php";
         if (!file_exists($controllerfile)) {
             //check for catch_all_controller
             $catchAllController = $config->catch_all_controller;
             if (empty($catchAllController)) {
                 throw new Exception("Controller [{$controller}] not found. Referrer was {$_SERVER['HTTP_REFERER']}");
             } else {
                 //here the fun begins
                 $_controller = $controller;
                 $controller = $catchAllController;
                 $controllerfile = "app/controllers/{$controller}.php";
             }
         }
         require_once $controllerfile;
         $app = new $controller($params);
         if ($catchAllController) {
             $app->catchAllController = $_controller;
             $app->catchAllAction = $action;
             $action = "catchAll";
         }
         $helper = loader::load("helper");
         $cm = $helper->common;
         //load the common helper from app directory
         $app->setParams($params);
         $app->setPostParams($router->getPostParams());
         //add pre action hook execution
         $preActionHooks = $app->getPreActionHooks();
         if (!empty($preActionHooks)) {
             foreach ($preActionHooks as $preHook) {
                 $app->{$preHook}();
             }
         }
         //execute the action
         $app->use_layout = $config->use_layout;
         $app->{$action}();
         //add post action hook execution
         $postActionHooks = $app->getPostActionHooks();
         if (!empty($postActionHooks)) {
             foreach ($postActionHooks as $postHook) {
                 $app->{$postHook}();
             }
         }
         //check if the controller calls for a redirect
         if (empty($app->redirectcontroller)) {
             $redirect = false;
         } else {
             //die("called a redirect");
             $controller = $app->redirectcontroller;
             $action = $app->redirectaction;
             $params = $app->params;
             $postparams = $app->post;
             $app->redirectcontroller = "";
             $app->redirectaction = "";
             if (!empty($params)) {
                 $app->params = $params;
             }
             if (!empty($postparams)) {
                 $app->post = $postparams;
             }
         }
         //end redirect processing
     }
     unittest::tearDown();
     $rawoutput = ob_get_clean();
     //manage view
     ob_start();
     $view = loader::load("view");
     $view->set("_errors", $app->getError());
     $viewvars = $view->getVars($app);
     $uselayout = $app->use_layout;
     //modified june 21 for easy overriding via any controller
     if (!empty($app->template)) {
         $view->setTemplate($app->template);
     }
     $template = $view->getTemplate($action);
     if ($app->use_view == true) {
         base::_loadTemplate($controller, $template, $viewvars, $uselayout);
         //$app->cssm->addCoreCSS();
     } else {
         echo trim($rawoutput);
     }
     if (isset($start)) {
         echo "<div style='clear:both;'><p style='padding-top:25px;' >Total time for dispatching is : " . (microtime(true) - $start) . " seconds.</p></div>";
     }
     if ($debug) {
         if ($config->debugdetails) {
             base::pr($debugparts);
         }
     }
     $output = ob_get_clean();
     echo trim($output);
 }
Example #25
0
 public function _destroy($id)
 {
     $db = loader::load("db");
     $result = $db->execute("DELETE FROM {$this->sessionTable} WHERE id='{$id}' ");
     return true;
 }
Example #26
0
 function __construct()
 {
     $this->session = loader::load("session");
 }
Example #27
0
<?php

// Starter Faucet terms page.
// This page is the terms of service, it contains default information which can be changed.
// If you wish to create a fork of Starter Faucet (which you are permitted to) the code must remain open and you can replace the link here. (but leave the footer in tact please).
require_once 'functions/loader.php';
$loader = new loader();
$template = $loader->load('template');
$config = $loader->load('configuration');
$template->header();
?>
<h2>Using Our Service</h2>
<p>You agree that using our service is free of charge, and it costs nothing. <?php 
$config->faucet_name();
?>
 is supported revenue such as donations or advertisements.
We will never require you to pay to receive funds in your wallet, and nobody will ever ask you to part with any money.
Due to the nature of this service and it being free we cannot guarentee uptime or be outage free.</p>
<h2>Providing Donations</h2>
<p>When you provide a donation you are gifting money to the service, these funds go into the faucets pool which allows other members to receive free coins.
All donations are non-reversable and are a one time payment, however donations may be returned in certain circumstances by the sole decision of <b><?php 
echo $config->faucet_name();
?>
</b>.</p>
<h2>Our service is to improve <?php 
echo $config->coin_name();
?>
</h2>
<p>Our goal is to provide the <?php 
echo $config->coin_name();
?>
Example #28
0
<?php

// Os Loader Imagine 1.0 Alpha (Tiger)
/*
 * Using Part Files On System UI
 * Web Engine Runtime 1.3 (Wer)
 * Web Loader 0.3
 * Next... is Now...
 */
define("ImagineIndex", true);
define("concistent", null);
define("lang", "en-US");
require_once "system/class/class.loaderos.php";
// Chama a Classe Loader
$os = new loader();
// Inicia o Sistema
$os->load("index");
// Inicia os serviços
$os->start();
Example #29
0
<?php

// Starter Faucet footer page.
// This page is part of the template for the footer source code. Feel free to modify it to match your site.
require_once 'functions/loader.php';
$loader = new loader();
$config = $loader->load('configuration');
?>
</div>
<div id="footer">Powered by <a href="https://github.com/BlameByte/StarterFaucet" target="_blank">Starter Faucet</a> created by <a href="https://github.com/BlameByte" target="_blank">BlameByte</a>.<br/>
Donate to the faucet: <?php 
echo $config->donate_address();
?>
</div>
</body>
</html>
Example #30
0
 /**
  * Constructor to add API Key from Config
  * 
  * @author Hasin Hayder
  *
  */
 public function __construct()
 {
     $config = loader::load("config");
     $api_key = $config->google_map_api;
     $this->setAPIkey($api_key);
 }