Cheetah
FacebookApp.php
Go to the documentation of this file.
1 <?php
24 namespace Facebook;
25 
28 
29 class FacebookApp implements \Serializable
30 {
34  protected $id;
35 
39  protected $secret;
40 
47  public function __construct($id, $secret)
48  {
49  if (!is_string($id)
50  // Keeping this for BC. Integers greater than PHP_INT_MAX will make is_int() return false
51  && !is_int($id)) {
52  throw new FacebookSDKException('The "app_id" must be formatted as a string since many app ID\'s are greater than PHP_INT_MAX on some systems.');
53  }
54  // We cast as a string in case a valid int was set on a 64-bit system and this is unserialised on a 32-bit system
55  $this->id = (string) $id;
56  $this->secret = $secret;
57  }
58 
64  public function getId()
65  {
66  return $this->id;
67  }
68 
74  public function getSecret()
75  {
76  return $this->secret;
77  }
78 
84  public function getAccessToken()
85  {
86  return new AccessToken($this->id . '|' . $this->secret);
87  }
88 
94  public function serialize()
95  {
96  return implode('|', [$this->id, $this->secret]);
97  }
98 
104  public function unserialize($serialized)
105  {
106  list($id, $secret) = explode('|', $serialized);
107 
108  $this->__construct($id, $secret);
109  }
110 }
Facebook\FacebookApp\$id
$id
Definition: FacebookApp.php:34
Facebook\Exceptions\FacebookSDKException
Definition: FacebookSDKException.php:32
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
php
Facebook\FacebookApp\$secret
$secret
Definition: FacebookApp.php:39
Facebook\FacebookApp\unserialize
unserialize($serialized)
Definition: FacebookApp.php:104
Facebook\Authentication\AccessToken
Definition: AccessToken.php:32
Facebook\FacebookApp\getAccessToken
getAccessToken()
Definition: FacebookApp.php:84
Facebook\FacebookApp\getId
getId()
Definition: FacebookApp.php:64
Facebook\FacebookApp
Definition: FacebookApp.php:30
Facebook\FacebookApp\getSecret
getSecret()
Definition: FacebookApp.php:74
Facebook
Facebook\FacebookApp\__construct
__construct($id, $secret)
Definition: FacebookApp.php:47
Facebook\FacebookApp\serialize
serialize()
Definition: FacebookApp.php:94