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


PHP static::id方法代码示例

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


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

示例1: create

 /**
  * Generates a captcha image, writing it to the output
  * It is used internally by this bundle when pointing to "/captcha" (see [vendor]\routes.php)
  * Typically, you won't use this function, but use the above img() function instead
  *
  * @access	public
  * @return	img
  */
 public static function create($id = null)
 {
     static::$char = Str::random(static::$config['length'], static::$config['type']);
     static::$id = $id ? $id : static::$config['id'];
     Session::put('captchaHash', Hash::make(static::$config['sensitive'] === true ? static::$char : Str::lower(static::$char)));
     $bg_image = static::asset('backgrounds');
     $bg_image_info = getimagesize($bg_image);
     if ($bg_image_info['mime'] == 'image/jpg' || $bg_image_info['mime'] == 'image/jpeg') {
         $old_image = imagecreatefromjpeg($bg_image);
     } elseif ($bg_image_info['mime'] == 'image/gif') {
         $old_image = imagecreatefromgif($bg_image);
     } elseif ($bg_image_info['mime'] == 'image/png') {
         $old_image = imagecreatefrompng($bg_image);
     }
     $new_image = imagecreatetruecolor(static::$config['width'], static::$config['height']);
     $bg = imagecolorallocate($new_image, 255, 255, 255);
     imagefill($new_image, 0, 0, $bg);
     imagecopyresampled($new_image, $old_image, 0, 0, 0, 0, static::$config['width'], static::$config['height'], $bg_image_info[0], $bg_image_info[1]);
     $bg = imagecolorallocate($new_image, 255, 255, 255);
     for ($i = 0; $i < strlen(static::$char); $i++) {
         $color_cols = explode(',', static::asset('colors'));
         $fg = imagecolorallocate($new_image, trim($color_cols[0]), trim($color_cols[1]), trim($color_cols[2]));
         imagettftext($new_image, static::asset('fontsizes'), rand(-10, 15), 10 + $i * static::$config['space'], rand(static::$config['height'] - 10, static::$config['height'] - 5), $fg, static::asset('fonts'), static::$char[$i]);
     }
     imagealphablending($new_image, false);
     header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
     header('Pragma: no-cache');
     header("Content-type: image/jpg");
     header('Content-Disposition: inline; filename=' . static::$id . '.jpg');
     imagejpeg($new_image, null, 80);
     imagedestroy($new_image);
 }
开发者ID:shojibflamon,项目名称:captcha,代码行数:40,代码来源:Captcha.php

示例2: setUp

 function setUp()
 {
     static::$id = 7777777;
     static::$pattern = "iformbuilder\\.com\\/exzact\\/api\\/v60\\/profiles\\/[0-9]+\\/optionlists";
     $this->setResourceType('Iform\\Resources\\OptionList\\OptionLists');
     parent::setUp();
 }
开发者ID:ZerionSoftware,项目名称:iFormBuilderAPI-v60,代码行数:7,代码来源:OptionListTest.php

示例3: idType

 /**
  * @return \Fubhy\GraphQL\Type\Definition\Types\Scalars\IdType
  */
 public static function idType()
 {
     if (!isset(static::$id)) {
         static::$id = new IdType();
     }
     return static::$id;
 }
开发者ID:fubhy,项目名称:graphql-php,代码行数:10,代码来源:Type.php

示例4: setUp

 function setUp()
 {
     static::$id = 7777777;
     static::$pattern = "iformbuilder\\.com\\/exzact\\/api\\/v60\\/profiles\\/[0-9]+\\/pages\\/" . static::$id . "\\/elements";
     $this->setIdentifier(static::$id);
     $this->setResourceType('Iform\\Resources\\Element\\Elements');
     parent::setUp();
 }
开发者ID:ZerionSoftware,项目名称:iFormBuilderAPI-v60,代码行数:8,代码来源:BaseResourceImplementationTest.php

示例5: setId

 /**
  * component의 id를 지정한다.
  *
  * @param string $id 지정할 id
  *
  * @return void
  */
 public static function setId($id)
 {
     if (property_exists(static::class, 'id')) {
         static::$id = $id;
     } else {
         self::$id[static::class] = $id;
     }
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:15,代码来源:ComponentTrait.php

示例6: required

 public static function required()
 {
     static::preInit();
     $sid = session_id();
     if (!$sid) {
         session_start();
         $sid = session_id();
         if (!isset($_SESSION['ip'], $_SESSION['logins'])) {
             // Session not started for this session
             $_SESSION = array('ip' => sha1($_SERVER['REMOTE_ADDR']), 'ua' => sha1($_SERVER['HTTP_USER_AGENT']), 'start' => time(), 'active' => time(), 'messages' => array(), 'logins' => array(), 'vars' => array());
         } else {
         }
         static::$session =& $_SESSION;
         static::$id = session_id();
     }
 }
开发者ID:rudiedirkx,项目名称:Rudie-on-wheels,代码行数:16,代码来源:Session.php

示例7: start

 public static function start()
 {
     // run gc
     static::gc();
     // get session id
     $name = Config::get('session.name', 'anchorcms');
     static::$id = Cookie::get($name);
     if (static::$id === false) {
         Log::info('Session cookie not found: ' . $name);
         static::$id = Str::random(32);
     }
     // load session data
     $sql = "select data from sessions where id = ? and ip = ? and ua = ? limit 1";
     $args = array(static::$id, Input::ip_address(), Input::user_agent());
     if ($session = Db::row($sql, $args)) {
         static::$data = unserialize($session->data);
     } else {
         // Session not found regenerate ID
         static::$id = Str::random(32);
         Db::insert('sessions', array('id' => static::$id, 'date' => date(DATE_ISO8601), 'ip' => Input::ip_address(), 'ua' => Input::user_agent(), 'data' => serialize(static::$data)));
     }
 }
开发者ID:nathggns,项目名称:anchor-cms,代码行数:22,代码来源:session.php

示例8: setUserId

 /**
  * Authentication classes should call this method
  *
  * @param string $id user id as identified by the authentication classes
  *
  * @return void
  */
 public static function setUserId($id)
 {
     static::$id = $id;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:11,代码来源:User.php

示例9: batchDelete

 public static function batchDelete($bulkId, $async = true)
 {
     $bulk = [];
     foreach ($bulkId as $id) {
         $obj = new static(static::getPrimaryArray($id));
         $bulk[] = ['delete' => $obj->setBulkParams(['id' => $obj->id()])];
     }
     if ($async) {
         return static::asyncBulk($bulk);
     } else {
         return static::bulk($bulk);
     }
 }
开发者ID:hikenote,项目名称:elasticsearchORM,代码行数:13,代码来源:ElasticsearchModel.php

示例10: id

 /**
  * Returns the session id.
  * Calling this method will not auto start the session. You might have to manually
  * assert a started session.
  *
  * Passing an id into it, you can also replace the session id if the session
  * has not already been started.
  * Note that depending on the session handler, not all characters are allowed
  * within the session id. For example, the file session handler only allows
  * characters in the range a-z A-Z 0-9 , (comma) and - (minus).
  *
  * @param string|null $id Id to replace the current session id
  * @return string Session id
  */
 public static function id($id = null)
 {
     if ($id) {
         static::$id = $id;
         session_id(static::$id);
     }
     if (static::started()) {
         return session_id();
     }
     return static::$id;
 }
开发者ID:dereuromark,项目名称:cakephp-shim,代码行数:25,代码来源:Session.php

示例11: tearDown

 function tearDown()
 {
     m::close();
     static::$id = "";
     static::$pattern = "";
     unset($this->stub);
     unset($this->resourceType);
     unset($this->resource);
     unset($this->identifier);
 }
开发者ID:ZerionSoftware,项目名称:iFormBuilderAPI-v60,代码行数:10,代码来源:BaseResourceTest.php

示例12: clear

 /**
  * Clears the session, the session id, and renews the session.
  *
  * @return void
  */
 public static function clear()
 {
     $_SESSION = null;
     static::$id = null;
     static::renew();
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:11,代码来源:Session.php

示例13: destroy

 public static function destroy()
 {
     $_SESSION = array();
     session_destroy();
     static::$id = null;
 }
开发者ID:tak-msk,项目名称:Recru_teaser,代码行数:6,代码来源:session.php

示例14: registerApp

 /**
  * Register app service and singleton containers that bound with current app ID.
  * Exit application if empty ID provided.
  *
  * @param  mixed $config
  * @param  mixed $id
  * @return mixed
  */
 protected function registerApp($config, $id)
 {
     if (empty(trim($id))) {
         exit('App ID must not be empty!');
     }
     $this->config = $config;
     static::$id = $id;
     if (!isset(static::$services[$id])) {
         static::$services[$id] = [];
     }
     if (!isset(static::$singletons[$id])) {
         static::$singletons[$id] = [];
     }
     if (!isset(static::$apps[$id])) {
         static::$apps[$id] = $this;
     }
     return static::$apps[$id];
 }
开发者ID:borisding,项目名称:avenue,代码行数:26,代码来源:App.php

示例15: setUniqueIdentifier

 /**
  * Authentication classes should call this method
  *
  * @param string $id user id as identified by the authentication classes
  *
  * @return void
  */
 public static function setUniqueIdentifier($id)
 {
     static::$id = $id;
 }
开发者ID:tootutor,项目名称:tto-api,代码行数:11,代码来源:User.php


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