commit 5d6c24f80a385eb96f009cbc07f1aac861bc2dbf Author: Steven Grimm Date: Sun Feb 15 10:53:14 2009 -0800 Implement apc_compile_file diff --git a/modules/quercus/src/com/caucho/quercus/lib/ApcModule.java b/modules/quercus/src/com/caucho/quercus/lib/ApcModule.java index 7757d05..07f91ad 100644 --- a/modules/quercus/src/com/caucho/quercus/lib/ApcModule.java +++ b/modules/quercus/src/com/caucho/quercus/lib/ApcModule.java @@ -37,7 +37,9 @@ import com.caucho.quercus.module.IniDefinition; import com.caucho.util.Alarm; import com.caucho.util.L10N; import com.caucho.util.LruCache; +import com.caucho.vfs.Path; +import java.io.IOException; import java.util.*; import java.util.logging.Logger; @@ -293,6 +295,21 @@ public class ApcModule extends AbstractQuercusModule { return BooleanValue.TRUE; } + + /** + * Compiles a file, either literally (if using Pro) or by parsing it + * and caching the parse tree. + */ + public boolean apc_compile_file(Env env, StringValue filename) { + Path path = env.lookupInclude(filename); + try { + env.getQuercus().parse(path); + return true; + } + catch (IOException e) { + return false; + } + } static class Entry extends UnserializeCacheEntry { private long _createTime;