Download the PHP package whirlpool/whirlpool without Composer

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

Whirlpool Framework

Introduction

Whirlpool framework is a lightweight MVC framework based on a few different composer packages.

Installation

Installing the framework

The best way to install the framework is through composer. The following command will install the framework to /new/project/location

composer create-project whirlpool/whirlpool /new/project/location

Setting up the environment

By default, whirlpool expects all web requests to go to the index.php file in the public directory. I suggest setting the "public" directory as your web/document root.

Getting Started

Routing

By default, routes are located at application/routes.php. You can add/remove more route definition locations by looking in config/routing.php under routeFiles.

// If a user comes in on this url: site.com/my-page
// And we want to execute a method in this controller: GeneralController
// With a name of: myPageAction
// We would add the following route definition.
$r->addRoute('GET', '/my-page', 'general@myPage');

If no method is specified the default will be used which can be found in config/routing.php. For more help with creating routes please see FastRoute

Controllers

Controllers are located at application/controllers. Each method that can be an action should be followed by "Action". Each controller should end with the text "Controller" and the file name must match the controller name. A BaseController is provided with Whirlpool and it is recommended that your controllers extend Whirlpool\BaseController.

Models

The models are located at application/models. The Whirlpool\BaseModel extends Eloquent so extending from it will give you access to all the wonderful things that Eloquent provides. For help with Eloquent see the documentation

Autoloading More Directories

You are able to specify more directories from which Whirlpool will auto-load from in the config/autoload file. The 'directory' array will add directories for standard requests, and the 'subdomainDirectory' will add directories for requests that come in on a subdomain. For example..

return [

    'directories' => [
        '/repositories/',
    ],

    'subdomainDirectories' => [

    ],

];

This allows you to create classes in application/repositories and have them autoloaded.

Views

Views are handled with Twig. When your controller extends from Whirlpool\BaseController you will have access to the twig object via $this->twig. A shortcut to display views has also been provided in the form of $this->displayView($viewName [, array $data = array()]);.

Database Configuration

In order to use Models you need to have a database connection. The credentials for this connection can be set in config/database.php. An example configuration file can be found at config/example_database.php.

Multiple Databases

You can interact with multiple databases in a way that is very similar to Laravel as we are using Eloquent. All you need to do is ensure that the new database credentials have been set up in config/database.php with a name of your choosing. You can set the name for that connection by either specifying it in the array key, or setting 'name' => 'my-second-connection'.

Once the name is set simply open a model and set the connection name.

protected $connection = 'my-second-connection';

You are also able to do the following, where User is a model.

$user = new User();
$user->setConnection('my-second-connection');

Subdomains

Subdomains can be a useful way to separate logic for different sections of your applications. You can use Request::subdomain() to get the active subdomain. Please note that there is a list of subdomains to ignore in config/general.php.

Get going with subdomains

All you have to do to start using a subdomain is to create a folder in application/subdomains. Inside this new folder you will need to create the folders controllers, models and views. This folder will be used as the main application folder when the specified subdomain is active, and the application/models folder will act as a fallback.

Hooks

Introduction to hooks

There are several hooks that you can manipulate in order to run custom code at a fixed point in the applications life cycle.

Hooks should be created in config/hooks.php in the following format:

return [
    'hook-name' => function ($argument1, $argument2) {
        // This code will be run when the hook is triggered
    },
];

List of default hooks

Hook Name Arguments Timing
whirlpool-initialized whirlpool Once Whirlpool::init() has been executed.
whirlpool-load-action path When an action is about to be loaded.
whirlpool-loaded-action action When an action has just been loaded.
whirlpool-execute-action action When an action is about to be executed.
whirlpool-controller-initialized controller, action When the main controller has just been instantiated.
whirlpool-executed-action response When an action has just been executed.
whirlpool-class-not-found class When the Whirlpool autoloader cannot find a class.

Dependency Injection

You can use dependency injection in your classes very easily. Just include a type hint to your class constructor!

class SomeObject()
{
    public function output()
    {
        echo "Hello World.";
    }
}
class MyController {
    public function __construct(SomeObject $ob)
    {
        $ob->output();
    }
};
$controller = Whirlpool::make('MyController');

All versions of whirlpool with dependencies

PHP Build Version
Package Version
Requires whirlpool/framework 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 whirlpool/whirlpool contains the following files

Loading the files please wait ...