/** * Terminate PHP Engine. */ public static void terminate() { if (engine != null) { if (phpthread != null && phpthread.isAlive()) { phpthread.interrupt(); } engine = null; inited = false; } } public static void StartUp() {
/** * Terminate PHP Engine. */ public static void terminate() { if (engine != null) { if (phpthread != null && phpthread.isAlive()) { phpthread.interrupt(); } engine = null; inited = false; } } public static void StartUp() {
/** * Setup any PHP internal data structures. This MUST be the * first function called for PHP module. * @param libraryName the name of the library to load */ public static boolean initialize(String libraryName) throws Exception { if (engine == null) { if (libraryName == null) engine = new Library(); else engine = new Library(libraryName); PHP_MAJOR_VERSION = version(1); PHP_MINOR_VERSION = version(2); PHP_PATCH_VERSION = version(3); } phpthread = new PhpThread(); phpthread.setDaemon(true); phpthread.start(); // Wait until the startup is done. while (!inited && phpthread.isAlive()) { Thread.currentThread().sleep(3000); } return inited; }
/** * Setup any PHP internal data structures. This MUST be the * first function called for PHP module. * @param libraryName the name of the library to load */ public static boolean initialize(String libraryName) throws Exception { if (engine == null) { if (libraryName == null) engine = new Library(); else engine = new Library(libraryName); PHP_MAJOR_VERSION = version(1); PHP_MINOR_VERSION = version(2); PHP_PATCH_VERSION = version(3); } phpthread = new PhpThread(); phpthread.setDaemon(true); phpthread.start(); // Wait until the startup is done. while (!inited && phpthread.isAlive()) { Thread.currentThread().sleep(3000); } return inited; }