cvs: phd / .cvsignore build.php config.php package.xml
| From: | Hannes Magnusson | Date: | Thu, 10 Jan 2008 17:39:38 +0000 |
| Subject: | cvs: phd / .cvsignore build.php config.php package.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1021@lists.php.net to get a copy of this message | ||
bjori Thu Jan 10 17:39:38 2008 UTC
Modified files:
/phd .cvsignore build.php config.php package.xml
Log:
Added index chaching (Edward Z.)
http://cvs.php.net/viewvc.cgi/phd/.cvsignore?r1=1.3&r2=1.4&diff_format=u
Index: phd/.cvsignore
diff -u phd/.cvsignore:1.3 phd/.cvsignore:1.4
--- phd/.cvsignore:1.3 Sun Sep 16 12:52:49 2007
+++ phd/.cvsignore Thu Jan 10 17:39:38 2008
@@ -9,4 +9,5 @@
pdo-data.sqlite
html
php
+index.ser
http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.40&r2=1.41&diff_format=u
Index: phd/build.php
diff -u phd/build.php:1.40 phd/build.php:1.41
--- phd/build.php:1.40 Sun Dec 30 15:20:09 2007
+++ phd/build.php Thu Jan 10 17:39:38 2008
@@ -1,6 +1,6 @@
#!@php_bin@
<?php
-/* $Id: build.php,v 1.40 2007/12/30 15:20:09 bjori Exp $ */
+/* $Id: build.php,v 1.41 2008/01/10 17:39:38 bjori Exp $ */
$ROOT = "@php_dir@/phd";
if ($ROOT == "@php_dir"."@/phd") {
@@ -20,16 +20,31 @@
require $ROOT. "/include/PhDFormat.class.php";
require $ROOT. "/include/PhDTheme.class.php";
-if ($OPTIONS["index"]) {
+if (!$OPTIONS["index"] && file_exists("index.ser")) {
+ /* FIXME: Load from sqlite db? */
+ if ($OPTIONS["verbose"] & VERBOSE_INDEXING) {
+ v("Unserializing cached index file...\n");
+ }
+ $IDs = unserialize(file_get_contents("index.ser"));
+ if ($OPTIONS["verbose"] & VERBOSE_INDEXING) {
+ v("Unserialization done\n");
+ }
+} else {
if ($OPTIONS["verbose"] & VERBOSE_INDEXING) {
v("Indexing...\n");
}
require $ROOT. "/mktoc.php";
+
+ file_put_contents("index.ser", $ser = serialize($IDs));
+
+ $IDs2 = unserialize($ser);
+ if ($IDs !== $IDs2) {
+ v("WARNING: Serialized representation does not match");
+ }
+
if ($OPTIONS["verbose"] & VERBOSE_INDEXING) {
v("Indexing done\n");
}
-} else {
- /* FIXME: Load from sqlite db? */
}
foreach($OPTIONS["output_format"] as $output_format) {
http://cvs.php.net/viewvc.cgi/phd/config.php?r1=1.16&r2=1.17&diff_format=u
Index: phd/config.php
diff -u phd/config.php:1.16 phd/config.php:1.17
--- phd/config.php:1.16 Sun Dec 30 15:18:49 2007
+++ phd/config.php Thu Jan 10 17:39:38 2008
@@ -1,5 +1,5 @@
<?php
-/* $Id: config.php,v 1.16 2007/12/30 15:18:49 bjori Exp $ */
+/* $Id: config.php,v 1.17 2008/01/10 17:39:38 bjori Exp $ */
function v($msg) {
$args = func_get_args();
@@ -219,8 +219,8 @@
--format <formatname> The build format to use
-t <themename>
--theme <themename> The theme to use
- -i
- --index Index before rendering or load from cache [NOTE: Not supported yet]
+ -i <bool>
+ --index <bool> Index before rendering (default) or load from cache (false)
-d <filename>
--docbook <filename> The Docbook file to render from
-p <id[=bool]>
http://cvs.php.net/viewvc.cgi/phd/package.xml?r1=1.22&r2=1.23&diff_format=u
Index: phd/package.xml
diff -u phd/package.xml:1.22 phd/package.xml:1.23
--- phd/package.xml:1.22 Mon Dec 31 11:49:00 2007
+++ phd/package.xml Thu Jan 10 17:39:38 2008
@@ -26,6 +26,7 @@
<notes>
- Removed support for phnotify
- Fixed E_NOTICE on empty references
+ - Added index chaching (Edward Z.)
</notes>
<contents>
<dir baseinstalldir="phd" name="/">