当前位置: 首页>>代码示例>>PHP>>正文


PHP Bundle类代码示例

本文整理汇总了PHP中Bundle的典型用法代码示例。如果您正苦于以下问题:PHP Bundle类的具体用法?PHP Bundle怎么用?PHP Bundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Bundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     Bundle::start('messages');
     $twoweeks = date('Y-m-d', strtotime('+2 weeks'));
     $week = date('Y-m-d', strtotime('+1 weeks'));
     $tomorrow = date('Y-m-d', strtotime('+1 day'));
     $rooms = Room::where_del_date($tomorrow)->or_where('del_date', '=', $week)->or_where('del_date', '=', $twoweeks)->get();
     foreach ($rooms as $room) {
         switch ($room->del_date) {
             case $twoweeks:
                 $expire_date = "over twee weken";
                 break;
             case $week:
                 $expire_date = "over een week";
                 break;
             case $tomorrow:
                 $expire_date = "morgen";
                 break;
         }
         Message::send(function ($message) use($room, $expire_date) {
             $message->to($room->email);
             $message->from('kamers@kamergenood.nl', 'Kamergenood');
             $message->subject('Verleng de kameradvertentie: "' . $room->title . '"');
             $message->body('view: emails.extend');
             $message->body->id = $room->id;
             $message->body->title = $room->title;
             $message->body->url = $room->url;
             $message->body->delkey = $room->delkey;
             $message->body->expire_date = $expire_date;
             $message->html(true);
         });
     }
 }
开发者ID:sanneterpstra,项目名称:Kamergenood,代码行数:33,代码来源:extend.php

示例2: setUp

 /**
  * Setup the test environment.
  */
 public function setUp()
 {
     Bundle::start('oneauth');
     Config::set('application.url', 'http://localhost');
     Config::set('application.index', '');
     Config::set('oneauth::urls', array('registration' => 'auth/register', 'login' => 'auth/login', 'callback' => 'auth/callback', 'registered' => 'auth/home', 'logged_in' => 'auth/account'));
 }
开发者ID:marmaray,项目名称:OLD-laravel-France-website,代码行数:10,代码来源:core.test.php

示例3: __destruct

 public function __destruct()
 {
     Bundle::disable('email');
     Bundle::disable('settings');
     Bundle::disable('modules');
     Bundle::disable('navigation');
 }
开发者ID:juaniiie,项目名称:mwi,代码行数:7,代码来源:schema.php

示例4: tearDown

 /**
  * Destroy the testing environment.
  */
 public function tearDown()
 {
     Bundle::$started = array();
     Bundle::$routed = array();
     Router::$names = array();
     Router::$routes = array();
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:10,代码来源:routing.test.php

示例5: get_links_tree

 /**
  * Build a multi-array of parent > children.
  *
  * @return array An array representing the page tree.
  */
 public function get_links_tree()
 {
     if (\Bundle::exists('pages')) {
         $all_links = Link::with('page')->order_by('order', 'asc')->get(array('id', 'group_id', 'title', 'class'));
     } else {
         $all_links = Link::order_by('order', 'asc')->get(array('id', 'group_id', 'title', 'class'));
     }
     // First, re-index the array.
     foreach ($all_links as $row) {
         $pages[$row->id] = array('id' => $row->id, 'li_id' => 'link_', 'link_type' => $row->link_type, 'rel' => $row->navigation_group_id, 'parent_id' => $this->id, 'title' => $row->title, 'url' => $row->url, 'target' => $row->target, 'class' => $row->class);
     }
     unset($all_links);
     // Build a multidimensional array of parent > children.
     foreach ($pages as $row) {
         if (array_key_exists($row['parent_id'], $pages)) {
             // Add this page to the children array of the parent page.
             $pages[$row['parent_id']]['children'][] =& $pages[$row['id']];
         }
         // This is a root page.
         if ($row['parent_id'] == 0) {
             $page_array[] =& $pages[$row['id']];
         }
     }
     return $page_array;
 }
开发者ID:juaniiie,项目名称:mwi,代码行数:30,代码来源:link.php

示例6: testIssues

 public function testIssues()
 {
     Bundle::start('flyswatter');
     // Seed Database
     Controller::call('flyswatter::seed@seed');
     $issue = Issue::find(1);
     $this->assertNotNull($issue->id);
 }
开发者ID:SerdarSanri,项目名称:flyswatter,代码行数:8,代码来源:models.test.php

示例7: _getSeedFolders

 /**
  * @return array of paths that we can find seeds
  */
 protected function _getSeedFolders()
 {
     $bins = array(path('app') . 'seeds' . DIRECTORY_SEPARATOR);
     foreach (Bundle::$bundles as $bundle) {
         $bins[] = Bundle::path($bundle['location']) . 'seeds' . DIRECTORY_SEPARATOR;
     }
     return $bins;
 }
开发者ID:jvillasante,项目名称:cubanartjb,代码行数:11,代码来源:seed.php

示例8: users

 public function users()
 {
     if (\Bundle::exists('permissions')) {
         return $this->has_many('Users\\Model\\User');
     } else {
         throw new \Exception('Permissions module is not installed. To call goups with users you must install the permissions module.');
     }
 }
开发者ID:juaniiie,项目名称:mwi,代码行数:8,代码来源:group.php

示例9: send

 /**
  * Sends an email
  *
  * @param string  $email
  * @param string  $title
  * @param string $content
  * @return boolean
  */
 public static function send($email, $title, $content)
 {
     Bundle::start('swiftmailer');
     $transporter = Swift_SmtpTransport::newInstance('smtp.googlemail.com', Config::get('gotin::gotin.smtp_port'), 'ssl')->setUsername(Config::get('gotin::gotin.smtp_user'))->setPassword(Config::get('gotin::gotin.smtp_password'));
     $mailer = Swift_Mailer::newInstance($transporter);
     $message = Swift_Message::newInstance($title)->setFrom(array(Config::get('gotin::gotin.from_email') => Config::get('gotin::gotin.from_title')))->setTo(array($email => $email))->setBody($content, 'text/html');
     return $mailer->send($message);
 }
开发者ID:SerdarSanri,项目名称:gotin,代码行数:16,代码来源:mailer.php

示例10: group

 public function group()
 {
     if (\Bundle::exists('groups')) {
         return $this->belongs_to('Groups\\Model\\Group');
     } else {
         throw new \Exception('Groups module is not installed. To call users with group you must install the groups module.');
     }
 }
开发者ID:juaniiie,项目名称:mwi,代码行数:8,代码来源:user.php

示例11: path

 /**
  * Get the path to a view on disk.
  *
  * @param $view
  *
  * @return string
  * @throws \Exception
  */
 protected function path($view)
 {
     $root = \Bundle::path(\Bundle::name($view)) . 'views';
     $path = $root . DS . \Bundle::element($view);
     if (file_exists($path)) {
         return $path;
     }
     throw new \Exception("View [{$view}] does not exist.");
 }
开发者ID:SerdarSanri,项目名称:laravel-weed,代码行数:17,代码来源:filesystem.php

示例12: get_new

 public function get_new()
 {
     $this->data['section_bar_active'] = __('email::lang.Send Email')->get(ADM_LANG);
     $this->data['groups_dropdown'] = null;
     if (Bundle::exists('groups')) {
         $this->data['groups_dropdown'] = Groups\Model\Group::all();
     }
     $this->data['email_templates'] = Email\Model\Template::all();
     return $this->theme->render('email::email.new', $this->data);
 }
开发者ID:juaniiie,项目名称:mwi,代码行数:10,代码来源:email.php

示例13: getUsers

 private function getUsers($name)
 {
     try {
         $users = $this->model->getUsersWithName($name);
         $this->values->users = $users;
         $this->values->name = $name;
     } catch (NoResultException $e) {
         $this->request->error = Bundle::get('friends.users.not.found', $name);
     }
 }
开发者ID:anzasolutions,项目名称:simlandia,代码行数:10,代码来源:friendscontroller.class.php

示例14: post_process

 public function post_process()
 {
     Log::write('PayPal', 'Trying to process IPN');
     Bundle::start('paypal-ipn');
     $listener = new IpnListener();
     //        $listener->use_sandbox = true;
     try {
         $listener->requirePostMethod();
         $verified = $listener->processIpn();
     } catch (Exception $e) {
         Log::info($e->getMessage());
     }
     if ($verified) {
         Log::write('PayPal', 'IPN payment looks verified');
         $data = Input::get();
         $settings = IniHandle::readini();
         if (!in_array($data['payment_status'], array('Completed', 'COMPLETED', 'completed'))) {
             Log::write('PayPal', 'payment not completed');
             return View::make('msg.error')->with('error', 'PayPal: payment not completed');
         }
         if (strtolower($data['receiver_email']) != strtolower($settings['ppemail'])) {
             Log::write('PayPal', 'receive email not same as set in settings. Settings: ' . $settings['ppemail'] . ' ||| PayPal email: ' . $data['receiver_email']);
             return View::make('msg.error')->with('error', 'PayPal: receive email not same as set in settings');
         }
         if (Payment::where('transaction_id', '=', $data['txn_id'])->count() != 0) {
             Log::write('PayPal', 'transaction ID already exists');
             return View::make('msg.error')->with('error', 'PayPal: transaction ID already exists');
         }
         if (strtolower($data['mc_currency']) != strtolower($settings['ppcurrency'])) {
             Log::write('PayPal', 'Currencies do not match');
             return View::make('msg.error')->with('error', 'PayPal: currencies do not match');
         }
         Log::write('PayPal', 'Got past all PLAN controller checks now going into CUSTOM');
         if (strtolower($data['custom']) == 'plan') {
             $result = Payment::verifyPlan($data);
             if (!$result) {
                 return $result;
             }
         } elseif (strtolower($data['custom']) == 'blacklist_skype' || strtolower($data['custom']) == 'blacklist_ip') {
             $result = Payment::verifyBlacklist($data);
             if (!$result) {
                 return $result;
             }
         } else {
             Log::write('PayPal', 'Custom not found, can\'t verify anything');
             return View::make('msg.error')->with('error', 'Fraudulent payment?');
         }
         Log::write('PayPal', 'Now trying to add Payment info to DB');
         $payment = Payment::create(array('user_id' => $data['option_selection1'], 'token' => $data['ipn_track_id'], 'date' => date('Y-m-d H:i:s', time()), 'ack' => $data['payment_status'], 'transaction_id' => $data['txn_id'], 'amount' => $data['mc_gross'], 'paypal_fee' => $data['mc_fee'], 'status' => $data['payment_status'], 'description' => $data['custom']));
         Log::write('PayPal', 'Successful payment, DB id: ' . $payment->id);
     } else {
         Log::write('PayPal', 'IPN listener returns false on check');
     }
     return 'handled';
 }
开发者ID:albertpaulp,项目名称:PrettyBoot,代码行数:55,代码来源:plan.php

示例15: build

 /**
  * Create requested Form Object.
  * @author anza
  * @param string $form Name of Form Object to be created.
  * @throws FormNotFoundException When impossible to find class of Form Object.
  * @return New Form Object if its class exists.
  */
 public static function build($form)
 {
     try {
         $fo = $form . self::FO;
         if (class_exists($fo)) {
             return new $fo();
         }
     } catch (LogicException $e) {
         throw new FormNotFoundException(Bundle::get('form.validation.form.not.found', $fo));
     }
 }
开发者ID:anzasolutions,项目名称:simlandia,代码行数:18,代码来源:fofactory.class.php


注:本文中的Bundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。