PHP code example of microphork / application

1. Go to this page and download the library: Download microphork/application library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

microphork / application example snippets



    //turn on the setting to display all errors
    ini_set('display_errors', 1);
    
    //define the environment (eg. dev, stage, prod)
    define('PHK_ENV', 'dev');
    
    //define the paths to the test files
    define('TEST_PATH', realpath(dirname(__DIR__)).DIRECTORY_SEPARATOR.'tests'.DIRECTORY_SEPARATOR);
    define('LOG_PATH', realpath(dirname(__DIR__)).DIRECTORY_SEPARATOR.'logs/tests'.DIRECTORY_SEPARATOR);
    
    //define a custom function to load and use the testing bootstrap
    function phork_initialize() {
        xecution time
    register_shutdown_function(function() {
        if (\Phork::instance()->verbose()) {
             printf('%f seconds ellapsed', (microtime(true) - PHORK_START));
        }
    });
    
    //define the start time
    define('PHORK_START', microtime(true));