- Move src/, tests/, bin/, generated/, proto/, composer.json, composer.lock, phpunit.xml from php/ to repo root - Move ref/ to doc/reference_samples/ for better organization - Remove vendor/ from git tracking (now properly gitignored) - Update all test file paths (dirname adjustments and ref/ -> doc/reference_samples/) - Update all documentation paths (AGENTS.md, doc/*.md) - Remove php.bak/ directory - All 252 tests pass
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
|
|
|
use ProPresenter\Parser\PresentationBundle;
|
|
use ProPresenter\Parser\ProBundleWriter;
|
|
use ProPresenter\Parser\ProFileGenerator;
|
|
|
|
$image = imagecreatetruecolor(200, 150);
|
|
$blue = imagecolorallocate($image, 30, 60, 180);
|
|
imagefill($image, 0, 0, $blue);
|
|
$white = imagecolorallocate($image, 255, 255, 255);
|
|
imagestring($image, 5, 10, 10, 'ProPresenter', $white);
|
|
$tmpPng = tempnam(sys_get_temp_dir(), 'testbild-') . '.png';
|
|
imagepng($image, $tmpPng);
|
|
$imageBytes = file_get_contents($tmpPng);
|
|
unlink($tmpPng);
|
|
|
|
$refDir = dirname(__DIR__) . '/doc/reference_samples';
|
|
|
|
$song = ProFileGenerator::generate(
|
|
'TestBild',
|
|
[
|
|
[
|
|
'name' => 'Verse 1',
|
|
'color' => [0.0, 0.0, 0.0, 1.0],
|
|
'slides' => [
|
|
[
|
|
'media' => 'test-background.png',
|
|
'format' => 'png',
|
|
'label' => 'test-background.png',
|
|
'bundleRelative' => true,
|
|
],
|
|
],
|
|
],
|
|
],
|
|
[['name' => 'normal', 'groupNames' => ['Verse 1']]],
|
|
);
|
|
|
|
$bundle = new PresentationBundle($song, 'TestBild.pro', ['test-background.png' => $imageBytes]);
|
|
ProBundleWriter::write($bundle, $refDir . '/TestBild.probundle');
|
|
echo "TestBild.probundle written\n";
|