PHP code example of codewithkyrian / platform-package-installer

1. Go to this page and download the library: Download codewithkyrian/platform-package-installer 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/ */

    

codewithkyrian / platform-package-installer example snippets


use Codewithkyrian\PlatformPackageInstaller\Platform;

// Example with directory paths
$libraryPaths = [
    'linux-x86_64' => '/path/to/linux/x86_64/libs',
    'darwin-arm64' => '/path/to/mac/arm64/libs',
    'windows-x86_64' => '/path/to/windows/x86_64/libs'
];

$bestLibraryPath = Platform::findBestMatch($libraryPaths);

// Example with configuration arrays
$platformConfigs = [
    'linux-x86_64' => [
        'library_path' => '/path/to/linux/libs',
        'additional_config' => ['key' => 'value']
    ],
    'darwin-arm64' => [
        'library_path' => '/path/to/mac/libs',
        'additional_config' => ['key' => 'another_value']
    ]
];

$currentPlatformConfig = Platform::findBestMatch($platformConfigs);