Changeset 186967
- Timestamp:
- 12/25/2009 04:55:52 AM (16 years ago)
- Location:
- free-cdn
- Files:
-
- 8 added
- 2 edited
-
tags/1.1.2 (added)
-
tags/1.1.2/admin.js (added)
-
tags/1.1.2/free_cdn.php (added)
-
tags/1.1.2/readme.txt (added)
-
tags/1.1.2/screenshot-1.png (added)
-
tags/1.1.2/screenshot-2.png (added)
-
tags/1.1.2/simple_html_dom.php (added)
-
tags/1.1.2/uninstall.php (added)
-
trunk/free_cdn.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
free-cdn/trunk/free_cdn.php
r180166 r186967 4 4 Plugin URI: http://www.phoenixheart.net/wp-plugins/free-cdn 5 5 Description: This plugin rewrites your static files' URL's (JavaScripts, CSS, images etc.) so that they are served from <a href="http://www.coralcdn.org/">CoralCDN</a> - a free P2P Content Delivery Network - instead of your own server, thus saves lots of bandwidth and improves availability. REQUIRES PHP >= 5 6 Version: 1.1. 16 Version: 1.1.2 7 7 Author: Phoenixheart 8 8 Author URI: http://www.phoenixheart.net … … 14 14 { 15 15 var $name = 'free-cdn'; 16 var $version = '1.0. 0';16 var $version = '1.0.2'; 17 17 var $default_options = array( 18 'version' => '1.0. 1',18 'version' => '1.0.2', 19 19 'apply' => array( 20 20 'css' => true, … … 278 278 { 279 279 // a candidate to rewrite 280 $current_domain = $this->get_url_domain($rewritten_url); 281 list($domain, $rest) = explode($current_domain, $rewritten_url, 2); 280 $parts = parse_url($rewritten_url); 281 282 if (isset($parts['port'])) 283 { 284 $parts['host'] .= ".$parts[port].nyud.net"; 285 unset($parts['port']); 286 } 287 else 288 { 289 $parts['host'] .= '.nyud.net'; 290 } 282 291 283 $rewritten_url = "$current_domain.nyud.net$rest"; 292 $rewritten_url = $this->glue_url($parts); 293 284 294 if ($this->options['debug']) 285 295 { … … 294 304 295 305 return $original_url; // the url is not a candidate 296 }297 298 /**299 * @desc Gets the domain (http://www.example.com)300 * from an url (http:///www.example.com/dir/file.html?q)301 */302 function get_url_domain($url)303 {304 $parts = parse_url($url);305 return $parts['scheme'] . '://' . $parts['host'];306 306 } 307 307 … … 357 357 return $url; 358 358 } 359 360 /** 361 * @author ilja at radusch dot com 362 * @param mixed $parsed 363 */ 364 function glue_url($parsed) 365 { 366 if (!is_array($parsed)) 367 { 368 return false; 369 } 370 371 $uri = isset($parsed['scheme']) ? $parsed['scheme'].':'.((strtolower($parsed['scheme']) == 'mailto') ? '' : '//') : ''; 372 $uri .= isset($parsed['user']) ? $parsed['user'].(isset($parsed['pass']) ? ':'.$parsed['pass'] : '').'@' : ''; 373 $uri .= isset($parsed['host']) ? $parsed['host'] : ''; 374 $uri .= isset($parsed['port']) ? ':'.$parsed['port'] : ''; 375 376 if (isset($parsed['path'])) 377 { 378 $uri .= (substr($parsed['path'], 0, 1) == '/') ? 379 $parsed['path'] : ((!empty($uri) ? '/' : '' ) . $parsed['path']); 380 } 381 382 $uri .= isset($parsed['query']) ? '?'.$parsed['query'] : ''; 383 $uri .= isset($parsed['fragment']) ? '#'.$parsed['fragment'] : ''; 384 385 return $uri; 386 } 359 387 360 388 /** -
free-cdn/trunk/readme.txt
r180166 r186967 5 5 Requires at least: 2.2 6 6 Tested up to: 3.0 7 Stable tag: 1.1. 17 Stable tag: 1.1.2
Note: See TracChangeset
for help on using the changeset viewer.