Download the PHP package itxiao6/laravel-s without Composer

On this page you can find all versions of the php package itxiao6/laravel-s. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

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.
Please rate this library. Is it a good library?

Informations about the package laravel-s

🚀 Speed up Laravel/Lumen by Swoole, let's fly.

Latest Stable Version Latest Unstable Version Total Downloads License Build Status Code Intelligence Status

中文文档

Features

Requirements

Dependency Requirement
PHP >= 5.5.9
Swoole >= 1.7.19 The Newer The Better No longer support PHP5 since 2.0.12
Laravel/Lumen >= 5.1
Gzip[optional] zlib, be used to compress the HTTP response, check by ldconfig -p|grep libz
Inotify[optional] inotify, be used to reload all worker processes when your code is modified, check by php --ri inotify

Install

1.Require package via Composer(packagist).

2.Register service provider.

3.Publish configuration.

Suggest that do publish after upgrade LaravelS every time

Special for Lumen: you DO NOT need to load this configuration manually in bootstrap/app.php file, LaravelS will load it automatically.

4.Change config/laravels.php: listen_ip, listen_port, refer Settings.

Run demo

php artisan laravels {start|stop|restart|reload|publish}

Command Description
start Start LaravelS, list the processes by ps -ef|grep laravels
stop Stop LaravelS
restart Restart LaravelS
reload Reload all worker processes(Contain your business & Laravel/Lumen codes), exclude master/manger process
publish Publish configuration file laravels.php into folder config

Cooperate with Nginx (Recommended)

Cooperate with Apache

Enable WebSocket server

The Listening address of WebSocket Sever is the same as Http Server.

1.Create WebSocket Handler class, and implement interface WebSocketHandlerInterface.

2.Modify config/laravels.php.

3.Use swoole_table to bind FD & UserId, optional, Swoole Table Demo. Also you can use the other global storage services, like Redis/Memcached/MySQL, but be careful that FD will be possible conflicting between multiple Swoole Servers.

4.Cooperate with Nginx (Recommended)

Refer WebSocket Proxy

Listen events

System events

Usually, you can reset/destroy some global/static variables, or change the current Request/Response object.

Customized asynchronous events

This feature depends on AsyncTask of Swoole, your need to set swoole.task_worker_num in config/laravels.php firstly. The performance of asynchronous event processing is influenced by number of Swoole task process, you need to set task_worker_num appropriately.

1.Create event class.

2.Create listener class.

3.Bind event & listeners.

4.Fire event.

Asynchronous task queue

This feature depends on AsyncTask of Swoole, your need to set swoole.task_worker_num in config/laravels.php firstly. The performance of task processing is influenced by number of Swoole task process, you need to set task_worker_num appropriately.

1.Create task class.

2.Deliver task.

Millisecond cron job

Wrapper cron job base on Swoole's Millisecond Timer, replace Linux Crontab.

1.Create cron job class.

2.Bind cron job.

3.Note: it will launch multiple timers when build the server cluster, so you need to make sure that launch one timer only to avoid running repetitive task.

Get the instance of swoole_server in your project

Use swoole_table

1.Define swoole_table, support multiple.

All defined tables will be created before Swoole starting.

2.Access swoole_table: all table instances will be bound on swoole_server, access by app('swoole')->xxxTable.

Multi-port mixed protocol

For more information, please refer to Swoole Server AddListener

To make our main server support more protocols not just Http and WebSocket, we bring the feature multi-port mixed protocol of Swoole in LaravelS and name it Socket. Now, you can build TCP/UDP applications easily on top of Laravel.

  1. Create socket handler class, and extend Hhxsv5\LaravelS\Swoole\Socket\{TcpSocket|UdpSocket|Http|WebSocket}.

These Socket connections share the same worker processes with your HTTP/WebSocket connections. So it won't be a problem at all if you want to deliver tasks, use swoole_table, even Laravel components such as DB, Eloquent and so on. At the same time, you can access swoole_server_port object directly by member property swoolePort.

  1. Register Sockets.

For TCP socket, onConnect and onClose events will be blocked when dispatch_mode of Swoole is 1/3, so if you want to unblock these two events please set dispatch_mode to 2/4/5.

  1. Test.
  1. Register example of other protocols.

Coroutine MySQL

Support coroutine client for MySQL database.

1.Requirements: Swoole>=4.0, Laravel>=5.1(Lumen will be supported later).

2.Change the driver of MySQL connection to sw-co-mysql in file config/database.php.

3.Replace Illuminate\Database\DatabaseServiceProvider::class of providers to \Hhxsv5\LaravelS\Illuminate\Database\DatabaseServiceProvider::class in file config/app.php.

4.Now, you just use QueryBuilder and ORM as usual. (Alpha stage, there should be some bugs, please give us your feedback).

Important notices

  1. Redis connection, it won't reconnect automatically immediately after disconnect, and will throw an exception about lost connection, reconnect next time. You need to make sure that SELECT DB correctly before operating Redis every time.

Todo list

  1. Connection pool for MySQL/Redis.

  2. Wrap coroutine clients for MySQL(alpha stage)/Redis/Http.

Alternatives

License

MIT


All versions of laravel-s with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
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 itxiao6/laravel-s contains the following files

Loading the files please wait ....