Download the PHP package luracast/restler without Composer

On this page you can find all versions of the php package luracast/restler. 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 restler

Restler v6

Latest Stable Version Total Downloads License

Write your API logic in PHP. Get routing, validation, and OpenAPI docs—automatically.

Production-ready since 2010. Battle-tested. Now rebuilt for modern PHP 8+ with async superpowers.

That's it. You just created a REST API that:

No controllers. No routing files. No configuration. Just PHP.


Why Restler in 2025?

🎯 Zero Boilerplate

While other frameworks make you write controllers, routes, DTOs, validation rules, and transformers—Restler uses PHP reflection to do it all automatically. Write business logic, not plumbing.

Async Performance

Run on Swoole/OpenSwoole for 10-20x throughput vs traditional PHP-FPM. Or use ReactPHP for true async I/O. Deploy to AWS Lambda for serverless scale.

🌐 Multi-Format Output

JSON is the default format. Configure additional formats (XML, CSV, Excel, HTML) via Routes::setOverridingResponseMediaTypes(). Perfect for:

🚀 Modern PHP 8+

Built for PHP 8 with attributes, union types, named arguments, and strict typing. PSR-7 and PSR-11 compliant.

📚 Auto-Generated Docs

OpenAPI 3.0 (Swagger) docs generated from your PHPDoc comments. Interactive API explorer included.


Real-World Use Cases

🏢 Internal APIs & Microservices

Perfect for building internal APIs that need to integrate with various systems. Multi-format support means you can serve JSON to your React app and XML to that ancient CRM system—from the same endpoint.

📱 Mobile Backend

Low latency on Swoole, automatic validation, built-in rate limiting, and OAuth2 support. Everything you need for a production mobile backend.

📊 Data Export APIs

Built-in CSV and Excel streaming support. Export millions of rows without running out of memory using generators.

🔗 Legacy System Integration

Need to modernize an old PHP app? Add Restler to get a REST API instantly. Works alongside existing code—no rewrite needed.


Quick Start

Install

Create Your First API (3 files)

1. API Class (api/Hello.php)

2. Gateway (public/index.php)

3. URL Rewriting (.htaccess or nginx.conf)

Test It

That's it! You have a working REST API with automatic routing, validation, and multi-format support.


Production Deployment

Traditional (Apache/Nginx + PHP-FPM)

Standard deployment. Works everywhere. ~1,000-2,000 req/sec depending on hardware.

High Performance (Swoole/OpenSwoole)

10-20x faster than PHP-FPM. Persistent connections, coroutines, built-in HTTP server.

Benchmarks: 15,000+ req/sec on modest hardware (vs ~1,000 for PHP-FPM)

Async I/O (ReactPHP)

True non-blocking async operations. Perfect for I/O-heavy workloads (database, HTTP calls, etc.).

Serverless (AWS Lambda)

Zero-downtime deploys, automatic scaling, pay-per-request pricing.

See public/index_lambda.php for complete example.

Event-Driven (Workerman)

Alternative to Swoole with pure PHP implementation (no extension required).


What's New in v6

🔥 Breaking Changes from v5

Migration Guide →

New Features

Modern PHP 8 Support

Async & Performance

Enhanced Security

Developer Experience

Multi-Format Support

All formats work automatically—just add file extension to URL:


Advanced Examples

API Versioning

Usage:

Authentication & Rate Limiting

Database Integration

Automatic REST endpoints:

File Uploads

Streaming Large Datasets

Custom Routing

GraphQL Support

CORS Configuration


Interactive API Explorer

Restler includes a built-in Swagger UI explorer:

Visit http://localhost:8080/explorer to:

The explorer is auto-generated from your PHPDoc comments—no manual work needed.


Testing

Restler includes 18+ working examples and a full Behat test suite.

Run Built-in Tests

Results: 310/310 scenarios passing ✅

Write Your Own Tests

Example Projects

Try the included examples:


Performance Tips

1. Enable Production Mode

2. Use Swoole/OpenSwoole

10-20x performance improvement over PHP-FPM. Same code, no changes needed.

3. Use Generators for Large Datasets

4. Cache Expensive Operations

5. Optimize Database Queries


Framework Comparison

Feature Restler v6 Laravel Symfony Slim
Auto-routing from methods
Multi-format (JSON/XML/CSV/Excel) Partial Partial
Auto OpenAPI docs Via package Via package Via package
Swoole support Via package Via package
Zero config Partial
Lines of code for CRUD API ~20 ~100 ~150 ~50
Learning curve Very Low Medium High Low
Best for APIs Full-stack Enterprise Microservices

Restler Philosophy: Write business logic. Get the REST for free.


Migration from v5

Upgrading from Restler v5? Most code works unchanged. Key changes:

Requirements

Type Hints (Recommended)

Breaking Changes

Full migration guide: MIGRATION.md


Documentation


FAQ

When should I use Restler?

Great for:

Not ideal for:

How is this different from Laravel/Symfony?

Restler is laser-focused on APIs. Laravel and Symfony are full-stack frameworks that can build APIs, but require significantly more boilerplate. Restler uses reflection to eliminate boilerplate entirely.

Example: A CRUD API in Laravel requires routes, controllers, form requests, and resources (~100 lines). In Restler it's ~20 lines.

Is Swoole support production-ready?

Yes! Swoole has been production-ready since 2018. Used by companies like Alibaba, Tencent, and Baidu. OpenSwoole is a fork with the same stability. Both work identically with Restler.

Does it work with [my favorite ORM/database]?

Yes! Restler is database-agnostic. Use Eloquent, Doctrine, RedBeanPHP, PDO, or anything else. Examples included for all major ORMs.

Can I use it with Docker/Kubernetes?

Absolutely. Dockerfile examples included. Works great in containers, especially with Swoole for high performance.

Is it really production-ready?

Yes! Restler has been used in production since 2010. v6 is a complete rewrite for modern PHP 8+ with security improvements and async support. Currently powers APIs handling millions of requests daily.

What's the performance like?

Actual numbers depend on your application logic and hardware.


Support & Community


Contributing

We welcome contributions! Whether it's:

See CONTRIBUTING.md for guidelines.

Development Setup


License

Restler is open-source software licensed under the MIT License.

Free for commercial and personal use.


Credits

Created and maintained by Luracast

Special thanks to all contributors who have helped make Restler better over the years!

### **Ready to build better APIs?** **Write PHP. Get REST. 🚀** [Get Started](#quick-start) • [Examples](#examples) • [Documentation](#documentation) • [Star on GitHub ⭐](https://github.com/Luracast/Restler)

All versions of restler with dependencies

PHP Build Version
Package Version
Requires php Version ^8
ext-json Version *
psr/container Version ^2.0
guzzlehttp/guzzle Version ^7.5
ralouphie/getallheaders Version ^3
logicalsteps/async Version ^2.0
hansott/psr7-cookies Version ^3.0
ringcentral/psr7 Version ^1.3
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 luracast/restler contains the following files

Loading the files please wait ...