Rymfony
A command-line tool built in Rust to run an HTTP+PHP server for development (and production? π)
Install / Use
/learn @Orbitale/RymfonyREADME
Rymfony
Rymfony is a command-line tool to mimic the behavior of the Symfony CLI binary.
Install
To install Rymfony, download your version from the latest release on the Releases page.
Download latest dev builds
The binary is built on every push to the main branch, if the binary can be built of course, and pushed to nightly.link.
This allows you to test the latest version right away!
Here are the links to download them:
Unzip the file and put the rymfony executable file in your PATH, and you're set!
If you need more architectures and OSes, feel free to check the CI.yaml Github Action and contribute for more!
Download on Linux
curl -sSL https://nightly.link/Orbitale/Rymfony/workflows/CI.yaml/main/rymfony.ubuntu.zip -o rymfony.zip && unzip rymfony.zip && sudo mv rymfony /usr/bin/rymfony && sudo chmod a+x /usr/bin/rymfony && rm rymfony.zip
Download on Windows
With cmd (powershell must be accessible):
powershell Invoke-WebRequest https://nightly.link/Orbitale/Rymfony/workflows/CI.yaml/main/rymfony.windows.zip -OutFile rymfony.zip && powershell Expand-Archive -Force rymfony.zip . && rm rymfony.zip
With Powershell directly:
Invoke-WebRequest https://nightly.link/Orbitale/Rymfony/workflows/CI.yaml/main/rymfony.windows.zip -OutFile rymfony.zip && Expand-Archive -Force rymfony.zip . && rm rymfony.zip
Then, add the rymfony.exe executable somewhere in your PATH.
Download on MacOS
curl -sSL https://nightly.link/Orbitale/Rymfony/workflows/CI.yaml/main/rymfony.macOS.zip -o rymfony.zip && unzip rymfony.zip && sudo mv rymfony /usr/local/bin/rymfony && sudo chmod a+x /usr/local/bin/rymfony && rm rymfony.zip
Manual build
- First, install Rust following the Official guide.
- Clone the repository on your machine with this command:<br>
git clone git@github.com:Orbitale/Rymfony.git. - Then, run
cargo build --release. - Done!<br>
The binary will be stored in
./target/release/rymfony(with.exeextension on Windows), you can use it directly!
Usage
Run rymfony help to see the list of available commands:
$ rymfony
rymfony 0.1.0-dev
Alex Rock <alex@orbitale.io>
A command-line tool to spawn a PHP server behind an HTTP FastCGI proxy,
inspired by Symfony CLI, but open-source.
https://github.com/Orbitale/Rymfony
USAGE:
rymfony [FLAGS] [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-q, --quiet Do not display any output. Has precedence over -v|--verbose
-V, --version Prints version information
-v, --verbose Set the verbosity level. -v for debug, -vv for trace, -vvv to trace executed modules
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
new:symfony Create a new Symfony project
php:list List all available PHP executables.
server:ca:install Create and install a local Certificate Authority for serving HTTPS
server:ca:uninstall Uninstall the local Certificate Authority
server:start Runs an HTTP server
stop Stops a potentially running HTTP server
Note: For any command, you can use the -h|--help flag to display its details too. If you are familiar with the Symfony console component it is very much similar.
Commands
rymfony serve (or server:start)
This command allows you to run a web server, in foreground or background, and you can customize the port to listen to.
$ rymfony serve --help
rymfony-server:start
Runs an HTTP server
USAGE:
rymfony server:start [FLAGS] [OPTIONS]
FLAGS:
--allow-http Do not redirect HTTP request to HTTPS
-d, --daemon Run the server in the background
-s, --expose-server-header Add server header into all response
-h, --help Prints help information
--no-tls Disable TLS. Use HTTP only.
-V, --version Prints version information
OPTIONS:
--document-root <document-root> Project's document root
--passthru <passthru> The PHP script all requests will be passed to
--port <port> The TCP port to listen to [default: 8000]
rymfony stop
If a server is running in the background running for the current project, it will be stopped.
Note that this is checked via a .pid file, containing the PID of the running server.
rymfony php:list
This will list all existing php binaries in your environment.
It will actually search in the PATH directories for any binary that matches some patterns like these:
- On Windows:
php.exephpX.Y.exephp-cgi.exephpX.Y-cgi.exephp-cgiX.Y.exe
- On other platforms:
phpphpX.Yphp-fpmphp-cgiphpX.Y-fpmphpX.Y-cgiphp-fpmX.Yphp-cgiX.Y
More locations for standard PHP installations that are searched can be found in binaries.rs.
βΉNote: if your PHP binary is not detected, please open an issue so we can add support for it!
Here is the output from an Ubuntu 20.04 machine:
$ rymfony php:list
βββββββββββ¬ββββββββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββ¬βββββββββ
| Version | PHP CLI | PHP FPM | PHP CGI | System |
βββββββββββΌββββββββββββββββββΌβββββββββββββββββββββββΌββββββββββΌβββββββββ€
| 7.4.11 | /usr/bin/php7.4 | /usr/sbin/php-fpm7.4 | | * |
βββββββββββ΄ββββββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββ΄βββββββββ
Windows 10:
> rymfony php:list
βββββββββββ¬βββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββββββββββ¬βββββββββ
| Version | PHP CLI | PHP FPM | PHP CGI | System |
βββββββββββΌβββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββββββββΌβββββββββ€
| 7.4.2 | E:\dev\php74\php.exe | | E:\dev\php74\php-cgi.exe | * |
βββββββββββ΄βββββββββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββββββββββ΄βββββββββ
macOS Catalina (using Homebrew):
$ rymfony php:list
βββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββ
| Version | PHP CLI | PHP FPM | PHP CGI | System |
βββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββ€
| 5.5.5 | /usr/local/php5-5.5.5-20131020-222726/bin/php | | /usr/local/php5-5.5.5-20131020-222726/bin/php-cgi | |
| 7.3.11 | /usr/bin/php | /usr/sbin/php-fpm | | |
| 7.3.21 | /usr/local/Cellar/php@7.3/7.3.21/bin/php | | /usr/local/Cellar/php@7.3/7.3.21/bin/php-cgi | |
| 7.4.9 | /usr/local/Cellar/php/7.4.9/bin/php | /usr/local/Cellar/php/7.4.9/sbin/php-fpm | /usr/local/Cellar/php/7.4.9/bin/php-cgi | * |
βββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββ
βΉ Note: To search for PHP executables in a custom folder, you can define the RYMFONY_PATH environment variable.
On *nix systems, you must use the colon : path separator.<br>
On Windows systeme use the semi-colon ; path separator.
# *nix
$ export RYMFONY_PATH=/home/php/php-dev:/var/local/php-dev
# Windows
> set RYMFONY_PATH=c:\php7.4;d:\php8.0;d:\php7.3
Roadmap
If you want to contribute to any of these points, feel free to do it!
- π© : Done
- π¨ : In progress (a PR should be linked)
- π₯ : Planned, but not started yet
To do (order of priority, done first):
- Commands and command-line options
- π© Add a
stopcommand. - π₯ Create
open:localcommand. - π© Create
server:logscommand (needs #81 first). - π₯ Create
server:listcommand. - π₯ Create
server:statuscommand. - π₯ Create
configcommand, to display project's config, and maybe change it. - π₯ Create
phpcommand (should use the configured PHP version). - π₯ Create
consolecommand for Symfony (should use the configured PHP version, and be compatible with SF 2+). - π₯ Create
artisancommand for Laravel (should use the configured PHP version). - π₯ Propagate global app arguments so they can be used in subcommands (like
rymfony serve -v, because if you want verbosity today, you need to pass the option before the subcommand, like this:rymfony -v serve). Maybe this can be in theclapcrate itself (the CLI app package used by Rymfony).
- π© Add a
- Releases
- π© Publish nightly builds of the binary as artifacts by using Github Ac
