restored only by applicaions that really need them.
- Added note, that zend_optimizerplus.save_comments is dangerous and may break applications and frameworks.
zend_optimizerplus.interned_strings_buffer=8
zend_optimizerplus.max_accelerated_files=4000
zend_optimizerplus.revalidate_freq=60
-zend_optimizerplus.save_comments=0
zend_optimizerplus.fast_shutdown=1
-zend_optimizerplus.enable_file_override=1
zend_optimizerplus.enable_cli=1
+You also may add the following, but it may break some applications and
+frameworks. Please, read description of these directives and add them on your
+own risk.
+
+zend_optimizerplus.save_comments=0
+zend_optimizerplus.enable_file_override=1
+
In some cases you may like to prefer enabling/disabling some features
to avoid incompatibilities at the cost of some performance degradation.
zend_optimizerplus.save_comments (default "1")
If disabled, all PHPDoc comments are dropped from the code to reduce the
- size of the optimized code.
+ size of the optimized code. Disabling "Doc Comments" may break some
+ existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)
+
+zend_optimizerplus.load_comments (default "1")
+ If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
+ may be always stored (save_comments=1), but not loaded by applications
+ that don't need them anyway.
zend_optimizerplus.fast_shutdown (default "0")
If enabled, a fast shutdown sequence is used for the accelerated code
zend_bool validate_timestamps;
zend_bool revalidate_path;
zend_bool save_comments;
+ zend_bool load_comments;
zend_bool fast_shutdown;
zend_bool protect_memory;
zend_bool file_override_enabled;
STD_PHP_INI_ENTRY("zend_optimizerplus.protect_memory" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.protect_memory, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("zend_optimizerplus.save_comments" , "1" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.save_comments, zend_accel_globals, accel_globals)
+ STD_PHP_INI_ENTRY("zend_optimizerplus.load_comments" , "1" , PHP_INI_ALL, OnUpdateBool, accel_directives.load_comments, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("zend_optimizerplus.fast_shutdown" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.fast_shutdown, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("zend_optimizerplus.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals, accel_globals)
/* Copy constructor */
prop_info->name = interned_estrndup(prop_info->name, prop_info->name_length);
if(prop_info->doc_comment) {
- prop_info->doc_comment = estrndup(prop_info->doc_comment, prop_info->doc_comment_len);
+ if (ZCG(accel_directives).load_comments) {
+ prop_info->doc_comment = estrndup(prop_info->doc_comment, prop_info->doc_comment_len);
+ } else {
+ prop_info->doc_comment = NULL;
+ }
}
if(prop_info->ce == old_ce) {
prop_info->ce = ce;
ce->interfaces = NULL;
}
if (ZEND_CE_DOC_COMMENT(ce)) {
- ZEND_CE_DOC_COMMENT(ce) = estrndup(ZEND_CE_DOC_COMMENT(ce), ZEND_CE_DOC_COMMENT_LEN(ce));
+ if (ZCG(accel_directives).load_comments) {
+ ZEND_CE_DOC_COMMENT(ce) = estrndup(ZEND_CE_DOC_COMMENT(ce), ZEND_CE_DOC_COMMENT_LEN(ce));
+ } else {
+ ZEND_CE_DOC_COMMENT(ce) = NULL;
+ }
}
if(ce->parent) {