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


PHP self::init方法代码示例

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


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

示例1: create

 /**
  * Static constructor.
  *
  * @param MiniGameId    $gameId
  * @param PlayerId      $playerId
  * @param PlayerOptions $playerOptions
  * @param Context       $context
  *
  * @return JoinGameCommand
  */
 public static function create(MiniGameId $gameId, PlayerId $playerId, PlayerOptions $playerOptions, Context $context = null)
 {
     $obj = new self();
     $obj->init($gameId, $playerId, $context);
     $obj->playerOptions = $playerOptions;
     return $obj;
 }
开发者ID:remi-san,项目名称:mini-game-app,代码行数:17,代码来源:JoinGameCommand.php

示例2: getConfig

 /**
  * Get an instance of the columnconfig class.
  *
  * @param Node $node
  * @param string $id
  * @param bool $forceNew force new instance?
  *
  * @return ColumnConfig An instance of the columnconfig class
  */
 public static function getConfig($node, $id = null, $forceNew = false)
 {
     static $s_instances = [];
     $sm = SessionManager::getInstance();
     if ($id == null) {
         $id = $node->atkNodeUri();
     }
     if (!isset($s_instances[$id]) || $forceNew) {
         $cc = new self();
         $s_instances[$id] = $cc;
         $cc->setNode($node);
         $colcfg = $sm != null ? $sm->pageVar('atkcolcfg_' . $id) : null;
         if (!is_array($colcfg) || $forceNew) {
             // create new
             Tools::atkdebug('New colconfig initialising');
             $cc->init();
         } else {
             // inherit old config from session.
             Tools::atkdebug('Resuming colconfig from session');
             $cc->m_colcfg =& $colcfg;
         }
         // See if there are any url params which influence this colcfg.
         $cc->doUrlCommands();
     }
     if ($sm != null) {
         $sm->pageVar('atkcolcfg_' . $id, $s_instances[$id]->m_colcfg);
     }
     return $s_instances[$id];
 }
开发者ID:sintattica,项目名称:atk,代码行数:38,代码来源:ColumnConfig.php

示例3: create

 /**
  * Static constructor.
  *
  * @param TwitterMessageId   $id
  * @param TwitterUser        $recipient
  * @param TwitterUser        $sender
  * @param string             $text
  * @param \DateTimeInterface $createdAt
  * @param TwitterEntities    $entities
  *
  * @return TwitterDirectMessage
  */
 public static function create(TwitterMessageId $id, TwitterUser $sender, TwitterUser $recipient, $text, \DateTimeInterface $createdAt, TwitterEntities $entities)
 {
     $obj = new self();
     $obj->init($id, $sender, $text, $entities, $createdAt);
     $obj->recipient = $recipient;
     return $obj;
 }
开发者ID:remi-san,项目名称:twitter,代码行数:19,代码来源:TwitterDirectMessage.php

示例4: quickStart

 public static function quickStart()
 {
     $Loader = new self();
     $Loader->init();
     $Loader->display();
     return $Loader;
 }
开发者ID:johnstyle,项目名称:sjo,代码行数:7,代码来源:Loader.php

示例5: create

 /**
  * Construct
  *
  * @param MiniGameId  $id
  * @param PlayerId    $playerId
  * @param GameOptions $options
  * @param Context     $origin
  *
  * @return CreateGameCommand
  */
 public static function create(MiniGameId $id, PlayerId $playerId, GameOptions $options = null, Context $origin = null)
 {
     $obj = new self();
     $obj->init($id, $playerId, $origin);
     $obj->options = $options;
     return $obj;
 }
开发者ID:remi-san,项目名称:mini-game-app,代码行数:17,代码来源:CreateGameCommand.php

示例6: build

 /**
  * Build a migration file using a given table.
  *
  * @param Table $table
  * @return mixed
  */
 public static function build(Table $table)
 {
     $squasher = new self($table);
     $squasher->content = $squasher->init();
     $squasher->fillInTableData();
     $squasher->content .= $squasher->close();
     return str_replace("\n", PHP_EOL, $squasher->content);
 }
开发者ID:orottier,项目名称:laravel-migration-squasher,代码行数:14,代码来源:TableBuilder.php

示例7: create

 /**
  *
  * @param string $action
  * @param \CourseDescription\CourseDescription $description
  * @return \CourseDescription\CourseDescription 
  */
 static function create($action, $description = null)
 {
     $result = new self('course_description', 'post', $action);
     if ($description) {
         $result->init($description);
     }
     return $result;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:14,代码来源:course_description_form.class.php

示例8: create

 /**
  *
  * @param string $action
  * @param \Glossary\Glossary $item
  * @return \Glossary\GlossaryForm 
  */
 static function create($action, $item = null)
 {
     $result = new self('glossary', 'post', $action);
     if ($item) {
         $result->init($item);
     }
     return $result;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:14,代码来源:glossary_form.class.php

示例9: create

 /**
  * Constructor
  *
  * @param PlayerId   $playerId
  * @param MiniGameId $gameId
  * @param string     $name
  * @param int        $lives
  * @param string     $externalReference
  *
  * @return HangmanPlayerOptions
  */
 public static function create(PlayerId $playerId, MiniGameId $gameId, $name, $lives, $externalReference = null)
 {
     $obj = new self();
     $obj->init($playerId, $gameId, $name);
     $obj->lives = $lives;
     $obj->externalReference = $externalReference;
     return $obj;
 }
开发者ID:remi-san,项目名称:hangman,代码行数:19,代码来源:HangmanPlayerOptions.php

示例10: staticInit

	/**
	 * No LSB in pre-5.3 PHP, to be refactored later
	 */	
	public static function staticInit( Parser &$parser ) {
		global $egParserFunEnabledFunctions;
		if( in_array( 'parse', $egParserFunEnabledFunctions ) ) {
			// only register function if not disabled by configuration
			$instance = new self;
			$instance->init( $parser );
		}
		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:12,代码来源:PFun_Parse.php

示例11: getInstance

 public static function getInstance(array $config)
 {
     if (self::$_instance === null) {
         $instance = new self();
         $instance->init($config);
         self::$_instance = $instance;
     }
     return self::$_instance;
 }
开发者ID:sarwarzahan,项目名称:multi-logging,代码行数:9,代码来源:LogService.php

示例12: get_instance

 /**
  * Singleton class instance
  * @return Login_Counter
  */
 public static function get_instance()
 {
     static $instance;
     if (!isset($instance)) {
         $instance = new self();
         $instance->init();
     }
     return $instance;
 }
开发者ID:spyre,项目名称:emiral,代码行数:13,代码来源:wordpress-login-count.php

示例13: getInstance

 /**
  * 获取一个Cache_Memcache实例
  *
  * @param integer $clusterId cluster id
  * @return object
  */
 public static function getInstance($config_name = 'DefaultMemcacheServers')
 {
     if (empty(self::$_objList[$config_name])) {
         $obj = new self($config_name);
         $obj->init();
         self::$_objList[$config_name] =& $obj;
     }
     return self::$_objList[$config_name];
 }
开发者ID:godruoyi,项目名称:portal,代码行数:15,代码来源:Memcached.class.php

示例14: from

 public static function from($params = array())
 {
     $client = new self();
     foreach ($params as $key => $val) {
         $client->{$key} = $val;
     }
     $client->init();
     return $client;
 }
开发者ID:urmaul,项目名称:httpclient,代码行数:9,代码来源:HttpClient.php

示例15: instance

 /**
  * Instance factory
  *
  * @since 1.0.0
  */
 public static function instance()
 {
     static $instance = null;
     if (null === $instance) {
         $instance = new self();
         $instance->init();
         $instance->setup_actions();
     }
     return $instance;
 }
开发者ID:ka215,项目名称:custom-sticky-notes,代码行数:15,代码来源:custom-sticky-notes.php


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