Download the PHP package rad/rad-framework without Composer

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

RAD Framework

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require Maintainability

RAD Framework

RAD (Rapid Application Development) Framework is a lightweight and user-friendly PHP framework designed for quick and efficient web application development. The primary motivation behind creating this framework was to provide a simple and easy-to-use tool for developers who value speed and efficiency.

The goal of RAD Framework is to offer a solid foundation for building web applications while keeping the learning curve minimal. It aims to provide essential features and functionalities commonly required during web development without unnecessary complexities. By focusing on simplicity and flexibility, RAD Framework empowers developers to concentrate on their specific application logic, rather than getting bogged down in intricate framework details.

Developers are encouraged to utilize RAD Framework to expedite their application development process significantly. Whether you are building a small project or a more substantial web application, RAD Framework's modular structure and adherence to PHP standards (such as PSR-3, PSR-4, PSR-7, and others) ensure smooth and maintainable development.

This framework is open-source, meaning you can freely use, modify, and extend it according to your specific project requirements. Feedback and contributions from the community are highly valued, as they help to improve the framework and adapt it to diverse use cases. With RAD Framework, developers have a reliable and lightweight solution to accelerate their web application development, without sacrificing performance or flexibility.

PSR Standards

The RAD framework is a PHP framework aimed at streamlining web development processes.

It adheres to various PHP Standards Recommendations (PSRs) to ensure code interoperability and maintainability.

Here is an overview of the PSRs followed by the RAD framework:

By following these PSR standards, the RAD framework ensures code consistency, improves code reuse, and promotes collaboration within the PHP development community.

With its focus on performance, optimized object instantiation, simplified dependency injection, the RAD framework provides developers with a robust and efficient environment for building high-performance web applications.

Installation

To use RAD Framework, you need to have PHP 8.2 or higher and Composer installed on your system.

Make sure you have PHP 8.2 or a later version installed. You can check your PHP version by running the following command in your terminal:

If PHP is not installed or you have an older version, you can download and install the latest version from the official PHP website: php.net.

Install Composer if you don't have it already. Composer is a dependency management tool for PHP. You can download and install it by following the instructions on the Composer website: getcomposer.org.

Once PHP and Composer are set up, you can add RAD Framework to your project by including it in the require block of your composer.json file. Add the following line for the stable version:

For the latest development version, you can use the following line:

After adding the line, run the following command to install RAD Framework and its dependencies:

Composer will fetch the appropriate version of RAD Framework based on the version specified in your composer.json file and set up the necessary files in your project.

With RAD Framework successfully installed, you can now start building your web applications with ease and speed, thanks to its streamlined features and flexible architecture.

Development / QA

Install the dev dependencies then use the Composer scripts:

No local PHP? A Docker dev stack is provided:

CI (GitHub Actions) runs the same checks on PHP 8.2, 8.3 and 8.4.

The codebase is clean at PHPStan level 5 (no baseline) and fully formatted with php-cs-fixer; both checks are blocking in CI, so any regression fails the build.

Usage

Init New Rad Object :

Create new Controller :

Routes are declared with PHP 8 attributes (namespace Rad\Route\Attribute) :

Available attributes :

Attribute Target Example
#[Get] #[Post] #[Put] #[Patch] #[Delete] #[Options] method (repeatable) #[Get('/users/(?<id>\d+)/')]
#[Produce] / #[Consume] method / class #[Produce('json', 'html')]
#[Middleware] / #[Security] method / class (repeatable) #[Middleware(MyMiddleware::class)]
#[Version] method / class #[Version(1)]
#[Session] #[Xhr] #[Cacheable] #[EnableOptions] method / class #[Session]
#[Cors] method / class #[Cors('https://example.com')]
#[AllowHeaders] / #[ExposeHeaders] method / class #[AllowHeaders('X-Total-Count')]

Legacy @get / @produce docblock annotations are still parsed automatically for controllers that have not been migrated yet.

Add controller to the Rad API :

Run the Rad API :

You can add Closure to the run method :

Dependency Injection

RAD ships a lightweight PSR-11 container with constructor autowiring (Rad\Container\Container). Controllers are resolved through it, so you can type-hint services directly in a controller constructor:

Register bindings on the application container:

The current request (ServerRequestInterface), router (RouterInterface) and the container itself are pre-registered and injectable out of the box.

The legacy service facades are also bridged into the container, so their interfaces can be type-hinted directly (each resolves to the handler configured for that service, exactly like calling the facade):

Bridged interfaces: Psr\Log\LoggerInterface, Rad\Cache\CacheInterface, Rad\Database\DatabaseAdapter, Rad\Session\SessionInterface, Rad\Cookie\CookieInterface, Rad\Encryption\EncryptionInterface, Rad\Template\TemplateInterface, Rad\Language\LanguageInterface, Rad\Codec\CodecInterface, Rad\Build\BuildInterface, Rad\ClientApi\ClientApiInterface, Rad\Mail\MailInterface and Psr\EventDispatcher\EventDispatcherInterface (when configured).

Middleware (PSR-15)

Write a standard PSR-15 middleware and attach it to a route/controller with the #[Middleware(...)] attribute:

The matched Route is available on the request as an attribute ($request->getAttribute(\Rad\Route\Route::class)). Middlewares can be ordered by declaring public static int $priority (lower runs first). Middlewares still written against the old Rad\Middleware\MiddlewareInterface keep working through an adapter.

Events (PSR-14)

The legacy Observer/Observable classes have been removed in favour of a PSR-14 event dispatcher (Rad\Event\EventHandler). Define events by extending Rad\Event\AbstractEvent (which supports stopPropagation()), and listeners by implementing Rad\Event\EventListenerInterface:

Register listeners and dispatch:

The dispatcher is also injectable as Psr\EventDispatcher\EventDispatcherInterface.

HTTP client (PSR-18)

Outbound HTTP calls use a PSR-18 client. Build requests with the PSR-17 factory and send them through the injectable Psr\Http\Client\ClientInterface:

PSR Support


All versions of rad-framework with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/log Version ^1.1 || ^2 || ^3
psr/cache Version ^1.1 || ^2 || ^3
psr/container Version ^1.1 || ^2
psr/http-message Version ^1.1 || ^2
psr/link Version ^1.1 || ^2
psr/simple-cache Version ^3
psr/http-server-middleware Version ^1
psr/http-server-handler Version ^1
psr/http-factory Version ^1
psr/http-client Version ^1
psr/event-dispatcher Version ^1
guzzlehttp/psr7 Version ^2.6
smarty/smarty Version ^4
nette/php-generator Version ^4
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 rad/rad-framework contains the following files

Loading the files please wait ...