33 lines
560 B
PHP
33 lines
560 B
PHP
<?php
|
|
|
|
$texts = [
|
|
[
|
|
'id' => 0,
|
|
'name' => 'test text',
|
|
],
|
|
];
|
|
|
|
$nodes = [
|
|
[
|
|
'id' => 0,
|
|
'title' => 'Chapter 1',
|
|
'textId' => 0,
|
|
'parentNodeId' => null,
|
|
],
|
|
[
|
|
'id' => 1,
|
|
'title' => 'Section 1.1',
|
|
'textId' => 0,
|
|
'parentNodeId' => 0,
|
|
],
|
|
];
|
|
|
|
$fileDataMap = [
|
|
'texts.json' => $texts,
|
|
'nodes.json' => $nodes,
|
|
];
|
|
|
|
foreach ($fileDataMap as $file => $data) {
|
|
$path = __DIR__ . "/$file";
|
|
file_put_contents($path, json_encode($data, JSON_PRETTY_PRINT));
|
|
}
|