Search in sources :

Example 1 with CompileScope

use of php.runtime.env.CompileScope in project jphp by jphp-compiler.

the class ZendJvmTestCase method newScope.

@Override
protected CompileScope newScope() {
    CompileScope scope = super.newScope();
    scope.registerExtension(new ZendExtension());
    return scope;
}
Also used : CompileScope(php.runtime.env.CompileScope) ZendExtension(org.develnext.jphp.zend.ext.ZendExtension)

Example 2 with CompileScope

use of php.runtime.env.CompileScope in project jphp by jphp-compiler.

the class GeneratorsTest method newScope.

@Override
protected CompileScope newScope() {
    CompileScope scope = super.newScope();
    scope.registerExtension(new ZendExtension());
    return scope;
}
Also used : CompileScope(php.runtime.env.CompileScope) ZendExtension(org.develnext.jphp.zend.ext.ZendExtension)

Example 3 with CompileScope

use of php.runtime.env.CompileScope in project jphp by jphp-compiler.

the class DebugExtension method onRegister.

@Override
public void onRegister(final CompileScope scope) {
    if (scope.isDebugMode()) {
        String debugIdeKey = "JPHP_DEBUGGER";
        if (scope.configuration.containsKey("debug.ideKey")) {
            debugIdeKey = scope.configuration.get("debug.ideKey").toString();
        }
        String debugRootPath = "./src/";
        if (scope.configuration.containsKey("debug.rootPath")) {
            debugRootPath = scope.configuration.get("debug.rootPath").toString();
        }
        int debugPort = 9000;
        if (scope.configuration.containsKey("debug.port")) {
            debugPort = scope.configuration.get("debug.port").toInteger();
        }
        String debugHost = "127.0.0.1";
        if (scope.configuration.containsKey("debug.host")) {
            debugHost = scope.configuration.get("debug.host").toString();
        }
        final String finalDebugIdeKey = debugIdeKey;
        final String finalDebugRootPath = debugRootPath;
        final int finalDebugPort = debugPort;
        final DebugTickHandler tickHandler = new DebugTickHandler();
        scope.setTickHandler(tickHandler);
        final String finalDebugHost = debugHost;
        Thread debuggerThread = new Thread(new Runnable() {

            @Override
            public void run() {
                try {
                    final Debugger debugger = new Debugger(finalDebugPort, finalDebugHost);
                    scope.registerProgramShutdownHandler(new ProgramShutdownHandler() {

                        @Override
                        public void onShutdown(CompileScope scope, Environment env) {
                            debugger.shutdown();
                        }
                    });
                    if (debugger.isWorking()) {
                        debugger.setIdeKey(finalDebugIdeKey);
                        debugger.setRootPath(finalDebugRootPath);
                        debugger.run();
                    }
                    tickHandler.setDebugger(debugger);
                } catch (IOException e) {
                    throw new DebuggerException(e);
                }
            }
        });
        debuggerThread.setName("jphpDebuggerThread");
        debuggerThread.start();
    }
}
Also used : Debugger(org.develnext.jphp.debug.impl.Debugger) ProgramShutdownHandler(php.runtime.env.handler.ProgramShutdownHandler) CompileScope(php.runtime.env.CompileScope) DebuggerException(org.develnext.jphp.debug.impl.DebuggerException) Environment(php.runtime.env.Environment) IOException(java.io.IOException)

Example 4 with CompileScope

use of php.runtime.env.CompileScope in project jphp by jphp-compiler.

the class SqlJvmTestCase method newScope.

@Override
protected CompileScope newScope() {
    CompileScope scope = super.newScope();
    scope.registerExtension(new SqlExtension());
    return scope;
}
Also used : CompileScope(php.runtime.env.CompileScope) SqlExtension(org.develnext.jphp.ext.sql.SqlExtension)

Example 5 with CompileScope

use of php.runtime.env.CompileScope in project jphp by jphp-compiler.

the class ArgUnpackTest method newScope.

@Override
protected CompileScope newScope() {
    CompileScope scope = super.newScope();
    scope.registerExtension(new ZendExtension());
    return scope;
}
Also used : CompileScope(php.runtime.env.CompileScope) ZendExtension(org.develnext.jphp.zend.ext.ZendExtension)

Aggregations

CompileScope (php.runtime.env.CompileScope)11 ZendExtension (org.develnext.jphp.zend.ext.ZendExtension)3 Environment (php.runtime.env.Environment)3 IOException (java.io.IOException)1 DebugTick (org.develnext.jphp.debug.impl.DebugTick)1 Debugger (org.develnext.jphp.debug.impl.Debugger)1 DebuggerException (org.develnext.jphp.debug.impl.DebuggerException)1 JsoupExtension (org.develnext.jphp.ext.jsoup.JsoupExtension)1 SqlExtension (org.develnext.jphp.ext.sql.SqlExtension)1 WebServerExtension (org.develnext.jphp.ext.webserver.WebServerExtension)1 PWebRequest (org.develnext.jphp.ext.webserver.classes.PWebRequest)1 PWebResponse (org.develnext.jphp.ext.webserver.classes.PWebResponse)1 PWebServer (org.develnext.jphp.ext.webserver.classes.PWebServer)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 SplClassLoader (php.runtime.env.SplClassLoader)1 ProgramShutdownHandler (php.runtime.env.handler.ProgramShutdownHandler)1 Invoker (php.runtime.invoke.Invoker)1