-
-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,59 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: afragen | ||
* Date: 9/12/16 | ||
* Time: 4:12 PM | ||
* GitHub Updater | ||
* | ||
* @package GitHub_Updater | ||
* @author Andy Fragen | ||
* @license GPL-2.0+ | ||
* @link https://github.com/afragen/github-updater | ||
*/ | ||
|
||
namespace Fragen\GitHub_Updater; | ||
|
||
|
||
/** | ||
* Class Language_Pack | ||
* | ||
* @package Fragen\GitHub_Updater | ||
*/ | ||
class Language_Pack extends Base { | ||
|
||
/** | ||
* Variable containing the plugin/theme object. | ||
* | ||
* @var object | ||
*/ | ||
protected $repo; | ||
|
||
/** | ||
* Variable containing the git host API object. | ||
* | ||
* @var | ||
*/ | ||
protected $repo_api; | ||
|
||
/** | ||
* Language_Pack constructor. | ||
* | ||
* @param object $repo Plugin/Theme object. | ||
* @param object $api Git host API object. | ||
*/ | ||
public function __construct( $repo, $api ) { | ||
if ( empty( $repo->languages) ) { | ||
if ( empty( $repo->languages ) ) { | ||
return false; | ||
} | ||
|
||
$this->repo = $repo; | ||
$this->repo = $repo; | ||
$this->repo_api = $api; | ||
$this->run(); | ||
} | ||
|
||
/** | ||
* Do the Language Pack integration. | ||
*/ | ||
protected function run() { | ||
$headers = $this->parse_header_uri( $this->repo->languages ); | ||
$this->repo_api->get_language_pack( $headers); | ||
$this->repo_api->get_language_pack( $headers ); | ||
} | ||
|
||
} |