summaryrefslogtreecommitdiffstats
path: root/wp-inst
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-20 13:37:07 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-20 13:37:07 +0000
commit86ab51ee33b0aa1a8e61a4e1198f0d2aeeb33ef3 (patch)
treed74ca8508a0e8ec0aac79c8192a2768cdd769a00 /wp-inst
parentbf77b974fae94368e16f247a6e957523ba43dc4a (diff)
downloadwordpress-mu-86ab51ee33b0aa1a8e61a4e1198f0d2aeeb33ef3.tar.gz
wordpress-mu-86ab51ee33b0aa1a8e61a4e1198f0d2aeeb33ef3.tar.xz
wordpress-mu-86ab51ee33b0aa1a8e61a4e1198f0d2aeeb33ef3.zip
Use Snoopy if fopen() won't open a remote url. Patch from #4 (Props fimion)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@581 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst')
-rw-r--r--wp-inst/wp-admin/admin.php13
-rw-r--r--wp-inst/wp-admin/wpmu-upgrade-site.php24
2 files changed, 27 insertions, 10 deletions
diff --git a/wp-inst/wp-admin/admin.php b/wp-inst/wp-admin/admin.php
index 9cd20c4..ffec08f 100644
--- a/wp-inst/wp-admin/admin.php
+++ b/wp-inst/wp-admin/admin.php
@@ -4,8 +4,17 @@ if ( defined('ABSPATH') )
else
require_once('../wp-config.php');
-if ( get_option('db_version') != $wp_db_version )
- $out = @file( get_option( "siteurl" ) . "/wp-admin/upgrade.php?step=1" ); // upgrade the db!
+if ( get_option('db_version') != $wp_db_version ) {
+ $http_fopen = ini_get("allow_url_fopen");
+ if($http_fopen) {
+ $out = @file( get_option( "siteurl" ) . "/wp-admin/upgrade.php?step=1" ); // upgrade the db!
+ } else {
+ require_once('../wp-includes/class-snoopy.php');
+ $client = new Snoopy();
+ @$client->fetch( get_option( "siteurl" ) . "wp-admin/upgrade.php?step=1");
+ }
+}
+
require_once(ABSPATH . 'wp-admin/admin-functions.php');
require_once(ABSPATH . 'wp-admin/admin-db.php');
diff --git a/wp-inst/wp-admin/wpmu-upgrade-site.php b/wp-inst/wp-admin/wpmu-upgrade-site.php
index ae709a7..284b9ca 100644
--- a/wp-inst/wp-admin/wpmu-upgrade-site.php
+++ b/wp-inst/wp-admin/wpmu-upgrade-site.php
@@ -1,6 +1,9 @@
<?php
require_once('admin.php');
+$http_fopen = ini_get("allow_url_fopen");
+if(!$http_fopen) require_once('../wp-includes/class-snoopy.php');
+
$title = __('WPMU Admin');
$parent_file = 'wpmu-admin.php';
require_once('admin-header.php');
@@ -20,21 +23,26 @@ switch( $_GET[ 'action' ] ) {
}
$blogs = $wpdb->get_results( "SELECT * FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT $n, 5", ARRAY_A );
if( is_array( $blogs ) ) {
+ print "<ul>";
foreach( $blogs as $details ) {
if( $details[ 'spam' ] == 0 && $details[ 'deleted' ] == 0 && $details[ 'archived' ] == 0 ) {
$siteurl = $wpdb->get_var( "SELECT option_value from {$wpmuBaseTablePrefix}{$details[ 'blog_id' ]}_options WHERE option_name = 'siteurl'" );
- print "$siteurl<br>";
- $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" );
- if( $fp ) {
- while( feof( $fp ) == false ) {
- fgets($fp, 4096);
+ print "<li>$siteurl</li>";
+ if($http_fopen) {
+ $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" );
+ if( $fp ) {
+ while( feof( $fp ) == false ) {
+ fgets($fp, 4096);
+ }
+ fclose( $fp );
}
- fclose( $fp );
+ } else {
+ $client = new Snoopy();
+ @$client->fetch($siteurl . "wp-admin/upgrade.php?step=1");
}
- } else {
- print "Not upgrading: {$details[ 'domain' ]}<br>";
}
}
+ print "</ul>";
?>
<p>If your browser doesn't start loading the next page automatically click this link: <a href="?action=upgrade&n=<?php echo ($n + 5) ?>">Next Blogs</a> </p>
<script language='javascript'>