Search in sources :

Example 6 with ModuleDumper

use of php.runtime.loader.dump.ModuleDumper in project jphp by jphp-compiler.

the class StandaloneLoader method _fetch.

protected ModuleEntity _fetch(String name, Map<String, Module> source) {
    Module module = source.get(name);
    if (module == null) {
        return null;
    }
    InputStream input = classLoader.getResourceAsStream(module.internalName + ".dump");
    if (input == null) {
        return null;
    }
    ModuleDumper moduleDumper = new ModuleDumper(new Context(new File(module.name)), env, true);
    try {
        return moduleDumper.load(input);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : Context(php.runtime.env.Context) DataInputStream(java.io.DataInputStream) InputStream(java.io.InputStream) IOException(java.io.IOException) ModuleDumper(php.runtime.loader.dump.ModuleDumper) File(java.io.File)

Aggregations

ModuleDumper (php.runtime.loader.dump.ModuleDumper)6 File (java.io.File)2 InputStream (java.io.InputStream)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DataInputStream (java.io.DataInputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 Test (org.develnext.jphp.core.tester.Test)1 Memory (php.runtime.Memory)1 AbstractCompiler (php.runtime.common.AbstractCompiler)1 Context (php.runtime.env.Context)1 CustomErrorException (php.runtime.exceptions.CustomErrorException)1 ErrorException (php.runtime.exceptions.support.ErrorException)1 UncaughtException (php.runtime.lang.UncaughtException)1 BaseBaseException (php.runtime.lang.exception.BaseBaseException)1 ArrayMemory (php.runtime.memory.ArrayMemory)1 ModuleEntity (php.runtime.reflection.ModuleEntity)1 PrintF (php.runtime.util.PrintF)1