本文整理汇总了PHP中Bundle类的典型用法代码示例。如果您正苦于以下问题:PHP Bundle类的具体用法?PHP Bundle怎么用?PHP Bundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bundle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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('[email protected]', '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
示例16: prepareMainLinks
private function prepareMainLinks()
{
$friendsLink = DOMFactory::getLink($this->url->getCustomActionURL('friends'), Bundle::get('link.header.friends.link'))->addClass('bold tahoma-13');
$friendsFindLink = DOMFactory::getLink($this->url->getCustomActionURL('friends', 'find'), Bundle::get('link.header.friends.find.link'))->addClass('bold tahoma-13');
$videoLink = DOMFactory::getLink($this->url->getCustomActionURL('video'), Bundle::get('link.header.video'))->addClass('bold tahoma-13');
$addVideoLink = DOMFactory::getLink($this->url->getCustomActionURL('video', 'add'), Bundle::get('link.header.video.add'))->addClass('bold tahoma-13');
$this->template->friendsLink = DOMFactory::getLi($friendsLink);
$this->template->friendsFindLink = DOMFactory::getLi($friendsFindLink);
$this->template->videoLink = DOMFactory::getLi($videoLink);
$this->template->addVideoLink = DOMFactory::getLi($addVideoLink);
}
开发者ID:anzasolutions,项目名称:simlandia,代码行数:11,代码来源:menuview.class.php
示例17: start
static function start()
{
Bundle::start('htmlki');
error_reporting(-1);
static::$logged = array();
assert_options(ASSERT_BAIL, 1);
if (!static::$attached) {
static::$attached = true;
\Event::listen('laravel.log', array(get_called_class(), 'onLog'));
}
}
开发者ID:SerdarSanri,项目名称:VaneMart,代码行数:11,代码来源:test.php
示例18: __construct
/**
* Start the generation process.
*
* @return void
*/
public function __construct($args)
{
parent::__construct($args);
// we need a controller name
if ($this->lower == null) {
Common::error('You must specify a bundle name.');
}
// add the directory copy to the writer
$this->writer->copy_directory('Bundle', $this->lower, Bundle::path('bob') . 'templates/bundle', path('bundle') . $this->lower);
$this->writer->write();
}
开发者ID:gigikiri,项目名称:masjid-l3,代码行数:16,代码来源:bundle.php
示例19: refresh
public static function refresh()
{
$default_data = array('service' => null, 'timestamp' => time(), 'ip' => self::ip(), 'city' => null, 'state' => null, 'state_code' => null, 'country' => null, 'country_code' => null, 'zipcode' => null, 'lat' => null, 'lng' => null);
foreach (Config::get('locate::options.service_priority') as $service) {
require_once Bundle::path('locate') . 'services/' . strtolower($service) . '.php';
$data = $service::run();
if ($data !== false) {
$default_data['service'] = $service;
break;
}
}
Session::put('locate', isset($data) && is_array($data) ? array_merge($default_data, $data) : $default_data);
}
开发者ID:SerdarSanri,项目名称:locate,代码行数:13,代码来源:locate.php
示例20: __construct
public function __construct()
{
parent::__construct();
$this->filter('before', 'auth');
$this->filter('before', 'mwi.admin_controller_start', array($this));
// $this->filter('before', 'check_rule:admin');
$this->filter('before', 'csrf')->on('post');
$this->data['installed_and_active_modules'] = Modules\Model\Module::where('enabled', '=', 1)->get(array('name', 'menu'));
if (Bundle::exists('themes')) {
$this->theme->set_theme(Config::get('settings::core.backend_theme'), 'backend');
$this->theme->set_layout(Config::get('settings::core.backend_layout'), 'backend');
$this->theme->_theme_data = $this->data;
}
}
开发者ID:juaniiie,项目名称:mwi,代码行数:14,代码来源:Admin.php
注:本文中的Bundle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论