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


PHP Time::next_year方法代码示例

本文整理汇总了PHP中Time::next_year方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::next_year方法的具体用法?PHP Time::next_year怎么用?PHP Time::next_year使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Time的用法示例。


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

示例1: set

 /**
  *	@fn set
  *	@short Action method to set the user's home language.
  */
 public function set()
 {
     $lang = isset($_REQUEST['id']) ? $_REQUEST['id'] : 'en';
     Cookie::set('hl', $lang, Time::next_year(), '/');
     $this->redirect_to_referrer();
     $this->redirect_to(array('controller' => 'home'));
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:11,代码来源:language_controller.php

示例2: login

 /**
  *	@fn login
  *	@short Action method to perform a login.
  */
 function login()
 {
     if ($this->request->is_post()) {
         $conn = Db::get_connection();
         $user_factory = new User();
         $users = $user_factory->find_all(array('where_clause' => "`username` = '{$conn->escape($_POST['username'])}' AND `password` = '" . md5($_POST['password']) . "'", 'limit' => 1));
         if (count($users) > 0) {
             $user = $users[0];
             $expires = $_POST['leave_me_registered'] ? Time::next_year() : Time::tomorrow();
             Cookie::set('_u', $user->username, $expires, "/", FALSE);
             Cookie::set('_uid', md5(Login::magic_phrase . $user->password), $expires, "/", FALSE);
             // Annotates the login in the database
             $user_login = new UserLogin();
             $user_login->user_id = $user->id;
             $user_login->performed_at = date("Y-m-d H:i:s");
             $user_login->save();
             $this->flash(sprintf(l('Welcome, %s'), $user->first), 'info');
             // When login is required to access a particular action, we may store controller & action in a session,
             // perform login, then redirect to the action requested in the first place
             if (isset($_SESSION['redirect_to'])) {
                 $this->redirect_to(array('controller' => $_SESSION['redirect_to']['controller'], 'action' => $_SESSION['redirect_to']['action']));
             } else {
                 $this->redirect_to(array('controller' => 'home'));
             }
             Db::close_connection($conn);
         } else {
             $this->flash(l('Bad username / password'), 'error');
         }
     }
     $this->redirect_to(array('action' => 'index'));
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:35,代码来源:login_controller.php

示例3: set_credentials

 /**
  *	@fn set_credentials($realname, $email, $website)
  *	@short Stores a set of credentials into a cookie using Base64 encoding.
  *	@param realname The user's real name.
  *	@param email The user's email address.
  *	@param url The user's website URL.
  */
 protected function set_credentials($realname = '', $email = '', $url = '')
 {
     $credentials = $realname . '%%' . $email . '%%' . $url;
     $encoded = Base64::encode($credentials);
     Cookie::set('_vc', $encoded, Time::next_year());
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:13,代码来源:eme_controller.php

示例4: dirname

<?php

require_once dirname(__FILE__) . "/../include/db.inc.php";
require_once dirname(__FILE__) . "/../include/" . DB_ADAPTER . "_adapter.php";
require_once dirname(__FILE__) . "/../models/user.php";
require_once dirname(__FILE__) . "/../models/titlebar_message.php";
require_once dirname(__FILE__) . "/cookie.php";
require_once dirname(__FILE__) . "/time.php";
require_once dirname(__FILE__) . "/login.php";
require_once dirname(__FILE__) . "/localization.php";
error_reporting(E_ALL | E_NOTICE);
session_name('_eme_sid');
session_set_cookie_params(Time::next_year(), '/');
//session_save_path(dirname(__FILE__) . "/../session");
session_start();
if (isset($_COOKIE['hl'])) {
    setlocale(LC_TIME, $_COOKIE['hl']);
}
class ApplicationHelper
{
}
开发者ID:emeraldion,项目名称:zelda,代码行数:21,代码来源:application_helper.php


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