PHP code example of migliori / visual-diff-merge

1. Go to this page and download the library: Download migliori/visual-diff-merge 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/ */

    

migliori / visual-diff-merge example snippets




use VisualDiffMerge\Config;

// Inject host configuration BEFORE any Config::get() / init() call
Config::loadArray([
    'php' => [
        'security' => [
            'allowedDirectories' => ['/absolute/path/to/dir-a', '/absolute/path/to/dir-b'],
        ],
    ],
    'javascript' => [
        'apiBaseUrl' => '/vendor/migliori/visual-diff-merge/api/',
        'lang'       => 'en',
    ],
]);

'php' => [
    'debug' => [
        'enabled' => true,  // Enable server-side debugging
        'logLevel' => 3,    // Log verbosity level (1-3)
        'logFile' => 'debug-php-diff.log'  // Log filename
    ],
    'diff' => [
        'contextLines' => 3,  // Number of context lines around changes
        'ignoreWhitespace' => false,  // Ignore whitespace in comparisons
        'ignoreCase' => false  // Ignore case in comparisons
    ],
    // Security settings, path configurations, etc.
]

'javascript' => [
    'lang' => 'en',  // Default UI language
    'debug' => false,  // Enable client-side debugging
    'logLevel' => 2,   // Client-side log verbosity level
    'theme' => [
        'defaultFamily' => 'atom-one',  // Syntax highlighting theme
        'defaultMode' => 'dark',  // Light or dark mode
        'showSelector' => true  // Show theme selector in UI
    ],
    // UI class customizations, translations, etc.
]