Download the PHP
package neoan.io/broadcast without Composer
On this page you can find all versions of the php package
neoan.io/broadcast. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Designed for LENKRAD, but agnostic enough to be used in any framework.
Make any database a live-database
Installation
1. install package
composer require neoan.io/broadcast
2. Add required ENV-variables to your .env
JWT_SECRET (your encryption key)
SOCKET_SERVER_PORT (e.g. 3000)
SOCKET_SERVER_URL (e.g. "localhost")
3. Add the following script to your composer.json
4. Run said script
composer run install-socket
5. Install required node packages
yarn install or npm install
6. Test socket-server
yarn sockert-server or npm run socket-server
Setup
Client functionality
This package includes a client-library to automate synchronization with your database.
In LENKRAD, you would typically expose the library via a route:
And then use it in whatever capacity you need at the front-end:
Backend
Two things need to happen in order for the synchronization to work.
Firstly, a returned entity must expose the socket-information (including auth).
We can achieve this with ForClient::wrapEntity. A typical API-route
could look like this:
Next, we want to set a hook for whenever the model is written to.
In LENKRAD, we can use the Model::afterStore method to achieve this.
Our Note-model could look like this:
We don't have to worry about any specific code in our update routes.
Given the example, it could look like this:
Frontend usage
Acknowledgements
The proxy-logic is based on a modified version of Sindre Sorhus' on-change.
Make sure to leave a star ;-)
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package neoan.io/broadcast contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.