Giter VIP home page Giter VIP logo

mod-lang-php's People

Contributors

alwinmark avatar kuujo avatar purplefox avatar sventech avatar vietj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mod-lang-php's Issues

print/echo in closure leads to NullPointerException

I opened this Issue once before in the old repo.

As the Test shows in my branch: https://github.com/CansaSCityShuffle/mod-lang-php/tree/test-print-in-proc

its currently not possible to print sth. in a Evenbus Handler callback, but in a normal callback, as the Test shows below.

The last guess was a quercus bug, but I think it has sth. to do with an uninitialized WriteStream. Therefore I tried to identify the Place where this should happen, but I'm struggeling with one thing:

In the PHP code I'm calling:

$this->eventBus = Vertx::eventBus()
:
$this->eventBus->registerHandler(String address, Closure callback)

When I take a look at Java classes, it seems to me that this method will be called:
https://github.com/vert-x/mod-lang-php/blob/master/src/main/java/io/vertx/lang/php/eventbus/EventBus.java#L90

But what happens with the env variable? I think, that this env variable is the key to solve this bug, so I hope you can help me out.

README.md links broken

All the README.md links point to Jordan's original repo, which now 404's.

Hope the wonderful documentation is not lost...

Implement new EventBus send timeouts

The Java eventbus now supports sends with timeout, also the Message class supports replies with timeouts.

We should expose this new functionality in the PHP API too

PhpVerticleFactory to pass Exceptions in Vertx reportException() to Php

I am trying to add a common features that is available in traditional PHP stack, global exception handling. I am modifying reportException() in PhpVerticleFactory.java

After compiling the class, all works fine but it throws an exception when I tried to run a module with:
vertx runmod xxxx -instances 2

Failed in deploying module
java.lang.ArrayIndexOutOfBoundsException: 256
at com.caucho.quercus.QuercusContext.setFunction(QuercusContext.java:1469)
at com.caucho.quercus.QuercusContext.initModuleInfo(QuercusContext.java:1963)
at com.caucho.quercus.QuercusContext.initModules(QuercusContext.java:1906)
at com.caucho.quercus.QuercusContext.init(QuercusContext.java:1835)
at io.vertx.lang.php.PhpVerticleFactory.initQuercusContext(PhpVerticleFactory.java:109)
at io.vertx.lang.php.PhpVerticleFactory.createVerticle(PhpVerticleFactory.java:178)
at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1527)
at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:722)

java.lang.NullPointerException
at io.vertx.lang.php.PhpVerticleFactory.initQuercusContext(PhpVerticleFactory.java:110)
at io.vertx.lang.php.PhpVerticleFactory.createVerticle(PhpVerticleFactory.java:178)
at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1527)
at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:722)

I noticed that in my compiled folder PhpVerticleFactory.java is compiled into 3 classes.
PhpVerticleFactory.class
PhpVerticleFactory$1.class
PhpVerticleFactory$PhpVerticle.class

while the php mod install/downloaded from vertx registry only has
PhpVerticleFactory.class
PhpVerticleFactory$PhpVerticle.class

ArrayIndexOutOfBoundsException when running with vertx -instances command

When running script with more than 1 instance, latest mod-lang-php with vertx 2.1M will throw ArrayIndexOutOfBoundsException:

vertx run index.php -instances 2

java.lang.ArrayIndexOutOfBoundsException: 256
at com.caucho.quercus.QuercusContext.setFunction(QuercusContext.java:1469)
at com.caucho.quercus.QuercusContext.initModuleInfo(QuercusContext.java:1963)
at com.caucho.quercus.QuercusContext.initModules(QuercusContext.java:1906)
at com.caucho.quercus.QuercusContext.init(QuercusContext.java:1835)
at io.vertx.lang.php.PhpVerticleFactory.initQuercusContext(PhpVerticleFactory.java:109)
at io.vertx.lang.php.PhpVerticleFactory.createVerticle(PhpVerticleFactory.java:178)
at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1541)
at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
at io.vertx.lang.php.PhpVerticleFactory.initQuercusContext(PhpVerticleFactory.java:110)
at io.vertx.lang.php.PhpVerticleFactory.createVerticle(PhpVerticleFactory.java:178)
at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1541)
at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
at io.vertx.lang.php.PhpVerticleFactory.initQuercusContext(PhpVerticleFactory.java:110)
at io.vertx.lang.php.PhpVerticleFactory.createVerticle(PhpVerticleFactory.java:178)
at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1541)
at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:722)

"include" modules not included

Currently, the PHP implementation does nothing to support including modules. Obviously this is an important aspect of the new Vert.x module system. Allowing PHP libraries to be included via the Vert.x mod.json file may require some creativity. The PhpVerticleFactory will most certainly need to be refactored to use a single engine for all PHP verticles within a Vert.x instance. I've played with this a little bit. What is required is to be able to execute multiple scripts within the same engine, but I haven't come up with an elegant solution yet. Pull requests are welcome :-)

SockJS Eventbus hook incomplete

I found that the SockJS implementation in mod php isn't complete:
public SockJSServer setHook(Env env, ObjectValue hook) {
return this;
}

It should reflect what the Java api did at https://github.com/eclipse/vert.x/blob/master/vertx-core/src/main/java/org/vertx/java/core/sockjs/impl/DefaultSockJSServer.java

public SockJSServer setHook(EventBusBridgeHook hook) {
this.hook = hook;
return this;
}

Not quite sure how do you map this back to a language mod like mod php.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.