mirror of https://github.com/vtrois/kratos
fix: replace default github branch
parent
b0ae3c9491
commit
4a71ab3b10
|
@ -1,5 +1,5 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://raw.githubusercontent.com/vtrois/kratos/master/assets/img/options/about.png">
|
<img src="https://raw.githubusercontent.com/vtrois/kratos/main/assets/img/options/about.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
@ -189,11 +189,11 @@ Detailed changes for each release are documented in the [release notes](https://
|
||||||
If you find Kratos useful, you can buy us a cup of coffee
|
If you find Kratos useful, you can buy us a cup of coffee
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img width="700" src="https://raw.githubusercontent.com/vtrois/kratos/master/assets/img/options/donate.png">
|
<img width="700" src="https://raw.githubusercontent.com/vtrois/kratos/main/assets/img/options/donate.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The code is available under the [MIT](https://github.com/vtrois/kratos/blob/master/LICENSE) license.
|
The code is available under the [MIT](https://github.com/vtrois/kratos/blob/main/LICENSE) license.
|
||||||
|
|
||||||
The document is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](http://creativecommons.org/licenses/by-nc-nd/4.0/).
|
The document is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](http://creativecommons.org/licenses/by-nc-nd/4.0/).
|
||||||
|
|
|
@ -246,7 +246,7 @@ class Options_Framework_Interface
|
||||||
<h4>' . __('讨论交流', 'kratos') . '</h4>
|
<h4>' . __('讨论交流', 'kratos') . '</h4>
|
||||||
<img src="' . ASSET_PATH . '/assets/img/options/discuss.png">
|
<img src="' . ASSET_PATH . '/assets/img/options/discuss.png">
|
||||||
<h4>' . __('版权声明', 'kratos') . '</h4>
|
<h4>' . __('版权声明', 'kratos') . '</h4>
|
||||||
<p>' . __('主题源码使用 <a href="https://github.com/vtrois/kratos/blob/master/LICENSE" target="_blank">MIT 协议</a> 进行许可,说明文档使用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a> 进行许可。', 'kratos') . '</p>
|
<p>' . __('主题源码使用 <a href="https://github.com/vtrois/kratos/blob/main/LICENSE" target="_blank">MIT 协议</a> 进行许可,说明文档使用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a> 进行许可。', 'kratos') . '</p>
|
||||||
<h4>' . __('打赏支持', 'kratos') . '</h4>
|
<h4>' . __('打赏支持', 'kratos') . '</h4>
|
||||||
<img src="' . ASSET_PATH . '/assets/img/options/donate.png">
|
<img src="' . ASSET_PATH . '/assets/img/options/donate.png">
|
||||||
</div>';
|
</div>';
|
||||||
|
|
|
@ -59,7 +59,7 @@ if ( !class_exists('Puc_v4p9_Vcs_Api') ):
|
||||||
* @param string $ref Tag or branch name.
|
* @param string $ref Tag or branch name.
|
||||||
* @return array Parsed readme.
|
* @return array Parsed readme.
|
||||||
*/
|
*/
|
||||||
public function getRemoteReadme($ref = 'master') {
|
public function getRemoteReadme($ref = 'main') {
|
||||||
$fileContents = $this->getRemoteFile($this->getLocalReadmeName(), $ref);
|
$fileContents = $this->getRemoteFile($this->getLocalReadmeName(), $ref);
|
||||||
if ( empty($fileContents) ) {
|
if ( empty($fileContents) ) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -196,7 +196,7 @@ if ( !class_exists('Puc_v4p9_Vcs_Api') ):
|
||||||
* @param string $ref
|
* @param string $ref
|
||||||
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
||||||
*/
|
*/
|
||||||
abstract public function getRemoteFile($path, $ref = 'master');
|
abstract public function getRemoteFile($path, $ref = 'main');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the timestamp of the latest commit that changed the specified branch or tag.
|
* Get the timestamp of the latest commit that changed the specified branch or tag.
|
||||||
|
|
|
@ -3,7 +3,7 @@ if ( !interface_exists('Puc_v4p9_Vcs_BaseChecker', false) ):
|
||||||
|
|
||||||
interface Puc_v4p9_Vcs_BaseChecker {
|
interface Puc_v4p9_Vcs_BaseChecker {
|
||||||
/**
|
/**
|
||||||
* Set the repository branch to use for updates. Defaults to 'master'.
|
* Set the repository branch to use for updates. Defaults to 'main'.
|
||||||
*
|
*
|
||||||
* @param string $branch
|
* @param string $branch
|
||||||
* @return $this
|
* @return $this
|
||||||
|
|
|
@ -42,7 +42,7 @@ if ( !class_exists('Puc_v4p9_Vcs_BitBucketApi', false) ):
|
||||||
$updateSource = $this->getStableTag($configBranch);
|
$updateSource = $this->getStableTag($configBranch);
|
||||||
|
|
||||||
//Look for version-like tags.
|
//Look for version-like tags.
|
||||||
if ( !$updateSource && ($configBranch === 'master') ) {
|
if ( !$updateSource && ($configBranch === 'main') ) {
|
||||||
$updateSource = $this->getLatestTag();
|
$updateSource = $this->getLatestTag();
|
||||||
}
|
}
|
||||||
//If all else fails, use the specified branch itself.
|
//If all else fails, use the specified branch itself.
|
||||||
|
@ -156,7 +156,7 @@ if ( !class_exists('Puc_v4p9_Vcs_BitBucketApi', false) ):
|
||||||
* @param string $ref
|
* @param string $ref
|
||||||
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
||||||
*/
|
*/
|
||||||
public function getRemoteFile($path, $ref = 'master') {
|
public function getRemoteFile($path, $ref = 'main') {
|
||||||
$response = $this->api('src/' . $ref . '/' . ltrim($path));
|
$response = $this->api('src/' . $ref . '/' . ltrim($path));
|
||||||
if ( is_wp_error($response) || !is_string($response) ) {
|
if ( is_wp_error($response) || !is_string($response) ) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -164,7 +164,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
|
||||||
* @param string $ref Reference name (e.g. branch or tag).
|
* @param string $ref Reference name (e.g. branch or tag).
|
||||||
* @return StdClass|null
|
* @return StdClass|null
|
||||||
*/
|
*/
|
||||||
public function getLatestCommit($filename, $ref = 'master') {
|
public function getLatestCommit($filename, $ref = 'main') {
|
||||||
$commits = $this->api(
|
$commits = $this->api(
|
||||||
'/repos/:user/:repo/commits',
|
'/repos/:user/:repo/commits',
|
||||||
array(
|
array(
|
||||||
|
@ -264,7 +264,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
|
||||||
* @param string $ref
|
* @param string $ref
|
||||||
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
||||||
*/
|
*/
|
||||||
public function getRemoteFile($path, $ref = 'master') {
|
public function getRemoteFile($path, $ref = 'main') {
|
||||||
$apiUrl = '/repos/:user/:repo/contents/' . $path;
|
$apiUrl = '/repos/:user/:repo/contents/' . $path;
|
||||||
$response = $this->api($apiUrl, array('ref' => $ref));
|
$response = $this->api($apiUrl, array('ref' => $ref));
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
|
||||||
* @param string $ref
|
* @param string $ref
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function buildArchiveDownloadUrl($ref = 'master') {
|
public function buildArchiveDownloadUrl($ref = 'main') {
|
||||||
$url = sprintf(
|
$url = sprintf(
|
||||||
'https://api.github.com/repos/%1$s/%2$s/zipball/%3$s',
|
'https://api.github.com/repos/%1$s/%2$s/zipball/%3$s',
|
||||||
urlencode($this->userName),
|
urlencode($this->userName),
|
||||||
|
@ -319,7 +319,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
|
||||||
public function chooseReference($configBranch) {
|
public function chooseReference($configBranch) {
|
||||||
$updateSource = null;
|
$updateSource = null;
|
||||||
|
|
||||||
if ( $configBranch === 'master' ) {
|
if ( $configBranch === 'main' ) {
|
||||||
//Use the latest release.
|
//Use the latest release.
|
||||||
$updateSource = $this->getLatestRelease();
|
$updateSource = $this->getLatestRelease();
|
||||||
if ( $updateSource === null ) {
|
if ( $updateSource === null ) {
|
||||||
|
|
|
@ -238,7 +238,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitLabApi', false) ):
|
||||||
* @param string $ref
|
* @param string $ref
|
||||||
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
|
||||||
*/
|
*/
|
||||||
public function getRemoteFile($path, $ref = 'master') {
|
public function getRemoteFile($path, $ref = 'main') {
|
||||||
$response = $this->api('/:id/repository/files/' . $path, array('ref' => $ref));
|
$response = $this->api('/:id/repository/files/' . $path, array('ref' => $ref));
|
||||||
if ( is_wp_error($response) || !isset($response->content) || $response->encoding !== 'base64' ) {
|
if ( is_wp_error($response) || !isset($response->content) || $response->encoding !== 'base64' ) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -253,7 +253,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitLabApi', false) ):
|
||||||
* @param string $ref
|
* @param string $ref
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function buildArchiveDownloadUrl($ref = 'master') {
|
public function buildArchiveDownloadUrl($ref = 'main') {
|
||||||
$url = sprintf(
|
$url = sprintf(
|
||||||
'%1$s://%2$s/api/v4/projects/%3$s/repository/archive.zip',
|
'%1$s://%2$s/api/v4/projects/%3$s/repository/archive.zip',
|
||||||
$this->repositoryProtocol,
|
$this->repositoryProtocol,
|
||||||
|
@ -289,7 +289,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitLabApi', false) ):
|
||||||
$updateSource = null;
|
$updateSource = null;
|
||||||
|
|
||||||
// GitLab doesn't handle releases the same as GitHub so just use the latest tag
|
// GitLab doesn't handle releases the same as GitHub so just use the latest tag
|
||||||
if ( $configBranch === 'master' ) {
|
if ( $configBranch === 'main' ) {
|
||||||
$updateSource = $this->getLatestTag();
|
$updateSource = $this->getLatestTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ if ( !class_exists('Puc_v4p9_Vcs_PluginUpdateChecker') ):
|
||||||
|
|
||||||
class Puc_v4p9_Vcs_PluginUpdateChecker extends Puc_v4p9_Plugin_UpdateChecker implements Puc_v4p9_Vcs_BaseChecker {
|
class Puc_v4p9_Vcs_PluginUpdateChecker extends Puc_v4p9_Plugin_UpdateChecker implements Puc_v4p9_Vcs_BaseChecker {
|
||||||
/**
|
/**
|
||||||
* @var string The branch where to look for updates. Defaults to "master".
|
* @var string The branch where to look for updates. Defaults to "main".
|
||||||
*/
|
*/
|
||||||
protected $branch = 'master';
|
protected $branch = 'main';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Puc_v4p9_Vcs_Api Repository API client.
|
* @var Puc_v4p9_Vcs_Api Repository API client.
|
||||||
|
|
|
@ -4,9 +4,9 @@ if ( !class_exists('Puc_v4p9_Vcs_ThemeUpdateChecker', false) ):
|
||||||
|
|
||||||
class Puc_v4p9_Vcs_ThemeUpdateChecker extends Puc_v4p9_Theme_UpdateChecker implements Puc_v4p9_Vcs_BaseChecker {
|
class Puc_v4p9_Vcs_ThemeUpdateChecker extends Puc_v4p9_Theme_UpdateChecker implements Puc_v4p9_Vcs_BaseChecker {
|
||||||
/**
|
/**
|
||||||
* @var string The branch where to look for updates. Defaults to "master".
|
* @var string The branch where to look for updates. Defaults to "main".
|
||||||
*/
|
*/
|
||||||
protected $branch = 'master';
|
protected $branch = 'main';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Puc_v4p9_Vcs_Api Repository API client.
|
* @var Puc_v4p9_Vcs_Api Repository API client.
|
||||||
|
|
|
@ -3,7 +3,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||||
"Project-Id-Version: Kratos\n"
|
"Project-Id-Version: Kratos\n"
|
||||||
"POT-Creation-Date: 2020-09-30 18:27+0800\n"
|
"POT-Creation-Date: 2020-10-04 12:12+0800\n"
|
||||||
"PO-Revision-Date: 2020-02-14 23:32+0800\n"
|
"PO-Revision-Date: 2020-02-14 23:32+0800\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -181,7 +181,7 @@ msgstr ""
|
||||||
|
|
||||||
#: inc/options-framework/includes/class-options-interface.php:249
|
#: inc/options-framework/includes/class-options-interface.php:249
|
||||||
msgid ""
|
msgid ""
|
||||||
"主题源码使用 <a href=\"https://github.com/vtrois/kratos/blob/master/LICENSE"
|
"主题源码使用 <a href=\"https://github.com/vtrois/kratos/blob/main/LICENSE"
|
||||||
"\" target=\"_blank\">MIT 协议</a> 进行许可,说明文档使用 <a href=\"https://"
|
"\" target=\"_blank\">MIT 协议</a> 进行许可,说明文档使用 <a href=\"https://"
|
||||||
"creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC BY-NC-ND "
|
"creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC BY-NC-ND "
|
||||||
"4.0</a> 进行许可。"
|
"4.0</a> 进行许可。"
|
||||||
|
|
|
@ -9,5 +9,5 @@ Author: Seaton Jiang
|
||||||
Author URI: https://www.vtrois.com/
|
Author URI: https://www.vtrois.com/
|
||||||
Theme URI: https://github.com/vtrois/kratos
|
Theme URI: https://github.com/vtrois/kratos
|
||||||
License: MIT License
|
License: MIT License
|
||||||
License URI: https://github.com/vtrois/kratos/blob/master/LICENSE
|
License URI: https://github.com/vtrois/kratos/blob/main/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue