jaxl / JAXL

Asynchronous, non-blocking I/O, event based PHP library for writing custom TCP/IP client and server implementations. From it's previous versions, library inherits a full blown stable support for XMPP protocol stack. In v3.0, support for HTTP protocol stack was also added.
http://jaxl.readthedocs.org/
Other
379 stars 121 forks source link

unable to include jaxl #99

Open andrei-pmbcn opened 5 years ago

andrei-pmbcn commented 5 years ago

I downloaded the git repository's zip file and copied src/JAXL into a new directory, from which I required jaxl.php . This gave me the following error:

Uncaught Error: Class 'XMPPStream' not found in [path]\jaxl.php:53 (where [path] is the path to the copied JAXL library)

Attempting to package the library into a phar file and require that file in my project gave me the same error. It seems the problem lies with JAXL not autoloading classes.

How do I get jaxl to run given this situation? If the solution is obvious, I apologize, as I haven't worked with PHP libraries for very long.

lrirwin commented 5 years ago

I've got it working with regular "require" loading. Not as efficient, but it works and leaves composer out of the mix. The loading order is important...

require 'core/jaxl_cli.php'; require 'core/jaxl_client_base.php'; require 'core/jaxl_clock.php'; require 'core/jaxl_event.php'; require 'core/jaxl_exception.php'; require 'core/jaxl_fsm.php'; require 'core/jaxl_logger.php'; require 'core/jaxl_loop.php'; require 'core/jaxl_pipe.php'; require 'core/jaxl_sock5.php'; require 'core/jaxl_socket_client.php'; require 'core/jaxl_socket_server.php'; require 'core/jaxl_util.php'; require 'core/jaxl_xml_access.php'; require 'core/jaxl_xml_stream.php'; require 'core/jaxl_xml.php'; require 'http/http_client.php'; require 'http/http_dispatch_rule.php'; require 'http/http_dispatcher.php'; require 'http/http_multipart.php'; require 'http/http_request.php'; require 'http/http_server.php'; require 'jaxlctl.php'; require 'xmpp/xmpp.php'; require 'xmpp/xmpp_jid.php'; require 'xmpp/xmpp_roster_item.php'; require 'xmpp/xmpp_stanza.php'; require 'xmpp/xmpp_pres.php'; require 'xmpp/xmpp_msg.php'; require 'xmpp/xmpp_iq.php'; require 'xmpp/xmpp_stream.php'; require 'xmpp/xmpp_xep.php'; require 'xep/xep_0030.php'; require 'xep/xep_0045.php'; require 'xep/xep_0060.php'; require 'xep/xep_0077.php'; require 'xep/xep_0114.php'; require 'xep/xep_0115.php'; require 'xep/xep_0199.php'; require 'xep/xep_0203.php'; require 'xep/xep_0206.php'; require 'xep/xep_0249.php'; require 'jaxl.php';

Hope that helps!