Lines Matching +full:php +full:- +full:version

1 #!/usr/bin/env php
2 <?php
4 * Version Update Script for Delete Page Guard Plugin
6 * Updates version information across all plugin files.
7 * Usage: php build/update-version.php [new-version] [new-date]
9 * @license GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) - see LICENSE.md
15 $versionFile = $baseDir . '/version.php';
17 // Load current version info
19 die("Error: version.php not found\n");
23 $currentVersion = $versionInfo['version'];
28 $newDate = $argv[2] ?? date('Y-m-d');
31 echo "Delete Page Guard Plugin - Version Update Script\n";
32 echo "Current version: {$currentVersion} ({$currentDate})\n\n";
33 echo "Usage: php build/update-version.php <new-version> [new-date]\n";
34 echo "Example: php build/update-version.php 1.1.0 2025-02-01\n";
38 // Validate version format (semantic versioning)
39 if (!preg_match('/^\d+\.\d+\.\d+(-[a-zA-Z0-9\-\.]+)?$/', $newVersion)) {
40 die("Error: Invalid version format. Use semantic versioning (e.g., 1.0.0)\n");
44 if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $newDate)) {
45 die("Error: Invalid date format. Use YYYY-MM-DD\n");
48 echo "Updating version from {$currentVersion} to {$newVersion}\n";
51 // Update version.php
53 $newVersionInfo['version'] = $newVersion;
56php\n/**\n * Delete Page Guard Plugin - Version Information\n *\n * Centralized version management…
59 echo "✓ Updated version.php\n";
65 $content = preg_replace('/^version\s+.*$/m', "version {$newVersion}", $content);
75 // Replace [Unreleased] with actual version
77 $content = str_replace('## [Unreleased]', "## [{$newVersion}] - {$newDate}", $content);
81 echo "ℹ CHANGELOG.md - no [Unreleased] section found\n";
85 // Update dokuwiki-plugin-page.txt (plugin template)
86 $pluginPageFile = $baseDir . '/dokuwiki-plugin-page.txt';
91 …$content = preg_replace('/^lastupdate\s*:\s*\d{4}-\d{2}-\d{2}\s*$/m', "lastupdate : {$newDate}", $…
93 // Update downloadurl with new version (more robust pattern)
95 …com/jonnydee/deletepageguard/releases/download/v\d+\.\d+\.\d+/deletepageguard-\d+\.\d+\.\d+\.zip#',
96 …b.com/jonnydee/deletepageguard/releases/download/v{$newVersion}/deletepageguard-{$newVersion}.zip",
100 // Update changelog section with new version entry (add at top of changelog)
105 '/(===== Changelog =====.*?)( \* \*\*\d{4}-\d{2}-\d{2}\*\*)/s',
112 echo "✓ Updated dokuwiki-plugin-page.txt (download URL and date)\n";
115 echo "\n✅ Version update completed successfully!\n";