fuelphp-storage / fuelphp

FuelPHP framework
http://fuelphp.com
MIT License
274 stars 57 forks source link

Problem collisions with Event of PHP libevent extension. #82

Closed vanht closed 6 years ago

vanht commented 6 years ago

I build RatchetPHP and install event extension, But conflict with fuelphp core Event. I can't config run Event of FuelPHP and Event of PHP extension.

Ratchetphp: http://socketo.me/docs/deploy event extentsion: https://pecl.php.net/package/event

WanWizard commented 6 years ago

Not very handy of Ratchat to create classes in the global namespace, collisions are always possible.

You can try not to use the global version for Fuel's class, but the namespaced one: \Fuel\Core\Event.

vanht commented 6 years ago

I don't use \Fuel\Core\Event, but in Fuel core in file /core/classes/fuel.php line 192 error. \Event::register('fuel-shutdown', 'Fuel::finish'); Can you any ideas help me? Thank you.

WanWizard commented 6 years ago

Hmm... Yes, the framework itself uses it too.

The only thing you can do is search the core code for "\Event::" (there are more than only this line, and change each one to "\Fuel\Core\Event::". And keep track of this when you upgrade Fuel, and hope Rachet starts using namespaces like the rest of the world...