Pickles Framework Documentation

Cli
in package

Class Cli

Handles command-line interface (CLI) operations for the Pickles Framework. Provides methods and properties to interact with and manage CLI commands, arguments, and output.

Table of Contents

Methods

bootstrap()  : self
Bootstraps the CLI application by initializing core components and services.
run()  : void
Runs the CLI application.

Methods

bootstrap()

Bootstraps the CLI application by initializing core components and services.

public static bootstrap(string $root) : self

This method performs the following actions:

  • Sets the application root directory.
  • Loads environment variables from a .env file in the root directory.
  • Loads configuration files from the config directory.
  • Registers CLI service providers defined in the configuration.
  • Retrieves and validates the database driver instance.
  • Establishes a database connection using configuration values.
  • Registers a singleton instance of the Migrator class for database migrations.
Parameters
$root : string

The root directory of the application.

Tags
throws
Exception

If the database driver instance is invalid.

Return values
self —

Returns an instance of the CLI application.

run()

Runs the CLI application.

public run() : void

Initializes a new CLI application instance with the configured application name and version. Registers the available CLI commands: MakeMigration, Migrate, and MigrationRollback. Executes the CLI application, handling user input and command execution.


        
On this page

Search results