PHP 文件中定义加载资源文件

学习 php 在弄懂 HTTP 协议的基础上,可以往里面加入资源文件的请求,这个厉害了。

app/c/manifest.php

<?php
/**
 * 
 */
class manifest extends c
{

  function index()
  {
		header("Cache-Control: max-age=0, no-cache, no-store, must-revalidate");
		header("Pragma: no-cache");
		header("Expires: Mon, 1 Jan 1970 00:00:00 GMT");
		header('Content-type: text/cache-manifest');

		$cache_list = array(
			// css
			'static/css/pepm.min.css',
			'static/simditor/simditor.css',
			'static/icon.css',
			// js
      'static/js/pepm.min.js',
      'static/js/event.min.js',
      'static/js/board.min.js',
      'static/js/entity.min.js',
      'static/js/jsgrid.min.js',
      'static/js/calendar.min.js',
      'static/js/monitor.min.js',
      'static/js/jquery.dataTables.min.js',
      'static/highcharts.js',
      'static/sha1.js',
      'static/exporting.js',
      'static/funnel.js',
			'static/dataTables.pagination.js',
			'static/simditor/simditor.min.js',
			// image
			'static/logo.png',
			'static/img/enter-arrow.gif',
			'static/img/sort_asc.png',
			'static/img/sort_both.png',
			'static/img/ui-bg_flat_75_ffffff_40x100.png',
			// font
			'static/fonts/glyphicons-halflings-regular.ttf',
			);

		echo "CACHE MANIFEST\n";
		echo implode("\n", $cache_list);
		echo "\n";
		echo "# Version: " . VERSION . "\n\n";

		echo "NETWORK:\n";
		echo "*\n";

  }

  function loader()
  {
  	$frame = <<<FRAME
<!DOCTYPE HTML>
<html lang="en" class="no-js" manifest="%s/?/manifest">
  <head>
    <meta charset="utf-8">
    <title>manifest</title>
  </head>
  <body></body>
</html>
FRAME;
		printf($frame, WWW);
		return;
  }
}