Skip to Main Content
建構Android應用程式--使用HTML、CSS和JavaScript 第二版
book

建構Android應用程式--使用HTML、CSS和JavaScript 第二版

by Jonathan Stark, Brian Jepson
May 2012
Intermediate to advanced content levelIntermediate to advanced
176 pages
3h 43m
Chinese
GoTop Information, Inc.
Content preview from 建構Android應用程式--使用HTML、CSS和JavaScript 第二版
114
第六章
建立動態告示檔
現在,你已經瞭解離線程式快取如何運作了,讓我們將它用在
Kilo
範例吧。
Kilo
由好幾
個檔案組成,親手將這些檔案都輸入告示檔很辛苦。而且,只要有某個地方打錯,整個告
示檔就會無效,而應用程式就無法離線運作。
為了解決這個問題,我們要寫一個小
PHP
檔案,讀取應用程式目錄(和子目錄)內容,
然後替我們建立檔案清單。在你的
Kilo
目錄內建立一個新檔,名為
manifest.php
,然後輸
入下列程式碼:
<?php
header('Content-Type: text/cache-manifest');
echo "CACHE MANIFEST\n";
$dir = new RecursiveDirectoryIterator(".");
foreach(new RecursiveIteratorIterator($dir) as $file) {
if ($fileIsFile() &&
$filegetFilename() != "manifest.php" &&
substr($filegetFilename(), 0, 1) != "." &&
!strpos($file, DIRECTORY_SEPARATOR . '.'))
{
$file_name = $filegetPathName();
if (DIRECTORY_SEPARATOR == "\\") {
$file_name = strtr($file_name, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大模型应用开发极简入门 : 基于GPT-4和ChatGPT

大模型应用开发极简入门 : 基于GPT-4和ChatGPT

Olivier Caelen, Marie-Alice Blete
HBase管理指南

HBase管理指南

Posts & Telecom Press, Yifeng Jiang
自然语言处理与计算语言学

自然语言处理与计算语言学

Posts & Telecom Press, Bhargav Srinivasa-Desikan

Publisher Resources

ISBN: 9789862764817