PHP code example of getbible / sword

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

    

getbible / sword example snippets




declare(strict_types=1);

use GetBible\Sword\Engine;

$engine = new Engine('/var/lib/getbiblesword/sword');

$list = fopen('/tmp/modules.ndjson', 'wb');
$listBytes = $engine->streamModules($list);
fclose($list);

$output = fopen('/tmp/kjv.ndjson', 'wb');
$extractBytes = $engine->streamModule(
    module: 'KJV',
    destination: $output,
    artifactChunkSize: Engine::DEFAULT_ARTIFACT_CHUNK_SIZE
);
fclose($output);

Engine::abiVersion();         // 1
Engine::productVersion();     // "0.4.0"
Engine::contractIdentifier(); // "getbiblesword.ndjson/v1"
ini
getbiblesword.module_path=/var/lib/getbiblesword/sword