Turck MMCache is a free open source PHP accelerator, optimizer,
encoder and dynamic content cache for PHP. It increases performance of PHP
scripts by caching them in compiled state, so that the overhead of compiling is almost
completely eliminated. Also it uses some optimizations to speed up execution
of PHP scripts. Turck MMCache typically reduces server load and
increases the speed of your PHP code by 1-10 times.

Turck MMCache stores compiled PHP scripts in shared memory and
execute code directly from it. It creates locks only for short time while search
compiled PHP script in the cache, so one script can be executed simultaneously
by several engines. MM shared memory library (http://www.engelschall.com/sw/mm/)
was used by Turck MMCache before version 2.3.13 for management of shared memory and locking.
Files those can't fit in shared memory are cached on disk only.Turck MMCache was first launched in 2001 to speed up the www.guestbooks4all.com service.
It has been tested under PHP 4.1.0-4.3.3 under GNU/Linux and Windows with Apache 1,3 and 2.0. Patches for ports to other OSs and PHP versions are welcome

Since version 2.3.10, Turck MMCache contains a PHP encoder and loader.
You can encode PHP scripts using encoder.php in order to distribute them without
sources. Encoded files can be run on any site which runs PHP with Turck MMCache
2.3.10 or above. The sources of encoded scripts can't be restored because they are stored
in a compiled form and the encoded version doesn't contain the source.
Of course, some internals of the scripts can be restored with different
reverse engineering tools (disassemblers, debuggers, etc), but it is not trivial.

Since version 2.3.15, Turck MMCache is compatible with Zend Optimizer's
loader. Zend Optimizer must be installed after Turck MMCache in php.ini.
If you don't use scripts encoded with Zend Encoder then we do not recommend
you install Zend Optimizer with Turck MMCache.

* Turck MMCache is installed without Zend Optimizer
** Free Evaluation Version of ZPS (Zend Accelerator and Zend Optimizer)
*** require("jpcache.php"); was added at the start of index.php
**** mmcache_cache_page($PHP_SELF."?GET=".serialize($_GET)); was added at the start of index.php

TURCK SOFTWARE ST. PETERSBURG
was founded in August 1998 as a branch of German Corporate Headquarters
Turck GmbH Munich, Germany, the leading provider of IT-solutions in
building-investment software in Germany. The main goal of
TURCK SOFTWARE ST. PETERSBURG
foundation was to develop the laborious
and complex finance-analysis systems, using Russian labour market.
The significant prerequisites of it were the reliability and the
most precision in terms and as the consequence - the highest quality
of our software. Today
TURCK SOFTWARE ST. PETERSBURG
is an independent enterprise ( main shareholder: Helmut Turck),
which works mainly for customers from the German bank and insurance branch.

Turck MMCache version 2.4.6 is released
- some PHP5 specific optimization BUGs were fixed
- compatibility with "pcntl" extension was fixed
- this release was tested with php-4.3.4

2003-10-31

Turck MMCache version 2.4.5 is released
- tested with php-5.0.0b2, older PHP5 betas are not longer supported
- now MMCache is comaptible with DBG, Xdebug and APD (EXPERIMENTAL)
- rollback to select() instead of sched_yield() because of highe load
- handling of unclean PHP shutdown was implemented
- "MMCache does not initialize itself on Apache restart" bug was fixed

Turck MMCache version 2.4.3 is released
- if mmcache.check_mtime=1 then also check for the same file size
- optimizer's BUG related to overloaded object handling was fixed
- some problems with file identification by inode were solved
- mm_malloc() possible crash was fixed
- Solaris comatibility was fixed
- Tested on AIX (Thanks to Christophe Leitienne)

Turck MMCache version 2.4.1 is released
- protection of disk cache files by crc32 checksum was implemented
- mmcache_get/mmcache_put cross-host security was fixed
- optimizer bug was fixed "function test() {$a=$GLOBALS['a']+1;}"
- crash during include of non existing file with Zend Optimizer was fixed
- "Clean" button was implemented in "mmcache.php" to remove all
expired data from shared memory and disk cache
- additional configuration directives "mmcache.keys",
"mmcache.sessions" and "mmcache.content" were added to control
where to cache data, session data and content.
- some 64-bit specific BUGs were fixed (Ilia Alshanetsky)

2003-09-22

Turck MMCache version 2.4.0 is released
- support for incomlete classes in mmcache_get() was implemented
- check for proper PHP version was added
- include('x.php'); include_once('x.php') bug with php-4.3.3 was fixed
- improper "Cannot redeclare ()" error was fixed
- caching of files with absolute path but without drive on Windows was fixed
- tested with PHP 4.3.3 and php5-200309021330

2003-08-20

Turck MMCache version 2.3.23 is releasedThis is should be the last version prior to the stable 2.4.0 release.
Please test this release as much as possible.
- HTTP caching of mmcache.php was disabled
- Usage of POSIX semaphors on Mac OS X was disabled
- Handling of scripts with PHP syntax errors was fixed
- ZE2 support was improved (tested with php5-200308140730)

2003-08-11

Turck MMCache version 2.3.22 is released
- optimization of $GLOBALS[] for ZE2 was implemented
- comparsion with zero optimization pattern was improved
- "mmcache.shm_only" configuration directive was added to disable
caching of scripts on disk. It has no effect on session and content caching
- bug with get_parent_class() and is_subclass_of() was fixed

2003-07-31

Turck MMCache version 2.3.21 is released
- using $_SERVER['PHP_SELF'] instead of $PHP_SELF in encoder.php and
mmcache_password.php
- virtualhost support was improved. You can start mmcache with
"mmcache.enable=0" and enable it only for some virtual hosts or
directories.
- ZE2 compatibility was improved (tested with php5-200307290730)
- Some serios bugs were fixed

2003-07-25

Turck MMCache version 2.3.20 is released
- optimizer for ZE2 was implemented
- optimization of extension_loaded() was fixed for encoded scripts
- optimization of <?php do {echo 1;} while(0); echo 2;?> was fixed
- "mmcache.compress" configuration directive was added to enable or
disable cached content compression
- "mmcache_password.php" and "encoder.php" now can work from web and
from command line
- proper "__FILE__" handling in encoded files was implemented
- PHP constant MMCACHE_VERSION was introduced

2003-07-10

Turck MMCache version 2.3.19 is released
- content compression was reimplemented
- bug in runtime class/function declaration was fixed
- optimization for functions extension_loaded(), function_exists(),
is_callable(), defined() was implemented
- optimization of reset() functuin was fixed
- mmcache_get() and mmcache_put() now support for stdClass objects

2003-07-02

Turck MMCache version 2.3.18 is released
- standalone loader (TurckLoader) was imlemented
- mmcache() security was improved. mmcache() is enabled in safe
mode, but it can be protected by password. See Web Interface
section for more details.
- This release was tested with PHP 5.0.0b1

2003-06-25

Turck MMCache version 2.3.17 is released
- Content caching was improved to cache HTTP headers
- some serios bugs were fixed

2003-06-20

Turck MMCache version 2.3.16 is released
- FastCGI support on Windows was implemented
- ZE2 support was improved (tested with php5-200306160730)
- some content caching bugs were fixed
- some memory leaks were fixed
- user and content caches were separated across virtualhosts
- mmcache() function was disabled in safe mode

Turck MMCache version 2.3.14 is released
- "mmcache.filter" option was implemented. It can be used to disable
caching of files those matches or not matches to the patterns.
file and to shared memory if it is available. mmcache_get() tries
to get value from shared memory and if it is not found then from
file.
- "mmcache.shm_max" option was implemented. mmcache_put() stores
values in shared memory if they are less then "shm_max".
- "mmcache.shm_ttl" and "mmcache.shm_prune_period" was implemented
- now MMCache session handlers can be installed in php.ini file
thorough configuration directive "session.save_handler=mmcache"
(PHP 4.2.0 or above required). The oldest PHP versions should
call "mmcache_set_session_handlers()" function.
- optimizer bug fixed.
- tested with PHP 4.3.2.

The directory that is used for disk cache. Turck MMCache stores precompiled
code, session data, content and user entries here. The same data can be
stored in shared memory also (for more quick access). Default value is
"/tmp/mmcache".

mmcache.enable

Enables or disables Turck MMCache. Should be "1" for enabling or "0" for disabling. Default value is "1".

mmcache.optimizer

Enables or disables internal peephole optimizer
which may speed up code execution. Should be "1" for enabling or "0" for disabling. Default value is "1".

mmcache.debug

Enables or disables debug logging. Should be "1" for enabling or "0" for disabling. Default value is "0".

mmcache.check_mtime

Enables or disables PHP file modification checking. Should be "1" for enabling or "0" for disabling. You should set it to "1" if you want to recompile PHP files after
modification. Default value is "1".

mmcache.filter

Determine which PHP files must be cached. You may specify the number of
patterns (for example "*.php *.phtml") which specifies to cache or
not to cache. If pattern starts with the character "!", it means to ignore
files which are matched by the following pattern. Default value is "" that
means - all PHP scripts will be cached.

mmcache.shm_max

Disables putting large values into shared memory by "mmcache_put()" function.
It indicates the largest allowed size in bytes (10240, 10K, 1M). The "0"
disables the limit. Default value is "0".

mmcache.shm_ttl

When MMCache fails to get shared memory for new script it removes all
scripts which were not accessed at last "shm_ttl" seconds from shared
memory. Default value is "0" that means - don't remove any files from
shared memory.

mmcache.shm_prune_period

When MMCache fails to get shared memory for new script it tryes to remove
old script if the previous try was made more then "shm_prune_period"
seconds ago. Default value is "0" that means - don't try to remove any
files from shared memory.

mmcache.shm_only

Enables or disables caching of compiled scripts on disk. It has no effect
on session data and content caching.
Default value is "0" that means - use disk and shared memory for caching.

Turck MMCache can be managed through web interface script mmcache.php.
So you need to put this file on your web site.
For security reasons it is recommended to restrict the usage of this script by your local IP.

Since version 2.3.18 admin interface may be protected by password.
To generate password run the mmcache_password.php from command line and
follow the instruction.

Turck MMCache. is a PHP Encoder. You can encode PHP scripts in order to
distribute them without sources.

Turck MMCache contains only the command line interface to Encoder - encoder.php.
It should be run from command line:

$ php -q encoder.php

To encode one script do:

$ php -q encoder.php -f input.php -o output.php

To encode directory do:

$ php -q encoder.php -rcf input_dir -o output_dir

If you use non command line PHP build, you must set "register_argc_argv = On"
in your php.ini.

Jason Sheets has written PHPCoder a GUI front end to the Turck MMCache Encoder.

PHPCoder is a web-based front-end to the Turck MMCache encoding functions and
allows you to easily encode your PHP scripts into non-reverisble byte-code.
It allows you to set restrictions on the encoded scripts, for example you
can lock a script to a particular server IP address, server host name, visitor
IP, or even place a time limit on the script so it will expire after x amount
of time. PHPCoder also allows you to specify Text, HTML or PHP code that
should be prepended and appended to each file before it is encoded, allowing
you to easily and securely implement your own licensing scheme.

You can use files encoded by Turck MMCache without it. For this reason you must
use TurckLoader. It is a regular PHP extension that can be used with other
accelerators or without them. It can be loaded on startup or in runtime by dl().
TurckLoader is not need with Turck MMCache, becuse it is already compiled in.
For more information about TurckLoader see README.loader file.