Cheetah
PersistentDataFactory.php
Go to the documentation of this file.
1 <?php
24 namespace Facebook\PersistentData;
25 
26 use InvalidArgumentException;
27 
29 {
30  private function __construct()
31  {
32  // a factory constructor should never be invoked
33  }
34 
44  public static function createPersistentDataHandler($handler)
45  {
46  if (!$handler) {
47  return session_status() === PHP_SESSION_ACTIVE
50  }
51 
52  if ($handler instanceof PersistentDataInterface) {
53  return $handler;
54  }
55 
56  if ('session' === $handler) {
58  }
59  if ('memory' === $handler) {
61  }
62 
63  throw new InvalidArgumentException('The persistent data handler must be set to "session", "memory", or be an instance of Facebook\PersistentData\PersistentDataInterface');
64  }
65 }
use
GNU LESSER GENERAL PUBLIC LICENSE February Free Software Inc Franklin Fifth MA USA Everyone is permitted to copy and distribute verbatim copies of this license but changing it is not allowed[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it By the GNU General Public Licenses are intended to guarantee your freedom to share and change free software to make sure the software is free for all its users This the Lesser General Public applies to some specially designated software packages typically libraries of the Free Software Foundation and other authors who decide to use it You can use it but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular based on the explanations below When we speak of free we are referring to freedom of use
Definition: license.txt:27
Facebook\PersistentData\FacebookSessionPersistentDataHandler
Definition: FacebookSessionPersistentDataHandler.php:34
php
Facebook\PersistentData\PersistentDataFactory\createPersistentDataHandler
static createPersistentDataHandler($handler)
Definition: PersistentDataFactory.php:44
Facebook\PersistentData\PersistentDataInterface
Definition: PersistentDataInterface.php:32
Facebook\PersistentData
Definition: FacebookMemoryPersistentDataHandler.php:24
Facebook\PersistentData\PersistentDataFactory
Definition: PersistentDataFactory.php:29
Facebook\PersistentData\FacebookMemoryPersistentDataHandler
Definition: FacebookMemoryPersistentDataHandler.php:32