mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
Compare commits
5 commits
97b30cc7b7
...
3c88e32d78
Author | SHA1 | Date | |
---|---|---|---|
|
3c88e32d78 | ||
|
1b2ac50cfd | ||
|
779bec5fcf | ||
|
f512af1823 | ||
|
8d0d6c012c |
6 changed files with 33 additions and 16 deletions
1
.github/setup-exiftool.sh
vendored
1
.github/setup-exiftool.sh
vendored
|
@ -10,5 +10,4 @@
|
||||||
#
|
#
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y parallel libimage-exiftool-perl
|
sudo apt-get install -y parallel libimage-exiftool-perl
|
||||||
|
|
1
.github/setup-sphinx.sh
vendored
1
.github/setup-sphinx.sh
vendored
|
@ -11,7 +11,6 @@
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -q -y sphinxsearch
|
sudo apt-get install -q -y sphinxsearch
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR=$(dirname "$0")
|
||||||
|
|
1
.github/setup-unbuffer.sh
vendored
1
.github/setup-unbuffer.sh
vendored
|
@ -10,5 +10,4 @@
|
||||||
#
|
#
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y expect-dev
|
sudo apt-get install -y expect-dev
|
||||||
|
|
1
.github/setup-webserver.sh
vendored
1
.github/setup-webserver.sh
vendored
|
@ -11,7 +11,6 @@
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y nginx coreutils
|
sudo apt-get install -y nginx coreutils
|
||||||
|
|
||||||
sudo service nginx stop
|
sudo service nginx stop
|
||||||
|
|
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
|
@ -28,6 +28,10 @@ jobs:
|
||||||
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
|
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Update Ubuntu package lists
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --allow-releaseinfo-change
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
@ -158,6 +162,10 @@ jobs:
|
||||||
- 6379:6379
|
- 6379:6379
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Update Ubuntu package lists
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --allow-releaseinfo-change
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
@ -299,6 +307,10 @@ jobs:
|
||||||
- 6379:6379
|
- 6379:6379
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Update Ubuntu package lists
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --allow-releaseinfo-change
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
@ -397,6 +409,10 @@ jobs:
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Update Ubuntu package lists
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --allow-releaseinfo-change
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
@ -76,10 +76,16 @@ class base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the sort direction differs from the direction in the cache, then reverse the ids array
|
// If the sort direction differs from the direction in the cache, then recalculate array keys
|
||||||
if ($reverse_ids)
|
if ($reverse_ids)
|
||||||
{
|
{
|
||||||
$stored_ids = array_reverse($stored_ids);
|
$keys = array_keys($stored_ids);
|
||||||
|
array_walk($keys, function (&$value, $key) use ($result_count)
|
||||||
|
{
|
||||||
|
$value = ($value >= 0) ? $result_count - $value - 1 : $value;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$stored_ids = array_combine($keys, $stored_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
|
for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
|
||||||
|
@ -130,6 +136,8 @@ class base
|
||||||
}
|
}
|
||||||
|
|
||||||
$store_ids = array_slice($id_ary, 0, $length);
|
$store_ids = array_slice($id_ary, 0, $length);
|
||||||
|
$id_range = range($start, $start + $length - 1);
|
||||||
|
$store_ids = array_combine($id_range, $store_ids);
|
||||||
|
|
||||||
// create a new resultset if there is none for this search_key yet
|
// create a new resultset if there is none for this search_key yet
|
||||||
// or add the ids to the existing resultset
|
// or add the ids to the existing resultset
|
||||||
|
@ -164,29 +172,26 @@ class base
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$store = array(-1 => $result_count, -2 => $sort_dir);
|
$store = array(-1 => $result_count, -2 => $sort_dir);
|
||||||
$id_range = range($start, $start + $length - 1);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// we use one set of results for both sort directions so we have to calculate the indizes
|
// we use one set of results for both sort directions so we have to calculate the indizes
|
||||||
// for the reversed array and we also have to reverse the ids themselves
|
// for the reversed array
|
||||||
if ($store[-2] != $sort_dir)
|
if ($store[-2] != $sort_dir)
|
||||||
{
|
{
|
||||||
$store_ids = array_reverse($store_ids);
|
$keys = array_keys($store_ids);
|
||||||
$id_range = range($store[-1] - $start - $length, $store[-1] - $start - 1);
|
array_walk($keys, function (&$value, $key) use ($store) {
|
||||||
}
|
$value = $store[-1] - $value - 1;
|
||||||
else
|
});
|
||||||
{
|
$store_ids = array_combine($keys, $store_ids);
|
||||||
$id_range = range($start, $start + $length - 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$store_ids = array_combine($id_range, $store_ids);
|
|
||||||
|
|
||||||
// append the ids
|
// append the ids
|
||||||
if (is_array($store_ids))
|
if (is_array($store_ids))
|
||||||
{
|
{
|
||||||
$store += $store_ids;
|
$store += $store_ids;
|
||||||
|
ksort($store);
|
||||||
|
|
||||||
// if the cache is too big
|
// if the cache is too big
|
||||||
if (count($store) - 2 > 20 * $config['search_block_size'])
|
if (count($store) - 2 > 20 * $config['search_block_size'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue