mirror of
https://github.com/YGGverse/Yo.git
synced 2025-02-05 11:24:20 +00:00
use PHP 8 str_starts_with function
This commit is contained in:
parent
79b82d46e1
commit
5e4494c9e8
@ -97,7 +97,7 @@ foreach ($config->cli->document->crawl->skip->stripos->url as $condition)
|
|||||||
// Delete local snaps
|
// Delete local snaps
|
||||||
$location = sprintf(
|
$location = sprintf(
|
||||||
'%s/%s',
|
'%s/%s',
|
||||||
'/' === substr($config->snap->storage->local->directory, 0, 1) ? $config->snap->storage->local->directory
|
str_starts_with($config->snap->storage->local->directory, '/') ? $config->snap->storage->local->directory // absolute path
|
||||||
: __DIR__ . '/../../../' . $config->snap->storage->local->directory,
|
: __DIR__ . '/../../../' . $config->snap->storage->local->directory,
|
||||||
implode(
|
implode(
|
||||||
'/',
|
'/',
|
||||||
|
@ -575,7 +575,7 @@ foreach($index->search('')
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// absolute
|
/// absolute
|
||||||
if ('/' === substr($config->snap->storage->tmp->directory, 0, 1))
|
if (str_starts_with($config->snap->storage->tmp->directory, '/'))
|
||||||
{
|
{
|
||||||
$filepath = $config->snap->storage->tmp->directory;
|
$filepath = $config->snap->storage->tmp->directory;
|
||||||
}
|
}
|
||||||
@ -671,7 +671,7 @@ foreach($index->search('')
|
|||||||
if ($allowed)
|
if ($allowed)
|
||||||
{
|
{
|
||||||
/// absolute
|
/// absolute
|
||||||
if ('/' === substr($config->snap->storage->local->directory, 0, 1))
|
if (str_starts_with($config->snap->storage->local->directory, '/'))
|
||||||
{
|
{
|
||||||
$filepath = $config->snap->storage->local->directory;
|
$filepath = $config->snap->storage->local->directory;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user