1
0

github mirror

This commit is contained in:
Garvin Hicking
2011-12-13 13:56:46 +01:00
parent b52af01444
commit 1bce14a668
2 changed files with 11 additions and 4 deletions

View File

@@ -4,6 +4,8 @@
Version 1.7 () Version 1.7 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Made Spartacus recognize github.com mirror (garvinhicking)
* Add "Summary" output to title of summary archive pages, patch by * Add "Summary" output to title of summary archive pages, patch by
hboeck hboeck

View File

@@ -100,7 +100,7 @@ class serendipity_event_spartacus extends serendipity_event
'xml' => array( 'xml' => array(
'http://netmirror.org/mirror/serendipity/', 'http://netmirror.org/mirror/serendipity/',
'http://s9y.org/mirror/', 'http://s9y.org/mirror/',
'https://raw.github.com/s9y/additional_plugins/', 'https://raw.github.com/s9y/additional_plugins/master/',
// 'http://openmirror.org/pub/s9y/', // 'http://openmirror.org/pub/s9y/',
), ),
@@ -370,8 +370,8 @@ class serendipity_event_spartacus extends serendipity_event
static $error = false; static $error = false;
// Fix double URL strings. // Fix double URL strings.
$url = str_replace('http:/', 'http://', str_replace('//', '/', $url)); $url = preg_replace('@http(s)?:/@i', 'http\1://', str_replace('//', '/', $url));
// --JAM: Get the URL's IP in the most error-free way possible // --JAM: Get the URL's IP in the most error-free way possible
$url_parts = @parse_url($url); $url_parts = @parse_url($url);
$url_hostname = 'localhost'; $url_hostname = 'localhost';
@@ -879,6 +879,7 @@ class serendipity_event_spartacus extends serendipity_event
function download(&$tree, $plugin_to_install, $sub = 'plugins') { function download(&$tree, $plugin_to_install, $sub = 'plugins') {
global $serendipity; global $serendipity;
$gitloc = '';
switch($sub) { switch($sub) {
case 'plugins': case 'plugins':
default: default:
@@ -946,9 +947,13 @@ class serendipity_event_spartacus extends serendipity_event
$servers = explode('|', $custom); $servers = explode('|', $custom);
$mirror = $servers[0]; $mirror = $servers[0];
} }
if (stristr($mirror, 'github.com')) {
$gitloc = 'master/';
}
foreach($files AS $file) { foreach($files AS $file) {
$url = $mirror . '/' . $sfloc . '/' . $file . '?revision=1.9999'; $url = $mirror . '/' . $sfloc . '/' . $gitloc . $file . '?revision=1.9999';
$target = $pdir . $file; $target = $pdir . $file;
$this->rmkdir($pdir . $plugin_to_install,$sub); $this->rmkdir($pdir . $plugin_to_install,$sub);
$this->fileperm($pdir . $plugin_to_install, true); $this->fileperm($pdir . $plugin_to_install, true);