Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
feat: Add `builds next` option by neznaika0 · Pull Request #9946 · codeigniter4/CodeIgniter4 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat: Add `builds next` option by neznaika0 · Pull Request #9946 · codeigniter4/CodeIgniter4 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat: Add `builds next` option by neznaika0 · Pull Request #9946 · codeigniter4/CodeIgniter4 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' feat: Add `builds next` option by neznaika0 · Pull Request #9946 · codeigniter4/CodeIgniter4 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat: Add `builds next` option by neznaika0 · Pull Request #9946 · codeigniter4/CodeIgniter4 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); feat: Add `builds next` option by neznaika0 · Pull Request #9946 · codeigniter4/CodeIgniter4 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/RELEASE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,10 @@ the existing content.
* Set the date to format `Release Date: January 31, 2021`
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
and `<version number="4.x.x">`
* Update **admin/starter/builds**:
* Set `define('LATEST_RELEASE', '^4.x')`
* Set `define('NEXT_MINOR', '4.y-dev')`.
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '5.0-dev')`.
* Commit the changes with `Prep for 4.x.x release`
* [ ] Create a new PR from `release-4.x.x` to `develop`:
* Title: `Prep for 4.x.x release`
Expand Down
15 changes: 15 additions & 0 deletions admin/prepare-release.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
$versionParts = explode('.', $version);
$minor = $versionParts[0] . '.' . $versionParts[1];

// Note: Major version will change someday (4.x..5.x) - update manually.
$nextMinor = $versionParts[0] . '.' . $versionParts[1] + 1;

// Creates a branch for release.
system('git switch develop');
system('git branch -D release-' . $version);
Expand DownExpand Up@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
"Release Date: {$date}",
);

// Update appstarter/builds script
replace_file_content(
'./admin/starter/builds',
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
"define('LATEST_RELEASE', '^{$minor}');",
);
replace_file_content(
'./admin/starter/builds',
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
"define('NEXT_MINOR', '^{$nextMinor}-dev');",
);

// Commits
system('git add -u');
system('git commit -m "Prep for ' . $version . ' release"');
27 changes: 15 additions & 12 deletions admin/starter/builds
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env php
<?php

define('LATEST_RELEASE', '^4.0');
define('LATEST_RELEASE', '^4.7');
define('DEVELOP_BRANCH', 'dev-develop');
define('NEXT_MINOR', '^4.8-dev');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');

/*
Expand All@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
* Use this script to toggle the CodeIgniter dependency between the
* latest stable release and the most recent development update.
*
* Usage: php builds [release|development]
* Usage: php builds [release|development|next]
*/

$branch = $argv[1] ?? '';

// Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
echo 'Usage: php builds [release|development]' . PHP_EOL;
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
echo 'Usage: php builds [release|development|next]' . PHP_EOL;

exit;
}

$dev = $argv[1] === 'development';

$modified = [];

// Locate each file and update it for the requested stability
Expand All@@ -36,7 +38,7 @@ if (is_file($file)) {
$array = json_decode($contents, true);

if (is_array($array)) {
if ($dev) {
if ($branch !== 'release') {
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
$array['repositories'] ??= [];
Expand All@@ -57,7 +59,7 @@ if (is_file($file)) {
];
}

$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
unset($array['require']['codeigniter4/framework']);
} else {
unset($array['minimum-stability']);
Expand All@@ -70,7 +72,7 @@ if (is_file($file)) {
}
}

if (empty($array['repositories'])) {
if ($array['repositories'] === []) {
unset($array['repositories']);
}
}
Expand DownExpand Up@@ -100,7 +102,7 @@ foreach ($files as $file) {
if (is_file($file)) {
$contents = file_get_contents($file);

if ($dev) {
if ($branch !== 'release') {
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
} else {
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
Expand All@@ -120,6 +122,7 @@ if ($modified === []) {
foreach ($modified as $file) {
echo " * {$file}" . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
}

echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,12 @@ Message Changes
Changes
*******

Others
======

- **builds:** In the ``builds`` script (for ``codeigniter4/appstarter``), the ``next`` argument has been added
to switch ``4.7.x`` to the next minor version ``4.8.x-dev``. See :ref:`Latest Dev<switch-to-dev-version>`.

************
Deprecations
************
Expand Down
15 changes: 8 additions & 7 deletions user_guide_src/source/installation/installing_composer.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,6 +158,8 @@ Folders in your project after set up:
- app, public, tests, writable
- vendor/codeigniter4/framework/system

.. _switch-to-dev-version:

Latest Dev
----------

Expand All@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is
Note that this differs from the released user guide, and will pertain to the
develop branch explicitly.

.. note:: You should not rely on the version of the framework in your project
Comment thread
paulbalandan marked this conversation as resolved.
- the development code may contain an incorrect number.

Update for Latest Dev
^^^^^^^^^^^^^^^^^^^^^

Expand All@@ -188,15 +193,11 @@ files if necessary.
Next Minor Version
^^^^^^^^^^^^^^^^^^

If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
If you want to use the next minor version branch:

If you try the ``4.8`` branch, change the version to ``4.8.x-dev``::
.. code-block:: console

"require": {
"php": "^8.2",
"codeigniter4/codeigniter4": "4.8.x-dev"
},
php builds next

And run ``composer update`` to sync your vendor
folder with the latest target build. Then, check the Upgrading Guide
Expand Down