Example #1
0
 /**
  * Creates wait queue
  *
  * @return AMQPQueue
  */
 private function getQueue($name)
 {
     $queue = $this->broker->queue(null, $name . "-wait");
     $queue->setArgument("x-dead-letter-exchange", $name);
     $queue->setArgument("x-message-ttl", $this->getExpiration() * 1000);
     $queue->declareQueue();
     return $queue;
 }
 /**
  * Tests directory and filename filtering.
  *
  * @dataProvider directoryFilterProvider
  * @param string|array $filters Filename filter(s)
  * @param array $fileNames Filtered filenames
  */
 public function testDirectoryFiltering($filters, array $fileNames)
 {
     $broker = new Broker(new Broker\Backend\Memory());
     $files = $broker->processDirectory(realpath(__DIR__ . '/../data'), $filters, true);
     $brokerFileNames = array();
     foreach ($files as $file) {
         $brokerFileNames[] = basename($file->getName());
     }
     $this->compareFileLists($fileNames, $brokerFileNames);
 }
 public function run()
 {
     $broker = new Broker();
     $broker->broker_first_name = 'Daryl';
     $broker->broker_last_name = 'Zipp';
     $broker->broker_phone_number = '210.844.8683';
     $broker->broker_email = '*****@*****.**';
     // $broker->broker_photo		='daryl.jpg'; //can be nullable
     $broker->broker_password = $_ENV['BROKER_PASS'];
     $broker->save();
 }
Example #4
0
 public function helperBroker()
 {
     if ($this->_helperBroker === null) {
         $this->_helperBroker = Broker::newInstance($this);
     }
     return $this->_helperBroker;
 }
Example #5
0
 public function store()
 {
     $prospect = new Prospect();
     $fullAddress = Input::get('prospect-address');
     $addressPieces = explode(", ", $fullAddress);
     $prospect->prospect_address = $addressPieces[0];
     $prospect->prospect_city = $addressPieces[1];
     $prospect->prospect_state = $addressPieces[2];
     $prospect->prospect_address_lat = Input::get('latitude');
     $prospect->prospect_address_lng = Input::get('longitude');
     $prospect->prospect_zip = Input::get('zipcode');
     if (Input::has('prospect-unit-number')) {
         $prospect->prospect_apt_unit = Input::get('prospect-unit-number');
     }
     $prospect->agent_id = Agent::findOrFail(1)->id;
     //formula to determine agent
     $prospect->broker_id = Broker::findOrFail(1)->id;
     if ($prospect->save()) {
         //true returns true or false
         return Redirect::action('HomeController@edit', array('prospect' => $prospect->id));
     } else {
         Session::flash('errorMessage', 'Unable to locate property!');
         return Redirect::back()->withInput();
     }
 }
 public function actionIndex()
 {
     $this->pageTitle = Yii::t('title', 'Auctions');
     $criteria = new CDbCriteria();
     $criteria->select = 'item_id, item_count, seller, price, broker_race, expire_time';
     // Fallenfate - These were broken because they were item_id, item_count, etc.
     $criteria->order = 'id DESC';
     $criteria->condition = 'is_sold = 0';
     $pages = new CPagination(Broker::model()->count($criteria));
     $pages->pageSize = 50;
     $pages->applyLimit($criteria);
     $model = Broker::model()->findAll($criteria);
     $this->render('/broker', array('model' => $model, 'pages' => $pages));
 }
 public function run()
 {
     $brokerage = new Brokerage();
     $brokerage->brokerage_name = 'Texas Premier Realty';
     $brokerage->brokerage_address = '3834 Deerfield Drive';
     // $brokerage->brokerage_unit_suite    = ''; //can be null
     $brokerage->brokerage_city = 'San Antonio';
     $brokerage->brokerage_state = 'TX';
     $brokerage->brokerage_zip = '78218';
     $brokerage->brokerage_phone_number = '210.844.8683';
     $brokerage->brokerage_email = '*****@*****.**';
     // $brokerage->brokerage_logo          = '';  //can be null
     $brokerage->broker_id = Broker::findorFail(1)->id;
     $brokerage->save();
 }
 public function run()
 {
     $agent = new Agent();
     $agent->agent_first_name = 'Leticia';
     $agent->agent_last_name = 'Fuentes';
     $agent->agent_phone_number = '210.213.9803';
     $agent->agent_email = '*****@*****.**';
     $agent->agent_photo = '/img/agents/lettyfuentes.jpg';
     $agent->agent_facebook = 'https://www.facebook.com/AlamoCityHomes';
     $agent->agent_linkedin = 'https://www.linkedin.com/in/lettyfuentes';
     $agent->agent_twitter = 'https://twitter.com/lettyfuentes5';
     $agent->agent_youtube = 'https://www.youtube.com/user/AlamoCityDreamoHomes';
     $agent->agent_password = $_ENV['AGENT_PASS'];
     // $agent->agent_listing_leads   = ''  //can be null
     // $agent->agent_listing_appointments  = '' //can be null
     // $agent->agent_listings_taken  = ''  //can be null
     // $agent->agent_listings_sold   = ''  //can be null
     // $agent->agent_lead_to_sold_rate= '';  //can be null
     // $agent->agent_dollar_volume   = ''; //can be null
     $agent->agent_lead_received = false;
     $agent->brokerage_id = Brokerage::findorFail(1)->id;
     $agent->broker_id = Broker::findorFail(1)->id;
     $agent->save();
 }
Example #9
0
 public function update()
 {
     $isLogged = $this->protection->isUserLogged();
     $data['status'] = null;
     $data['object'] = array();
     $data['errors'] = array();
     if ($isLogged) {
         $validationRules = array(array('field' => 'id', 'label' => 'ID', 'rules' => 'required|is_natural_no_zero'));
         $this->form_validation->set_rules($validationRules);
         $this->form_validation->set_message('required', 'O campo %s não pode ser vazio.');
         $this->form_validation->set_message('is_natural_no_zero', 'O campo %s deve ser um inteiro positivo.');
         if ($this->form_validation->run()) {
             $id = $this->input->post('id');
             $broker = new Broker($id, null, null, null);
             if ($this->input->post('ip_address')) {
                 $broker->setIpAddress($this->input->post('ip_address'));
             }
             if ($this->input->post('port')) {
                 $broker->setPort($this->input->post('port'));
             }
             if ($this->input->post('topic')) {
                 $broker->setTopic($this->input->post('topic'));
             }
             $data['status'] = true;
             $this->load->model('model_brokers');
             $data["object"] = $this->model_brokers->update($broker);
         } else {
             $data["status"] = false;
             foreach ($validationRules as $field) {
                 $error = form_error($field['field']);
                 if ($error != "") {
                     $data["errors"][] = $error;
                 }
             }
         }
     } else {
         $data['status'] = false;
         $data['errors'][] = $this->apphelper->getErrMsgs()['login'];
     }
     //prepare the answer
     $clientAccepts = $this->apphelper->getAcceptHeader();
     switch ($clientAccepts[0]) {
         case "text/html":
             $this->apphelper->loadDefaultViewData($data);
             if ($isLogged) {
                 $viewName = 'html/view_brokers.php';
                 $this->load->model('model_user');
                 $email = $this->session->userdata('email');
                 $data['sessionUser'] = $this->model_user->getUserByEmail($email);
             } else {
                 $viewName = 'html/view_login';
                 $this->apphelper->loadLoginInputs($data);
             }
             break;
         case "application/json":
             $viewName = 'json_render.php';
             $data['jsonData']['status'] =& $data['status'];
             $data['jsonData']['object'] =& $data['object'];
             $data['jsonData']['errors'] =& $data['errors'];
             break;
         default:
             $viewName = 'text_render.php';
             $data['text'] = $this->apphelper->getErrMsgs()['unknowMIME'];
             break;
     }
     //sends the answer
     $this->load->view($viewName, $data);
 }
 function parse($oldMessage, $newMessage, $expected = array())
 {
     $broker = new Broker();
     $result = $broker->parseEvent($newMessage, 'mailto:strunk@example.org', $oldMessage);
     $this->assertEquals(count($expected), count($result));
     foreach ($expected as $index => $ex) {
         $message = $result[$index];
         foreach ($ex as $key => $val) {
             if ($key === 'message') {
                 $this->assertEquals(str_replace("\n", "\r\n", $val), rtrim($message->message->serialize(), "\r\n"));
             } else {
                 $this->assertEquals($val, $message->{$key});
             }
         }
     }
 }
Example #11
0
<?php

error_reporting(1);
require_once 'articlemeta/broker.php';
$collections = array('scl' => 'www.scielo.br', 'arg' => 'www.scielo.org.ar', 'cub' => 'scielo.sld.cu', 'esp' => 'scielo.isciii.es', 'col' => 'www.scielo.org.co', 'sss' => 'socialsciences.scielo.org', 'spa' => 'www.scielosp.org', 'mex' => 'www.scielo.org.mx', 'prt' => 'www.scielo.gpeari.mctes.pt', 'cri' => 'www.scielo.sa.cr', 'ven' => 'www.scielo.org.ve', 'ury' => 'www.scielo.edu.uy', 'per' => 'www.scielo.org.pe', 'chl' => 'www.scielo.cl', 'sza' => 'www.scielo.org.za', 'bol' => 'www.scielo.org.bo', 'par' => 'scielo.iics.una.py');
$doi = $_REQUEST['q'];
$lng = $_REQUEST['lng'];
$articlemeta = new Broker();
$json = $articlemeta->get_document_by_doi($doi);
$pid = $json->code;
$collection = $json->collection;
if ($pid == NULL) {
    header('HTTP/1.0 404 Not Found');
    ?>
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL <?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
 was not found on this server.</p>
    <hr>
    <?php 
    echo $_SERVER['SERVER_SIGNATURE'];
    ?>
    </body></html>
<?php 
    exit;
}
Example #12
0
 /**
  * Creates wait exchange
  *
  * @return AMQPExchange
  */
 private function getExchange($name)
 {
     return $this->broker->declareExchange(AMQP_DURABLE, $name . ".dlx", AMQP_EX_TYPE_DIRECT);
 }
Example #13
0
 /**
  * Apishka
  *
  *
  * @return RouterAbstract
  */
 public static function apishka()
 {
     return Broker::getInstance()->getRouter(get_called_class());
 }
Example #14
0
 /**
  * Set plugin broker instance
  *
  * @param  string|Broker $broker Plugin broker to load plugins
  * @return Zend\Loader\Pluggable
  */
 public function setBroker($broker)
 {
     $broker->setView($this);
     $this->__environment->setBroker($broker);
     return $this;
 }
 /**
  * Tests constants defined in interfaces.
  */
 public function testInterfaces()
 {
     $broker = new Broker(new Broker\Backend\Memory());
     $broker->process($this->getFilePath('interfaces'));
     $class1 = $broker->getClass('TokenReflection_Test_ConstantInterfaceClass');
     $this->assertTrue($class1->hasConstant('FIRST'));
     $class2 = $broker->getClass('TokenReflection_Test_ConstantInterfaceClass2');
     $this->assertTrue($class2->hasConstant('FIRST'));
     $this->assertTrue($class2->hasConstant('SECOND'));
 }