KMP PHP API Reference

Installer
in package

Provides installation hooks for when this application is installed through composer. Customize this class to suit your needs.

Table of Contents

Constants

WRITABLE_DIRS  = ['logs', 'tmp', 'tmp/cache', 'tmp/cache/models', 'tmp/cache/persistent', 'tmp/cache/views', 'tmp/sessions', 'tmp/tests']
An array of directories to be made writable

Methods

createAppLocalConfig()  : void
Create config/app_local.php file if it does not exist.
createWritableDirectories()  : void
Create the `logs` and `tmp` directories.
postInstall()  : void
Does some routine installation tasks so people don't have to.
setAppNameInFile()  : void
Set the APP_NAME value in a given file
setFolderPermissions()  : void
Set globally writable permissions on the "tmp" and "logs" directory.
setSecuritySalt()  : void
Set the security.salt value in the application's config file.
setSecuritySaltInFile()  : void
Set the security.salt value in a given file

Constants

WRITABLE_DIRS

An array of directories to be made writable

public mixed WRITABLE_DIRS = ['logs', 'tmp', 'tmp/cache', 'tmp/cache/models', 'tmp/cache/persistent', 'tmp/cache/views', 'tmp/sessions', 'tmp/tests']

Methods

createAppLocalConfig()

Create config/app_local.php file if it does not exist.

public static createAppLocalConfig(string $dir, IOInterface $io) : void
Parameters
$dir : string

The application's root directory.

$io : IOInterface

IO interface to write to console.

createWritableDirectories()

Create the `logs` and `tmp` directories.

public static createWritableDirectories(string $dir, IOInterface $io) : void
Parameters
$dir : string

The application's root directory.

$io : IOInterface

IO interface to write to console.

postInstall()

Does some routine installation tasks so people don't have to.

public static postInstall(Event $event) : void
Parameters
$event : Event

The composer event object.

Tags
throws
Exception

Exception raised by validator.

setAppNameInFile()

Set the APP_NAME value in a given file

public static setAppNameInFile(string $dir, IOInterface $io, string $appName, string $file) : void
Parameters
$dir : string

The application's root directory.

$io : IOInterface

IO interface to write to console.

$appName : string

app name to set in the file

$file : string

A path to a file relative to the application's root

setFolderPermissions()

Set globally writable permissions on the "tmp" and "logs" directory.

public static setFolderPermissions(string $dir, IOInterface $io) : void

This is not the most secure default, but it gets people up and running quickly.

Parameters
$dir : string

The application's root directory.

$io : IOInterface

IO interface to write to console.

setSecuritySalt()

Set the security.salt value in the application's config file.

public static setSecuritySalt(string $dir, IOInterface $io) : void
Parameters
$dir : string

The application's root directory.

$io : IOInterface

IO interface to write to console.

setSecuritySaltInFile()

Set the security.salt value in a given file

public static setSecuritySaltInFile(string $dir, IOInterface $io, string $newKey, string $file) : void
Parameters
$dir : string

The application's root directory.

$io : IOInterface

IO interface to write to console.

$newKey : string

key to set in the file

$file : string

A path to a file relative to the application's root


        
On this page

Search results