Exemplo n.º 1
0
 public function __construct()
 {
     Package::load('curl_http_client');
     Config::load('eventbrite');
     $this->curl_http_client = new \curl_http_client(array('debug' => true));
     $this->baseUrl = Config::get('eventbrite_base_url');
 }
Exemplo n.º 2
0
 public function snap()
 {
     Package::load('Spider');
     $SnapSpider = new \Spider\Foursquare\SnapSpider();
     $SnapSpider->setCli(true);
     $SnapSpider->run();
 }
 public function __construct()
 {
     Package::load('curl_http_client');
     Config::load('foursquare');
     $this->curl_http_client = new \curl_http_client(array('debug' => true));
     $this->baseUrl = Config::get('foursquare_base_url');
     $this->authUrl = Config::get('foursquare_auth_url');
 }
Exemplo n.º 4
0
 public function before()
 {
     parent::before();
     $this->_module_Check(2);
     \Fuel\Core\Package::load('cacti');
     \Fuel\Core\Package::load('munin');
     \Fuel\Core\Module::load('basic');
 }
Exemplo n.º 5
0
 public static function bootstrap()
 {
     //Make sure orm is loaded first as we need this
     \Fuel\Core\Package::load('orm');
     //For fuel v1 add to the finder path
     if (class_exists('\\Fuel\\Core\\Finder')) {
         \Fuel\Core\Finder::instance()->add_path(__DIR__ . DS . '..' . DS . '..');
     }
     \Fuel\Core\Config::load('ethanol', true);
     \Fuel\Core\Config::load('ethanol_permissions', true);
     \Fuel\Core\Lang::load('ethanol', 'ethanol');
     Auth::instance()->register_driver(array('database', 'facebook'));
 }
Exemplo n.º 6
0
 /** 
  * @access  public
  * @return  Response
  */
 public function post_add()
 {
     if ($venue_id = \Input::post('venue_id')) {
         Package::load('Spider');
         $FoursquareClient = new \Spider\Foursquare\Client();
         $venues = $FoursquareClient->getVenueInfoBatch(array($venue_id), \Input::post('region_id'));
         $venue = isset($venues->response->responses[0]->response->venue) ? $venues->response->responses[0]->response->venue : false;
         if (isset($venue)) {
             $messages = \Collection\Venue::saveVenueJsonToDB($venue);
             $view = \View::forge('venues/add_success.twig', $messages);
             return \Response::forge($view);
         } else {
             return $this->get_add();
         }
     }
 }
Exemplo n.º 7
0
 public function __construct()
 {
     Package::load('Spider');
     $this->spider = new \Spider\Instagram\Spider();
     $this->spider->setCli(true);
 }
Exemplo n.º 8
0
<?php

\Fuel\Core\Package::load('fuelphp-seo');
/**
 * Seo Package
 *
 * @package    Seo
 * @version    0.1
 * @author     Hinashiki
 * @license    MIT License
 * @copyright  2015 - Hinashiki
 * @link       https://github.com/hinashiki/fuelphp-seo
 * @group      Hinashiki-fuelphp-seo
 */
class Test_Query extends \Fuel\Core\TestCase
{
    public function test_build()
    {
        $_GET = array();
        $this->assertEquals('', \Seo\Query::build());
        $_GET = array('a' => '');
        $this->assertEquals('hoge/fuga', \Seo\Query::build('hoge/fuga'));
        $_GET = array('a' => 'foo');
        $this->assertEquals('?a=foo', \Seo\Query::build());
        $_GET = array('a' => 'bar');
        $this->assertEquals('fuga/hoge?a=bar', \Seo\Query::build('fuga/hoge'));
        $_GET = array('z' => 'foo', 'a' => 'bar', 'c' => '');
        $this->assertEquals('fuga/hoge?a=bar&z=foo', \Seo\Query::build('fuga/hoge'));
        $_GET = array('a' => array('foo'));
        $this->assertEquals('fuga/hoge?a[]=foo', \Seo\Query::build('fuga/hoge'));
        $_GET = array('a' => array('foo', 'bar'));
Exemplo n.º 9
0
<?php

//Make sure orm is loaded first as we need this
\Fuel\Core\Package::load('orm');
//For fuel v1 add to the finder path
if (class_exists('\\Finder')) {
    \Fuel\Core\Finder::instance()->add_path(__DIR__ . DS . '..' . DS . '..');
}
\Fuel\Core\Config::load('ethanol', true);
\Fuel\Core\Config::load('ethanol_permissions', true);
\Fuel\Core\Lang::load('ethanol', 'ethanol');
Ethanol\Auth::instance()->register_driver(array('database', 'facebook'));
Exemplo n.º 10
0
 public function emailReport($message)
 {
     Package::load('email');
     // Create an instance
     $email = \Email::forge();
     // Set the from address
     $email->from('*****@*****.**', 'FD Report');
     // Set the to address
     $email->to('*****@*****.**', 'Stephan Alber');
     // Set a subject
     $email->subject('Report: ' . date('Y/m/d H:i'));
     // And set the body.
     $email->body($message);
 }
Exemplo n.º 11
0
 public function before()
 {
     parent::before();
     $this->_module_Check(2);
     \Fuel\Core\Package::load('nagios');
 }
Exemplo n.º 12
0
<?php

/**
 * Created by PhpStorm.
 * User: aris
 * Date: 9/19/14
 * Time: 11:19 AM
 */
namespace DbModel;

use Fuel\Core\Model_Crud;
use Fuel\Core\Package;
use Orm\Model;
use Fuel\Core\DB;
Package::load('orm');
class Model_DataTrain extends \Model
{
    private static $_db = null;
    public static function Orm_GetAllGuest()
    {
        //全部房客列表
        //Package::load('orm');
        $_ormGuest = Orm_Guest::forge();
        $_ormObjectArray = $_ormGuest->find('all');
        //Note :it returns an Array with 'Orm_Guest' inside , there's $_data : Array in there.
        $_guestArray = array();
        foreach ($_ormObjectArray as $_index => $_value) {
            array_push($_guestArray, $_value->GetData());
            //can not use $_value->_data , I don't know why. so I get the data by definding a method.
        }
        /*
Exemplo n.º 13
0
 public function sendmail($data)
 {
     Package::load('email');
     $email = Email::forge();
     $email->from($data['from'], $data['from_name']);
     $email->to($data['to'], $data['to_name']);
     $email->subject($data['subject']);
     $email->body($data['body']);
     $email->send();
 }
Exemplo n.º 14
0
 private function make($path)
 {
     $this->num = 0;
     \Fuel\Core\Package::load('excel');
     $data = new \Excel\Spreadsheet_Excel_Reader();
     $data->setOutputEncoding('UTF-8');
     $data->setUTFEncoder('mb');
     $data->read($path);
     $len = count($data->sheets[0]['cells']);
     $generator = $data->sheets[0]['cells'][$len + 1];
     $out = false;
     if (isset($generator[1])) {
         // The "i" after the pattern delimiter indicates a case-insensitive search
         if (preg_match("/Generated by RackMonkey/i", $generator[1])) {
             $this->__head($data->sheets[0]['cells'][1]);
             $out = true;
             for ($i = 2; $i < $len; $i++) {
                 if ($data->sheets[0]['cells'][$i][8]) {
                     $rack = $this->__rack($data->sheets[0]['cells'][$i][8], $data->sheets[0]['cells'][$i][7], $data->sheets[0]['cells'][$i][6]);
                 }
                 $server = $this->add_server($data->sheets[0]['cells'][$i], $rack);
                 $this->log($data->sheets[0]['cells'][$i], 20, $server);
             }
             echo '</table><br><br><a href="/basic/migrations/monkey">BACK</a></div>';
         }
     }
     if (!$out) {
         echo 'Wrong .xls file!';
     }
     //print_r($data);
     //print_r($data->formatRecords);
     /*
     
     
      for ($i = 2; $i < $len; $i++) {
     
      if ($data->sheets[0]['cells'][$i][8]) {
     
     
      $rack = $this->__rack(
      $data->sheets[0]['cells'][$i][8], //building
      $data->sheets[0]['cells'][$i][7], //room
      $data->sheets[0]['cells'][$i][6] //rack
      );
      }
     
     
      $this->add_server($data->sheets[0]['cells'][$i], $rack);
      }
     
     
      //print_r($file_content);
      }
     * 
     */
 }
Exemplo n.º 15
0
 public function __construct()
 {
     Package::load('Log');
 }
Exemplo n.º 16
0
 public function before()
 {
     \Fuel\Core\Module::load('basic');
     \Fuel\Core\Package::load('cacti');
 }
Exemplo n.º 17
0
 public function __construct()
 {
     Package::load('Spider');
 }