Commit:    0e298f9d4a5d2d4bbff55cc381633dfd74297d94
Author:    Matt Ficken <v-maf...@microsoft.com>         Thu, 28 Mar 2013 
22:58:16 -0700
Parents:   2a5da53454108d1a716abce471eff426008cb58d
Branches:  master

Link:       
http://git.php.net/?p=pftt2.git;a=commitdiff;h=0e298f9d4a5d2d4bbff55cc381633dfd74297d94

Log:
sped up builtin_web scenario and install opcache on 5.3 and 5.4 builds


Former-commit-id: 8a0953e37fe540f0f57aa4a28c513ab6acc4651f

Changed paths:
  A  cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.dll
  A  cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.pdb
  A  cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.dll
  A  cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.pdb
  A  cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.dll
  A  cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.pdb
  A  cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.dll
  A  cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.pdb
  M  conf/app/joomla.groovy
  M  src/com/mostc/pftt/main/PfttMain.java
  M  src/com/mostc/pftt/model/core/EAcceleratorType.java
  M  src/com/mostc/pftt/runner/AbstractLocalTestPackRunner.java
  M  src/com/mostc/pftt/scenario/BuiltinWebServerScenario.java
  M  src/com/mostc/pftt/scenario/OpcacheScenario.java

diff --git 
a/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.dll 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.dll
new file mode 100644
index 0000000..69000dc
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.dll differ
diff --git 
a/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.pdb 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.pdb
new file mode 100644
index 0000000..b24f283
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.pdb differ
diff --git a/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.dll 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.dll
new file mode 100644
index 0000000..986a753
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.dll differ
diff --git a/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.pdb 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.pdb
new file mode 100644
index 0000000..8ef8e6e
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.pdb differ
diff --git 
a/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.dll 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.dll
new file mode 100644
index 0000000..e698585
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.dll differ
diff --git 
a/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.pdb 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.pdb
new file mode 100644
index 0000000..b233c4e
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.pdb differ
diff --git a/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.dll 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.dll
new file mode 100644
index 0000000..21bc746
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.dll differ
diff --git a/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.pdb 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.pdb
new file mode 100644
index 0000000..04ec65d
Binary files /dev/null and 
b/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.pdb differ
diff --git a/conf/app/joomla.groovy b/conf/app/joomla.groovy
index 523761f..520298c 100644
--- a/conf/app/joomla.groovy
+++ b/conf/app/joomla.groovy
@@ -89,6 +89,14 @@ class JoomlaPlatformPhpUnitTestPack extends 
PhpUnitSourceTestPack { //SymfonyPhp
                return true;
        } // end public boolean open
        
+       @Override
+       public String[][] getNonThreadSafeTestFileNames() {
+               return [
+                               ["joomla/filesystem/"],
+                               ["joomla/language/"]
+                       ]
+       }
+       
 } // end class JoomlaPlatformPhpUnitTestPack
 
 def getPhpUnitSourceTestPack() {
diff --git a/src/com/mostc/pftt/main/PfttMain.java 
b/src/com/mostc/pftt/main/PfttMain.java
index 6be3843..ca22eb0 100644
--- a/src/com/mostc/pftt/main/PfttMain.java
+++ b/src/com/mostc/pftt/main/PfttMain.java
@@ -75,7 +75,6 @@ import 
com.mostc.pftt.util.WindowsSnapshotDownloadUtil.FindBuildTestPackPair;
 // commit: UI testing support, first implemented for Wordpress
 //
 // TODO joomla unit testing
-//      -works, but need thread-safety for some tests
 //      -need dependency note on symfony
 //      -note: ui tests from joomla may be BRITTLE (maybe thats why they're 
just run by 1 guy on his laptop once in a while)
 // commit:
@@ -89,11 +88,16 @@ import 
com.mostc.pftt.util.WindowsSnapshotDownloadUtil.FindBuildTestPackPair;
 // 
 // TODO list-config command
 //       -mention on start screen of pftt_shell
+//      call describe() on each config
 // TODO pftt explain
 //        -shows PhpIni, etc.. not as a separate file though
 //           -if you need it for debug, use it from explain
 //                -ie force people to do it at least partially the efficient 
PFTT way
 //           -if you need it to setup, use setup cmd
+// TODO run PHPTs for PECL extensions (the final layer of the ecosystem that 
pftt doesn't cover)
+//       geoip haru(pdf) http
+//       uploadprogress? xdiff? yaml? pthreads? dio?
+//       (after ported to windows) drizzle weakref fpdf gnupg  xdebug? 
suhosin?? 
 
 public class PfttMain {
        protected LocalHost host;
@@ -1288,12 +1292,16 @@ public class PfttMain {
                                
                                cmd_help();
                        } else if (command.equals("cmp-report")) {
-                               //PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_4-Result-Pack-rcfd096f-TS-X86-VC9"));
-                               //PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_4-Result-Pack-re9f996c-TS-X86-VC9"));
-                               PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-rc6e911e-TS-X86-VC11"));
-                               PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-rf3ebb40-TS-X86-VC11"));
-                               //PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-5.5.0beta1-NTS-X86-VC11"));
-                               //PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PHP_5_5-Result-Pack-5.5.0beta1-NTS-X64-VC11"));
+                               PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_3-Result-Pack-5.3.24RC1-TS-X86-VC9"));
+                               PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_3-Result-Pack-5.3.24RC1-TS-X86-VC9"));
+                               //PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_4-Result-Pack-5.4.14RC1-NTS-X86-VC9"));
+                               //PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_4-Result-Pack-5.4.14RC1-NTS-X86-VC9"));
+                               //PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_4-Result-Pack-re9f996c-NTS-X86-VC9"));
+                               //PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_4-Result-Pack-r85e5e60-NTS-X86-VC9"));
+                               //PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-rf3ebb40-NTS-X86-VC11"));
+                               //PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-r5d535a0-NTS-X86-VC11"));
+                               //PhpResultPack base_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-5.5.0beta1-TS-X86-VC11"));
+                               //PhpResultPack test_pack = 
PhpResultPackReader.open(cm, rt.host, new 
File("C:\\php-sdk\\PFTT-Auto\\PHP_5_5-Result-Pack-5.5.0beta2-TS-X86-VC11"));
                                
                                for ( AbstractPhpUnitRW base : 
base_pack.getPhpUnit() ) {
                                        for ( AbstractPhpUnitRW test : 
test_pack.getPhpUnit() ) {
@@ -1306,7 +1314,13 @@ public class PfttMain {
                                                PhpUnitReportGen 
php_unit_report = new PhpUnitReportGen(base, test);
                                                String html_str = 
php_unit_report.getHTMLString(cm, false);
 
-                                               File html_file = new 
File("c:\\php-sdk\\php_unit_report"+base.getScenarioSetNameWithVersionInfo()+".html");
+                                               String file_name = 
"PhpUnit_CMP_"+test.getTestPackNameAndVersionString()+"_"
+                                                               
+base.getBuildInfo().getBuildBranch()+"-"+base.getBuildInfo().getVersionRevision()+"-"+base.getBuildInfo().getBuildType()+"-"+base.getBuildInfo().getCPUArch()+"-"+base.getBuildInfo().getCompiler()+"_"+base.getScenarioSetNameWithVersionInfo()+
+                                                               "_v_"
+                                                               
+test.getBuildInfo().getBuildBranch()+"-"+test.getBuildInfo().getVersionRevision()+"-"+test.getBuildInfo().getBuildType()+"-"+test.getBuildInfo().getCPUArch()+"-"+test.getBuildInfo().getCompiler()+"_"+test.getScenarioSetNameWithVersionInfo();
+                                               if (file_name.length()>100)
+                                                       file_name = 
file_name.substring(0, 100);
+                                               File html_file = new 
File("c:\\php-sdk\\"+file_name+".html");
                                                FileWriter fw = new 
FileWriter(html_file);
                                                fw.write(html_str);
                                                fw.close();
@@ -1325,7 +1339,13 @@ public class PfttMain {
                                                PHPTReportGen phpt_report = new 
PHPTReportGen(base, test);
                                                String html_str = 
phpt_report.getHTMLString(cm, false);
 
-                                               File html_file = new 
File("c:\\php-sdk\\phpt_report"+base.getScenarioSetNameWithVersionInfo()+".html");
+                                               String file_name = "PHPT_CMP_"
+                                                               
+base.getBuildInfo().getBuildBranch()+"-"+base.getBuildInfo().getVersionRevision()+"-"+base.getBuildInfo().getBuildType()+"-"+base.getBuildInfo().getCPUArch()+"-"+base.getBuildInfo().getCompiler()+"_"+base.getScenarioSetNameWithVersionInfo()+
+                                                               "_v_"
+                                                               
+test.getBuildInfo().getBuildBranch()+"-"+test.getBuildInfo().getVersionRevision()+"-"+test.getBuildInfo().getBuildType()+"-"+test.getBuildInfo().getCPUArch()+"-"+test.getBuildInfo().getCompiler()+"_"+test.getScenarioSetNameWithVersionInfo();
+                                               if (file_name.length()>100)
+                                                       file_name = 
file_name.substring(0, 100);
+                                               File html_file = new 
File("c:\\php-sdk\\"+file_name+".html");
                                                FileWriter fw = new 
FileWriter(html_file);
                                                fw.write(html_str);
                                                fw.close();
diff --git a/src/com/mostc/pftt/model/core/EAcceleratorType.java 
b/src/com/mostc/pftt/model/core/EAcceleratorType.java
index 6738f40..f47aacf 100644
--- a/src/com/mostc/pftt/model/core/EAcceleratorType.java
+++ b/src/com/mostc/pftt/model/core/EAcceleratorType.java
@@ -21,7 +21,7 @@ public enum EAcceleratorType {
                        return AbstractCodeCacheScenario.NO;
                }
        },
-       OPTIMIZER_PLUS {
+       OPCACHE {
                @Override
                public AbstractCodeCacheScenario getCodeCacheScenario() {
                        return AbstractCodeCacheScenario.ZEND_OPTIMIZER_PLUS;
diff --git a/src/com/mostc/pftt/runner/AbstractLocalTestPackRunner.java 
b/src/com/mostc/pftt/runner/AbstractLocalTestPackRunner.java
index 9119700..0b96926 100644
--- a/src/com/mostc/pftt/runner/AbstractLocalTestPackRunner.java
+++ b/src/com/mostc/pftt/runner/AbstractLocalTestPackRunner.java
@@ -40,7 +40,7 @@ import com.mostc.pftt.scenario.ScenarioSet;
 import com.mostc.pftt.scenario.AbstractFileSystemScenario.ITestPackStorageDir;
 
 public abstract class AbstractLocalTestPackRunner<A extends ActiveTestPack, S 
extends SourceTestPack<A,T>, T extends TestCase> extends 
AbstractTestPackRunner<S, T> {
-       protected static final int MAX_THREAD_COUNT = 64;
+       protected static final int MAX_THREAD_COUNT = 256;
        protected S src_test_pack;
        protected final ConsoleManager cm;
        protected final ITestResultReceiver twriter;
diff --git a/src/com/mostc/pftt/scenario/BuiltinWebServerScenario.java 
b/src/com/mostc/pftt/scenario/BuiltinWebServerScenario.java
index f628b07..507c346 100644
--- a/src/com/mostc/pftt/scenario/BuiltinWebServerScenario.java
+++ b/src/com/mostc/pftt/scenario/BuiltinWebServerScenario.java
@@ -67,7 +67,7 @@ public class BuiltinWebServerScenario extends 
AbstractWebServerScenario {
        @Override
        public int getTestThreadCount(AHost host) {
                // XXX update this calculation from time to time as this web 
server's performance improves (probably decrease number)
-               return 16 * host.getCPUCount();
+               return 32 * host.getCPUCount();
        }
 
        @Override
diff --git a/src/com/mostc/pftt/scenario/OpcacheScenario.java 
b/src/com/mostc/pftt/scenario/OpcacheScenario.java
index d85cc4c..cca8625 100644
--- a/src/com/mostc/pftt/scenario/OpcacheScenario.java
+++ b/src/com/mostc/pftt/scenario/OpcacheScenario.java
@@ -8,22 +8,20 @@ import com.mostc.pftt.model.core.PhpIni;
 import com.mostc.pftt.results.ConsoleManager;
 import com.mostc.pftt.results.ConsoleManager.EPrintType;
 
-import java.util.Date;
-
 /** Opcache provides faster PHP execution through opcode caching and 
optimization.
  * It improves PHP performance by storing precompiled script bytecode in the 
shared memory. This
  * eliminates the stages of reading code from the disk and compiling it on 
future access. In
  * addition, it applies a few bytecode optimization patterns that make code 
execution faster.
  * 
+ * 5.5+ PHP builds include OpCache. This Scenario installs OpCache on 5.3 and 
5.4 builds. 
+ * 
  * Formerly known as Optimizer+, Zend Optimizer+, often abbreviated as o+ or 
zo+ or Optimizer Plus
  * 
- * @see http://windows.php.net/downloads/pecl/snaps/Optimizer/7.0.0-dev/
- * @see https://github.com/zend-dev/opcache
- * @see https://github.com/OSTC/opcache - fork for Windows/PHP on Windows
+ * @see http://windows.php.net/downloads/pecl/releases/opcache/7.0.1/
+ * @see https://github.com/zend-dev/ZendOptimizerPlus
  *
  */
 
-// TODO does it put memory mapped file in test-pack, build dir, or current 
dir??
 public class OpcacheScenario extends AbstractCodeCacheScenario {
        private String version;
 
@@ -31,9 +29,7 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
        public String getNameWithVersionInfo() {
                // this will return the PHP Version the DLL was build for (ex: 
5.4.10)
                // (Get-Item 
C:\php-sdk\php-5.4-ts-windows-vc9-x86-r064c62e\ext\php_opcache.dll).VersionInfo
-               
-               // TODO return "Opcache-" + (version==null?"Missing":version);
-               return "Opcache";
+               return version==null?"Opcache":"Opcache-"+version;
        }
        
        @Override
@@ -50,18 +46,48 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
                }
                if (found) {
                        if (cm!=null)
-                               cm.println(EPrintType.CLUE, getClass(), "Found 
OptimizerPlus in: "+ext_dir);
+                               cm.println(EPrintType.CLUE, getClass(), "Found 
OpCache in: "+ext_dir);
                        return true;
                } else {
+                       if (host.isWindows()) {
+                               // 5.3 and 5.4 builds don't include opcache. 
try to install it.
+                               try {
+                                       String dll_path = null;
+                                       switch(build.getVersionBranch(cm, 
host)) {
+                                       case PHP_5_3:
+                                               if (build.isNTS(host))
+                                                       dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.dll";
+                                               else
+                                                       dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.dll";
+                                               break;
+                                       case PHP_5_4:
+                                               if (build.isNTS(host))
+                                                       dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.dll";
+                                               else
+                                                       dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.dll";
+                                               break;
+                                       default:
+                                               break;
+                                       } // end switch
+                                       if (dll_path!=null) {
+                                               return host.exists(dll_path);
+                                       }
+                               } catch ( Exception ex ) {
+                                       if (cm!=null)
+                                               
cm.addGlobalException(EPrintType.SKIP_OPERATION, getClass(), "setup", ex, 
"failed to install opcache");
+                                       else
+                                               ex.printStackTrace();
+                               } 
+                       } // end if
                        if (cm!=null)
-                               cm.println(EPrintType.CLUE, getClass(), "Unable 
to find OptimizerPlus in: "+ext_dir);
+                               cm.println(EPrintType.CLUE, getClass(), "Unable 
to find OpCache in: "+ext_dir);
                        return false;
-               }
+               } // end if
        } // end public boolean isSupported
 
        @Override
        public EAcceleratorType getAcceleratorType() {
-               return EAcceleratorType.OPTIMIZER_PLUS;
+               return EAcceleratorType.OPCACHE;
        }
 
        @Override
@@ -72,6 +98,10 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
                        //
                        // in temp directory. name is like: 
ZendOptimizer+.MemoryBase@matt
                        // @see shared_alloc_win32.c 
(https://github.com/zend-dev/opcache/blob/master/shared_alloc_win32.c)
+                       //
+                       // for regular users, TEMP_DIR is often
+                       // for Apache (as service) TEMP_DIR is often 
C:\Users\NT_Authority? (different than IIS service)
+                       // for IIS (service) TEMP_DIR is often C:\Windows\Temp
                        
host.deleteIfExistsElevated(host.getTempDir()+"\\ZendOptimizer+.MemoryBase@"+host.getUsername());
                }
                
@@ -89,7 +119,43 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
                                dll_path = host.fixPath(ext_dir + 
"/php_opcache.dll");
                                
                                if (host.exists(dll_path.replace(".dll", 
".dont_load")))
+                                       // make sure PHP doesn't find it and 
load it automatically
                                        
host.moveElevated(dll_path.replace(".dll", ".dont_load"), dll_path);
+                               
+                               if (!host.exists(dll_path)) {
+                                       // try to install it for 5.3 and 5.4 
builds
+                                       try {
+                                               String src_dll_path = null;
+                                               
switch(build.getVersionBranch(cm, host)) {
+                                               case PHP_5_3:
+                                                       // @see #isSuccessful 
(it checks if these dlls exist!)
+                                                       if (build.isNTS(host))
+                                                               src_dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.3-nts-vc9-x86/php_opcache.dll";
+                                                       else
+                                                               src_dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.3-ts-vc9-x86/php_opcache.dll";
+                                                       break;
+                                               case PHP_5_4:
+                                                       if (build.isNTS(host))
+                                                               src_dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.4-nts-vc9-x86/php_opcache.dll";
+                                                       else
+                                                               src_dll_path = 
host.getPfttDir()+"/cache/dep/opcache/php_opcache-7.0.1-5.4-ts-vc9-x86/php_opcache.dll";
+                                                       break;
+                                               default:
+                                                       break;
+                                               } // end switch
+                                               if (src_dll_path!=null) {
+                                                       host.copy(src_dll_path, 
dll_path);
+                                                       
+                                                       // install succeeded
+                                                       version = "7.0.1"; // 
XXX detect version
+                                               }
+                                       } catch ( Exception ex ) {
+                                               if (cm!=null)
+                                                       
cm.addGlobalException(EPrintType.SKIP_OPERATION, getClass(), "setup", ex, 
"failed to install opcache");
+                                               else
+                                                       ex.printStackTrace();
+                                       } 
+                               }
                        } else {
                                dll_path = host.fixPath(ext_dir + 
"/php_opcache.so");
                                
@@ -97,7 +163,7 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
                                        
host.moveElevated(dll_path.replace(".so", ".dont_load"), dll_path);
                        }
                } catch ( Exception ex ) {
-                       cm.addGlobalException(EPrintType.CLUE, "setup", ex, 
"couldn't make sure OptimizerPlus was enabled");
+                       cm.addGlobalException(EPrintType.CLUE, "setup", ex, 
"couldn't make sure OpCache was enabled");
                        
                        return false;
                }
@@ -106,26 +172,9 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
                if (!host.exists(dll_path)) {
                        version = null;
                        
-                       return true;
+                       return false; // install failed
                }
                
-               //
-               {
-                       Date date = new Date(host.getMTime(dll_path));
-                       
-                       version = ((date.getYear()+1900) +
-                               "-" +
-                               (date.getMonth()+1) +
-                               "-" +
-                               date.getDate() +
-                               "-" +
-                               date.getHours() +
-                               "h" +
-                               date.getMinutes()) +
-                               "m";
-               }
-               //
-               
                // must be absolute path to opcache.so
                ini.putMulti("zend_extension", dll_path);
                
@@ -143,20 +192,17 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
                ini.putSingle("opcache.fast_shutdown", 1);
                ini.putSingle("opcache.enable_file_override", 1);
                
-               
-               // TODO 
                // by default all passes are run, turn off some
                /*ini.putSingle("opcache.optimization_level",
                                ZEND_OPTIMIZER_PASS_3
                                |ZEND_OPTIMIZER_PASS_10
+                               // passes other than 3 & 10 (especially 5 & 9) 
can break reflection (for Doctrine/Symfony)
                                //|ZEND_OPTIMIZER_PASS_4
                                //|ZEND_OPTIMIZER_PASS_6
                                //|ZEND_OPTIMIZER_PASS_7
                                //|ZEND_OPTIMIZER_PASS_8
                                //|ZEND_OPTIMIZER_PASS_1 
                                //|ZEND_OPTIMIZER_PASS_2
-                               
-                               // pass5 and pass9 seem to break reflection
                                //|ZEND_OPTIMIZER_PASS_5
                                //|ZEND_OPTIMIZER_PASS_9
                        );*/
@@ -182,7 +228,7 @@ public class OpcacheScenario extends 
AbstractCodeCacheScenario {
 
        @Override
        public String getName() {
-               return "Opcache";
+               return "OpCache";
        }
 
        @Override

Reply via email to