AAAAhome/academiac/www/libraries/joomla/github/github.php000064400000006512151375321410016727 0ustar00options = isset($options) ? $options : new JRegistry; $this->client = isset($client) ? $client : new JGithubHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'https://api.github.com'); } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JGithubObject GitHub API object (gists, issues, pulls, etc). * * @since 11.3 */ public function __get($name) { if ($name == 'gists') { if ($this->gists == null) { $this->gists = new JGithubGists($this->options, $this->client); } return $this->gists; } if ($name == 'issues') { if ($this->issues == null) { $this->issues = new JGithubIssues($this->options, $this->client); } return $this->issues; } if ($name == 'pulls') { if ($this->pulls == null) { $this->pulls = new JGithubPulls($this->options, $this->client); } return $this->pulls; } if ($name == 'refs') { if ($this->refs == null) { $this->refs = new JGithubRefs($this->options, $this->client); } return $this->refs; } if ($name == 'forks') { if ($this->forks == null) { $this->forks = new JGithubForks($this->options, $this->client); } return $this->forks; } } /** * Get an option from the JGitHub instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 11.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JGitHub instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JGitHub This object for method chaining. * * @since 11.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } }