PHP code example of mattablues / radix-framework

1. Go to this page and download the library: Download mattablues/radix-framework 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/ */

    

mattablues / radix-framework example snippets




declare(strict_types=1);

use Radix\File\Reader;
use Radix\File\Writer;

// Skriv JSON till fil
Writer::json(__DIR__ . '/data.json', [
    'id'   => 1,
    'name' => 'Alice',
]);

// Läs tillbaka som assoc-array
$data = Reader::json(__DIR__ . '/data.json', assoc: true);

var_dump($data);
// ['id' => 1, 'name' => 'Alice']
json
"autoload": {
  "psr-4": {
    "Radix\\": "src/"
  },
  "files": [
    "support/helpers.php"
  ]
}
json
"scripts": {
  "stan": "phpstan analyse -c phpstan.neon.dist",
  "test": "php -d xdebug.mode=off vendor/bin/phpunit",
  "infect": "php tools/infection.php",
  "infect:pcov": "php tools/infection.php pcov",
  "infect:xdebug": "php tools/infection.php xdebug",
  "format": "@php tools/php-cs-fixer.php",
  "format:check": "@php tools/php-cs-fixer.php --dry-run --diff"
}