/pi.s3assets.php

https://github.com/joshjensen/s3assets · PHP · 620 lines · 440 code · 97 blank · 83 comment · 96 complexity · 6cbfcf269d382c7986cc82a487bdd5b2 MD5 · raw file

  1. <?php
  2. /*
  3. =====================================================
  4. s3assets
  5. by: Josh Jensen
  6. http://www.joshjensen.com/
  7. josh@trakdesign.com
  8. Copyright (c) 2010 Josh Jensen
  9. =============================================================
  10. THIS IS COPYRIGHTED SOFTWARE
  11. -------------------------------------------------------------
  12. YOU MAY NOT:
  13. Reproduce, distribute, or transfer the Software
  14. (this plugin), or portions thereof, to any third party.
  15. Sell, rent, lease, assign, or sublet the Software or
  16. portions thereof. Grant rights to any other person. Use
  17. the Software in violation of any U.S. or international
  18. law or regulation.
  19. YOU MAY:
  20. Alter, modify, or extend the Software for your own use,
  21. but you may not resell, redistribute or transfer the
  22. modified or derivative version without prior written
  23. consent from Joshua Jensen. Components from
  24. the Software may not be extracted and used in other
  25. programs without prior written consent from Joshua Jensen.
  26. -------------------------------------------------------------
  27. This software is based upon and derived from
  28. EllisLab ExpressionEngine software protected under
  29. copyright dated 2004 - 2010. Please see
  30. www.expressionengine.com/docs/license.html
  31. =============================================================
  32. File: pi.s3assets.php
  33. -------------------------------------------------------------
  34. Compatibility: ExpressionEngine 1.6+
  35. -------------------------------------------------------------
  36. Version: 0.3
  37. -------------------------------------------------------------
  38. Purpose: Asset Management
  39. =============================================================
  40. */
  41. $plugin_info = array(
  42. 'pi_name' => 's3assets',
  43. 'pi_version' => '0.3',
  44. 'pi_author' => 'Josh Jensen',
  45. 'pi_author_url' => 'http://www.joshjensen.com',
  46. 'pi_description' => 's3assets - Helps manage asset caching and storage on S3',
  47. 'pi_usage' => s3assets::usage()
  48. );
  49. class s3assets {
  50. var $return_data = "";
  51. function s3assets() {
  52. global $TMPL, $FNS, $PREFS, $REGX;
  53. //*******
  54. // Set Cache Base Location & Default File Locations
  55. //*******
  56. $cache_base = PATH_CACHE."s3assets_cache";
  57. if (array_key_exists('DOCUMENT_ROOT',$_ENV)) {
  58. $pathto_src = $_ENV['DOCUMENT_ROOT']."/";
  59. } else {
  60. $pathto_src = $_SERVER['DOCUMENT_ROOT']."/";
  61. }
  62. $pathto_src = str_replace("\\", "/", $pathto_src);
  63. $pathto_src = $FNS->remove_double_slashes($pathto_src);
  64. $src = ($TMPL->fetch_param('src')) ? $TMPL->fetch_param('src') : $TMPL->tagdata;
  65. $src = str_replace(SLASH, "/", $src);
  66. $full_src = $FNS->remove_double_slashes($pathto_src.$src);
  67. $cache_src = $FNS->remove_double_slashes($cache_base.$src);
  68. //*******
  69. // Fetch Inital Tag Params
  70. //*******
  71. $url_only = $TMPL->fetch_param('url_only');
  72. $s3bucket = $TMPL->fetch_param('s3bucket');
  73. $force = $TMPL->fetch_param('force');
  74. $cname = $TMPL->fetch_param('cname');
  75. $cnamemax = $TMPL->fetch_param('cnamemax');
  76. $s3assetsConfig = $PREFS->core_ini['s3assets'];
  77. $image_s3bucket = $TMPL->fetch_param('image_s3bucket');
  78. if ($TMPL->fetch_param('remote') == "yes") {$cache_src = $src;}
  79. //*******
  80. // Check to make sure the file is readable and exists.
  81. //*******
  82. if(!is_readable($full_src) && $force == ""){
  83. error_log('File '.$full_src.' does not exist');
  84. $TMPL->log_item("s3assets.Error: ".$full_src." image is not readable or does not exist");
  85. return $TMPL->no_results();
  86. }
  87. //*******
  88. // Get the last modified time on the file
  89. //*******
  90. $last_modified = @filemtime($full_src);
  91. $cache_last_modified = @filemtime($cache_src);
  92. //*******
  93. // Check Cache & Set Cache Flag if Needed
  94. //*******
  95. $cache_flag = FALSE;
  96. if (file_exists($cache_src) && $s3bucket != "") {
  97. if ($last_modified > $cache_last_modified) {
  98. $cache_flag = TRUE; // I have been modified
  99. }
  100. } else {
  101. $cache_flag = TRUE; // I dont exist
  102. }
  103. //*******
  104. // FOR DEBUGGING
  105. //*******
  106. if ($TMPL->fetch_param('debug') == "yes" || $s3assetsConfig['debugS3'] == "y") {
  107. $cache_flag = TRUE;
  108. error_log('DEBUG MODE ON - Page: '.getenv('REQUEST_URI').' | Resource: '.$src);
  109. }
  110. //*******
  111. // If I am forcing an item I want to strip out stuff that will trip s3
  112. //*******
  113. if ($force != "") {$src = str_replace("?", "", $src);}
  114. //*******
  115. // If there is no s3bucket or we are working locally just send the link along with the correct information.
  116. //*******
  117. if ($s3bucket != "" && $s3assetsConfig['environment'] == "production") {
  118. if ($cname == "" || $cnamemax == "") {
  119. $asset_url = 'http://'.$s3bucket.'.s3.amazonaws.com'.$src.'?'.$cache_last_modified;
  120. } else {
  121. // Setup CNAME for asset domain spanning.
  122. $rand_number = rand(0, $cnamemax);
  123. $cname = str_replace("$1", $rand_number, $cname);
  124. $asset_url = 'http://'.$cname.$src.'?'.$cache_last_modified;
  125. }
  126. } else {
  127. $asset_url = $src.'?'.$last_modified;
  128. }
  129. //*******
  130. // Set params for use in functions
  131. //*******
  132. $params = array(
  133. 'src' => $src,
  134. 'pathto_src' => $pathto_src,
  135. 'full_src' => $full_src,
  136. 'cache_src' => $cache_src,
  137. 'last_modified' => $last_modified,
  138. 'asset_url' => $asset_url,
  139. 's3bucket' => $s3bucket,
  140. 'image_s3bucket' => $image_s3bucket,
  141. 'force' => $force
  142. );
  143. //*******
  144. // Get Filetype and process accordingly
  145. //*******
  146. if ($url_only != "yes") {
  147. $content_type = strtolower(substr(strrchr($src, "."), 1));
  148. if ($force != "") {$content_type = $force;}
  149. switch ($content_type) {
  150. case "css":
  151. $content_type = "text/css";
  152. if ($cache_flag) {
  153. if ($params['image_s3bucket']) {
  154. $params['cssfile_content'] = $this->process_stylesheet($params);
  155. }
  156. $this->cache_me($params, $content_type);
  157. }
  158. $stylesheet = $this->stylesheet($params);
  159. $this->return_data = $stylesheet;
  160. break;
  161. case "js":
  162. $content_type = "text/javascript";
  163. if ($cache_flag) {$this->cache_me($params, $content_type);}
  164. $javascript = $this->javascript($params);
  165. $this->return_data = $javascript;
  166. break;
  167. case "jpg" :
  168. $content_type = "image/jpeg";
  169. if ($cache_flag) {$this->cache_me($params, $content_type);}
  170. $image = $this->image($params);
  171. $this->return_data = $image;
  172. break;
  173. case "png":
  174. $content_type = "image/png";
  175. if ($cache_flag) {$this->cache_me($params, $content_type);}
  176. $image = $this->image($params);
  177. $this->return_data = $image;
  178. break;
  179. case "gif":
  180. $content_type = "image/gif";
  181. if ($cache_flag) {$this->cache_me($params, $content_type);}
  182. $image = $this->image($params);
  183. $this->return_data = $image;
  184. break;
  185. } // End Switch
  186. } else {
  187. $this->return_data = $src.'?'.$last_modified;
  188. }
  189. }
  190. function cache_me($params, $content_type) {
  191. global $PREFS, $TMPL;
  192. // Set URL constants
  193. if(is_readable($params['full_src']) || strstr($params['full_src'], 'http://') || strstr($params['full_src'], 'https://')){
  194. $original = file_get_contents($params['full_src']);
  195. } else {
  196. $file_url = "http";
  197. if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {$file_url .= "s";}
  198. $file_url .= "://www.".$_SERVER['HTTP_HOST'].$params['src'];
  199. file_get_contents($file_url);
  200. }
  201. $filename = basename($params['src']);
  202. $cache_structure = pathinfo($params['cache_src']);
  203. $cache_dirname = $cache_structure['dirname'];
  204. $cache_basename = $cache_structure['basename'];
  205. $cache_filename = $cache_structure['filename'];
  206. // Create Cache Dir if it does not exist
  207. if(!is_dir($cache_dirname)) {
  208. if (!mkdir($cache_dirname,0777,true)) {
  209. error_log("I did not write the cache dir");
  210. }
  211. }
  212. if (!defined("FILE_PUT_CONTENTS_ATOMIC_TEMP")) {define("FILE_PUT_CONTENTS_ATOMIC_TEMP", $cache_dirname);}
  213. if (!defined("FILE_PUT_CONTENTS_ATOMIC_MODE")) {define("FILE_PUT_CONTENTS_ATOMIC_MODE", 0777);}
  214. if (!defined("FILE_PUT_CONTENTS_ATOMIC_OWN")) {define("FILE_PUT_CONTENTS_ATOMIC_OWN", 'deploy');}
  215. $temp = tempnam(FILE_PUT_CONTENTS_ATOMIC_TEMP, 'temp');
  216. if (!($f = @fopen($temp, 'wb'))) {
  217. $temp = FILE_PUT_CONTENTS_ATOMIC_TEMP . DIRECTORY_SEPARATOR . uniqid('temp');
  218. if (!($f = @fopen($temp, 'wb'))) {
  219. trigger_error("file_put_contents_atomic() : error writing temporary file '$temp'", E_USER_WARNING);
  220. return false;
  221. }
  222. }
  223. // Check to see if its a parsed CSS file, if so write the parsed data
  224. if (!empty($params['cssfile_content'])) {
  225. fwrite($f, $params['cssfile_content']);
  226. } else {
  227. fwrite($f, $original);
  228. }
  229. fclose($f);
  230. if (!@rename($temp, $params['cache_src'])) {
  231. @unlink($params['cache_src']);
  232. @rename($temp, $params['cache_src']);
  233. }
  234. //AWS access info - Make sure to add this to your config.php file
  235. $s3assetsConfig = $PREFS->core_ini['s3assets'];
  236. if (isset($s3assetsConfig['user'])) {
  237. if (!defined("FILE_PUT_CONTENTS_ATOMIC_OWN")) {define("FILE_PUT_CONTENTS_ATOMIC_OWN", $s3assetsConfig['user']);}
  238. chown($params['cache_src'], FILE_PUT_CONTENTS_ATOMIC_OWN);
  239. }
  240. chmod($params['cache_src'], FILE_PUT_CONTENTS_ATOMIC_MODE);
  241. // Initiate S3 class and upload the file
  242. if ($params['s3bucket'] != "") {
  243. if (!class_exists('S3'))require_once('pi.s3assets/S3.php');
  244. $awsAccessKey = $s3assetsConfig['awsAccessKey'];
  245. $awsSecretKey = $s3assetsConfig['awsSecretKey'];
  246. if (!defined('awsAccessKey')) define('awsAccessKey', $awsAccessKey);
  247. if (!defined('awsSecretKey')) define('awsSecretKey', $awsSecretKey);
  248. $s3 = new S3(awsAccessKey, awsSecretKey, false);
  249. if (isset($params['s3assetname'])) {
  250. $src = preg_replace("/^\//","",$params['s3assetname']);
  251. } else {
  252. $src = preg_replace("/^\//","",$params['src']);
  253. }
  254. S3::putObject(
  255. S3::inputFile($params['cache_src']),
  256. $params['s3bucket'],
  257. $src,
  258. S3::ACL_PUBLIC_READ,
  259. array(),
  260. array(
  261. "Content-Type" => $content_type,
  262. "Cache-Control" => "max-age=315360000",
  263. "Expires" => gmdate("D, d M Y H:i:s T", strtotime("+5 years"))
  264. )
  265. );
  266. }
  267. }
  268. function image($params) {
  269. global $TMPL;
  270. $img_alt = $TMPL->fetch_param('alt');
  271. $img_rel = $TMPL->fetch_param('rel');
  272. $img_class = $TMPL->fetch_param('class');
  273. $img_id = $TMPL->fetch_param('id');
  274. $img_style = $TMPL->fetch_param('style');
  275. $img_width = $TMPL->fetch_param('width');
  276. $img_height = $TMPL->fetch_param('height');
  277. $image = '<img src="'.$params['asset_url'].'"';
  278. $image .= ($img_alt ? ' alt="'.$img_alt.'"' : ' alt=""');
  279. $image .= ($img_rel ? ' rel="'.$img_rel.'"' : '');
  280. $image .= ($img_class ? ' class="'.$img_class.'"' : '');
  281. $image .= ($img_id ? ' id="'.$img_id.'"' : '');
  282. $image .= ($img_style ? ' style="'.$img_style.'"' : '');
  283. $image .= ($img_width ? ' width="'.$img_width.'"' : '');
  284. $image .= ($img_height ? ' height="'.$img_height.'"' : '');
  285. $image .= " />";
  286. return $image;
  287. }
  288. function stylesheet($params) {
  289. global $TMPL;
  290. $css_media = $TMPL->fetch_param('media');
  291. $stylesheet = '<link rel="stylesheet" href="'.$params['asset_url'].'"';
  292. $stylesheet .= ($css_media ? " media='$css_media'" : ' media="screen"');
  293. $stylesheet .= ' type="text/css" />';
  294. return $stylesheet;
  295. }
  296. function javascript($params) {
  297. global $TMPL;
  298. $charset = $TMPL->fetch_param('charset');
  299. $javascript = '<script type="text/javascript" src="'.$params['asset_url'].'"';
  300. $javascript .= ($charset ? " charset='$charset'" : ' charset="utf-8"');
  301. $javascript .= '></script>';
  302. return $javascript;
  303. }
  304. function process_stylesheet($params) {
  305. global $TMPL, $FNS, $PREFS, $REGX;
  306. $cssfile_content = "";
  307. if(is_readable($params['full_src'])){
  308. $lines = $this->read_file($params['full_src']);
  309. } else {
  310. $cssfile_url = "http";
  311. if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {$cssfile_url .= "s";}
  312. $cssfile_url .= "://www.".$_SERVER['HTTP_HOST'].$params['src'];
  313. $lines = $this->read_file($cssfile_url);
  314. }
  315. foreach($lines as $line) {
  316. $matches = $this->extract_css_urls($line);
  317. if ( !empty($matches['property']) ) {
  318. $cache_base = PATH_CACHE."s3assets_cache";
  319. $src = str_replace(SLASH, "/", $matches['property'][0]);
  320. if (array_key_exists('DOCUMENT_ROOT',$_ENV)) {
  321. $pathto_src = $_ENV['DOCUMENT_ROOT']."/";
  322. } else {
  323. $pathto_src = $_SERVER['DOCUMENT_ROOT']."/";
  324. }
  325. $pathto_src = str_replace("\\", "/", $pathto_src);
  326. $pathto_src = $FNS->remove_double_slashes($pathto_src);
  327. $full_src = $FNS->remove_double_slashes($pathto_src.$src);
  328. $cache_src = $FNS->remove_double_slashes($cache_base.$src);
  329. $last_modified = @filemtime($full_src);
  330. $image_s3bucket = $TMPL->fetch_param('image_s3bucket');
  331. $content_type = strtolower(substr(strrchr($src, "."), 1));
  332. if (isset($params['force']) && $params['force'] != "") {$content_type = $TMPL->fetch_param('force');}
  333. switch ($content_type) {
  334. case "css":
  335. $content_type = "text/css";
  336. break;
  337. case "js":
  338. $content_type = "text/javascript";
  339. break;
  340. case "jpg" :
  341. $content_type = "image/jpeg";
  342. break;
  343. case "png":
  344. $content_type = "image/png";
  345. break;
  346. case "gif":
  347. $content_type = "image/gif";
  348. break;
  349. } // End Switch
  350. $params = array(
  351. 'src' => $src,
  352. 'full_src' => $full_src,
  353. 'cache_src' => $cache_src,
  354. 'last_modified' => $last_modified,
  355. 's3bucket' => $image_s3bucket,
  356. );
  357. if (strstr($src, 'http')) {
  358. $cache_structure = parse_url($src);
  359. $cache_dirname = $cache_structure['path'];
  360. $params['full_src'] = $src;
  361. $params['cache_src'] = $cache_base.$cache_dirname;
  362. $params['s3assetname'] = $cache_dirname;
  363. }
  364. $this->cache_me($params, $content_type);
  365. $search = '/url\(\s*[\'"]?(([^\\\\\'", \(\)]*(\\\\.)?)+)/';
  366. $cname = $TMPL->fetch_param('cname');
  367. $cnamemax = $TMPL->fetch_param('cnamemax');
  368. if (isset($cache_dirname)) {
  369. $src = $cache_dirname;
  370. $last_modified = $FNS->remove_double_slashes($cache_base.$cache_dirname);
  371. $last_modified = @filemtime($last_modified);
  372. }
  373. if ($cname == "" || $cnamemax == "") {
  374. $replace = 'url(http://'.$image_s3bucket.'.s3.amazonaws.com'.$src.'?'.$last_modified;
  375. } else {
  376. // Setup CNAME for asset domain spanning.
  377. $rand_number = rand(0, $cnamemax);
  378. $cname = str_replace("$1", $rand_number, $cname);
  379. $replace = 'url(http://'.$cname.$src.'?'.$last_modified;
  380. }
  381. $newLine = preg_replace($search, $replace, $line);
  382. } else {
  383. $newLine = $line;
  384. }
  385. $cssfile_content .= $newLine;
  386. }
  387. return $cssfile_content;
  388. }
  389. function read_file($filename) {
  390. $fd = fopen($filename, "r");
  391. while (!feof ($fd))
  392. {
  393. $buffer = fgets($fd, 4096);
  394. $lines[] = $buffer;
  395. }
  396. fclose ($fd);
  397. return $lines;
  398. }
  399. function extract_css_urls($text)
  400. {
  401. $urls = array( );
  402. $url_pattern = '(([^\\\\\'", \(\)]*(\\\\.)?)+)';
  403. $urlfunc_pattern = 'url\(\s*[\'"]?' . $url_pattern . '[\'"]?\s*\)';
  404. $pattern = '/(' .
  405. '(@import\s*[\'"]' . $url_pattern . '[\'"])' .
  406. '|(@import\s*' . $urlfunc_pattern . ')' .
  407. '|(' . $urlfunc_pattern . ')' . ')/iu';
  408. if ( !preg_match_all( $pattern, $text, $matches ) )
  409. return $urls;
  410. foreach ( $matches[3] as $match )
  411. if ( !empty($match) )
  412. $urls['import'][] =
  413. preg_replace( '/\\\\(.)/u', '\\1', $match );
  414. foreach ( $matches[7] as $match )
  415. if ( !empty($match) )
  416. $urls['import'][] =
  417. preg_replace( '/\\\\(.)/u', '\\1', $match );
  418. foreach ( $matches[11] as $match )
  419. if ( !empty($match) )
  420. $urls['property'][] =
  421. preg_replace( '/\\\\(.)/u', '\\1', $match );
  422. return $urls;
  423. }
  424. // -----------------------------------------------
  425. // Plugin Usage
  426. // This function describes how the plugin is used.
  427. // -----------------------------------------------
  428. function usage() {
  429. ob_start();
  430. ?>
  431. The S3assets plugin is meant to help with the static assets we use in the
  432. front-end development of a site. It also it meant to help with maintaining
  433. a fresh set of S3 hosted assets with far future headers that will expire when
  434. the file is changed.
  435. To use the Amazon s3 service be sure to setup an s3 account. Once you do, place
  436. these lines in your config.php file. Make sure you replace the text with your keys.
  437. // s3assets
  438. $conf['s3assets'] = array(
  439. "environment" => "-- development, staging, or production --",
  440. "awsAccessKey" => "-- Your awsAccessKey Here --",
  441. "awsSecretKey" => "-- Your awsSecretKey Here --"
  442. );
  443. ========================================
  444. Global Parameters
  445. ========================================
  446. src="" This is the relative path to the file that you are trying to access.
  447. Example: src="_css/global.css"
  448. s3bucket="" This is the name of the s3 s3bucket you would like to have your
  449. assets placed in and referenced from. This is optional.
  450. Example: s3bucket_name="asset1.mysite.com"
  451. force="" If you are using a minify plugin this can be very useful
  452. Example force="js" -- this will force a javascript file even when you
  453. are not using a file extension. Just remember this has no way of knowing
  454. when you updated the file, so you have to delete the cache manually.
  455. cname="" If you have cloudfront and your DNS setup for multiple cnames that reference
  456. the same bucket you can use this feature for overcoming the browsers open
  457. connections limitation. This feature will spread the connections over multiple
  458. domains. Simply use "$1" where the number would go. To set this up simeply use
  459. assets$1.yourdomain.com - then set the cnamemax to the last number of cnames you
  460. have setup. Like assets1.yourdomain.com, assets2.yourdomain.com, assets3.yourdomain.com.
  461. The plugin will replace $1 with the number of the server.
  462. cnamemax="" (Required to use cname) As explained above this is the highest number of your asset servers.
  463. Example: assets1.yourdomain.com, assets2.yourdomain.com, assets3.yourdomain.com.
  464. cnamemax="3"
  465. Example:
  466. {exp:s3assets
  467. s3bucket="your.bucket.com"
  468. src="/foo/bar/image.jpg"
  469. cname="assets$1.yourdomain.com"
  470. cnamemax="5"
  471. }
  472. ========================================
  473. Images
  474. ========================================
  475. Example: {exp:s3assets s3bucket="your.bucket.com" src="/_images/smallimg.jpg"}
  476. Renders: <img src="http://bucket.s3bucket.s3.amazonaws.com/_images/smallimg.jpg?1255500429" alt="" />
  477. The image tag supports all of the html options for an image tag.
  478. alt="", rel="", class="", id="", style="", width="", height=""
  479. Example: {exp:s3assets s3bucket="your.bucket.com" src="/_images/smallimg.jpg" alt="{title}" class="example"}
  480. Renders: <img src="http://bucket.s3bucket.s3.amazonaws.com/_images/smallimg.jpg?1255500429" alt="This is my title" class="example" />
  481. ========================================
  482. CSS
  483. ========================================
  484. Example: {exp:s3assets s3bucket="your.bucket.com" src="/_css/global.css"}
  485. Renders: <link rel="stylesheet" href="http://bucket.s3bucket.s3.amazonaws.com/_css/_global.css?1255500072" media="screen" type="text/css" />
  486. The CSS file extension supports changing the media type by using
  487. media="". If none is set it will default to screen.
  488. Alpha:
  489. This is an alpha feature but if you load a css file with an image s3bucket parameter
  490. the plugin will replace the image urls in your CSS file and upload those images to
  491. your s3 server.
  492. image_s3bucket="" This will parse the css file and upload all of the images to this bucket.
  493. It will then replace all of the url() references with the new S3 location.
  494. This currently only works for relative paths to the web root like url(/images/image.jpg)
  495. cname/cnamemax These work the same as above.
  496. Example: {exp:s3assets
  497. s3bucket="your.bucket.com"
  498. image_s3bucket="assets.yourdomain.com"
  499. src="/_css/_global.css"
  500. }
  501. With
  502. Cname: {exp:s3assets
  503. s3bucket="your.bucket.com"
  504. image_s3bucket="assets.yourdomain.com"
  505. src="/_css/_global.css"
  506. cname="assets$1.yourdomain.com"
  507. cnamemax="5"
  508. }
  509. ========================================
  510. Javascript
  511. ========================================
  512. Example: {exp:s3assets s3bucket="your.bucket.com" src="/_js/_global.js"}
  513. Renders: <script type="text/javascript" src="http://bucket.s3bucket.s3.amazonaws.com/_js/_global.js?1255143438" charset="utf-8"></script>
  514. The JS file extension supports changing your character set using
  515. charset="". If left blank it will default to utf-8.
  516. <?php
  517. $buffer = ob_get_contents();
  518. ob_end_clean();
  519. return $buffer;
  520. }
  521. }
  522. /* End of file pi.s3assets.php */
  523. /* Location: ./system/plugins/pi.s3assets.php */