This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".  
Status: 2023-12-27

Lock

ensures that there can only be one call at runtime; prevents multiple calls at runtime.

As long as the runtime takes, Lock prevents multiple calls.

create(string $sKey = '', bool $bReturn = false)

Usage

simply note the following command at the place you want to be protected from multiple calls.

In most cases this would be inside a Controller method.

Example

public function index()
{
    Lock::create();
    ...
}

This command creates a lock folder inside your cache folder during runtime.

When runtime is over, the lock folder will be removed automatically.

Lock