Download the PHP package monkeyscloud/monkeyslegion-dev-server without Composer

On this page you can find all versions of the php package monkeyscloud/monkeyslegion-dev-server. 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 monkeyslegion-dev-server

MonkeysLegion Dev Server

A lightweight, hot-reload development server for MonkeysLegion applications. Built on PHP's native web server with automatic file watching and zero configuration.

Features

Requirements

Installing entr

Installation

Via Composer (Recommended)

Manual Installation

  1. Clone or download this package to your project's vendor directory
  2. Ensure the autoloader is configured correctly
  3. Copy the bin/dev-server script to your project's bin/ directory

Quick Start

That's it! Your MonkeysLegion app is now running with hot-reload enabled.

Usage

Basic Commands

Environment Variables

You can set default host and port via environment variables:

Programmatic Usage

How It Works

Hot Reload

The dev server offers two file watching methods, automatically selecting the best available option:

1. entr (Recommended)

When entr is installed, the dev server uses it for efficient file watching. This is the fastest and most resource-friendly method.

Advantages:

Installation:

2. FileWatcher (Built-in Fallback)

When entr is not available, the dev server automatically falls back to a pure PHP file watcher. No external dependencies required!

Advantages:

How it works:

Performance note: The pure PHP watcher is slightly less efficient than entr as it uses polling. For production-like performance testing, install entr.

Choosing Your Method

The dev server automatically selects the best available method:

You can also force the use of FileWatcher programmatically:

opcache Configuration

Both methods disable PHP's opcache for CLI mode so changes are reflected immediately without manual restart:

Directory Structure

Routing

The dev server uses a smart router that:

  1. Serves static files directly from public/ if they exist
  2. Routes all other requests through public/index.php
  3. Handles pretty URLs and rewrite rules automatically

Configuration

Custom Document Root

By default, the server uses public/ as the document root. You can customize this:

Custom Router Script

The server looks for a router script in this order:

  1. {project}/bin/dev-router.php (your custom router)
  2. {project}/vendor/monkeyscloud/monkeyslegion-dev-server/bin/dev-router.php (default)

Create your own router in bin/dev-router.php if you need custom routing logic:

Watched Directories

To customize which directories are watched for changes, edit the dev-server script:

Advanced Usage

Running on a Network

To make your dev server accessible from other devices on your network:

Multiple Instances

You can run multiple dev servers on different ports:

Note: Each instance needs its own PID file, so you may need to modify the getPidFile() method to include the port number.

Production Warning

⚠️ Never use this dev server in production!

This server is designed for development only. For production, use:

Troubleshooting

Server Won't Stop

If ./bin/dev-server stop doesn't work:

Port Already in Use

Hot Reload Not Working

With entr:

  1. Check if entr is installed:

  2. Verify opcache is disabled:

  3. Check watched directories exist:

With FileWatcher (pure PHP):

  1. Check which method is being used:

  2. Check file permissions:

  3. Manually restart if needed:

General troubleshooting:

  1. Manual restart:

Changes Not Appearing

If your code changes aren't showing up:

  1. Hard refresh your browser - Ctrl+Shift+R (or Cmd+Shift+R on Mac)
  2. Check browser cache - Open DevTools → Network → Disable cache
  3. Restart the server - ./bin/dev-server restart
  4. Check PHP error logs - Look for syntax errors

Permission Denied

Technical Details

PHP Configuration

The server runs with these PHP settings:

Process Management

File Watching

When entr is available, the server watches these file patterns:

Changes to any of these files trigger an automatic server restart.

API Reference

DevServer Class

serve(string $host, int $port, ?string $docRoot): void

Start the development server.

Parameters:

Example:

stop(): void

Stop the running development server.

Example:

restart(string $host, int $port): void

Restart the development server.

Parameters:

Example:

status(): void

Check the status of the development server.

Example:

Comparison with Other Tools

Feature MonkeysLegion DevServer Symfony Local Server Laravel Valet php -S
Hot Reload ✅ Yes (with entr) ✅ Yes ✅ Yes ❌ No
Zero Config ✅ Yes ⚠️ Partial ⚠️ Requires setup ✅ Yes
Process Management ✅ Yes (start/stop/restart) ✅ Yes ✅ Yes ❌ Manual
Multiple Projects ⚠️ Different ports ✅ Yes ✅ Yes ❌ No
HTTPS Support ❌ No ✅ Yes ✅ Yes ❌ No
Framework Agnostic ✅ Yes ⚠️ Symfony-focused ⚠️ Laravel-focused ✅ Yes
Installation Composer Binary Binary Built-in

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

Running Tests

License

This package is open-source software licensed under the MIT license.

Credits

Support

Changelog

1.0.1 (2025-11-19)

1.0.0 (2024-01-01)


Made with ❤️ by the MonkeysCloud team


All versions of monkeyslegion-dev-server with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-posix Version *
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 monkeyscloud/monkeyslegion-dev-server contains the following files

Loading the files please wait ...