Supported Versions: PHP 5, PHP 7, PHP 8
Find the position of the first occurrence of a case-insensitive substring in a string
stripos(string $haystack, string $needle, int $offset = 0): int|false
if (! is_null($columns)) {
foreach ($columns as $column) {
if (($position = stripos($column, ' as ')) !== false) {
$as = substr($column, $position, 4);
[$original, $alias] = explode($as, $column);
foreach ($columns as $column) {
if (($position = stripos($column, ' as ')) !== false) {
$as = substr($column, $position, 4);
[$original, $alias] = explode($as, $column);
if (stripos($value, ' as ') !== false) {
return $this->wrapAliasedValue($value, $prefixAlias);
}
return $this->wrapAliasedValue($value, $prefixAlias);
}
protected function withoutSelectAliases(array $columns)
{
return array_map(function ($column) {
return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false
? substr($column, 0, $aliasPosition) : $column;
}, $columns);
}
{
return array_map(function ($column) {
return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false
? substr($column, 0, $aliasPosition) : $column;
}, $columns);
}
]));
$migrations = collect(preg_split("/\r\n|\n|\r/", $process->getOutput()))->filter(function ($line) {
return stripos($line, 'sqlite_sequence') === false &&
strlen($line) > 0;
})->all();
$migrations = collect(preg_split("/\r\n|\n|\r/", $process->getOutput()))->filter(function ($line) {
return stripos($line, 'sqlite_sequence') === false &&
strlen($line) > 0;
})->all();
$offset = 0 - strlen($suiteClassName);
foreach (self::$loadedClasses as $loadedClass) {
if (stripos(substr($loadedClass, $offset - 1), '\\' . $suiteClassName) === 0) {
$suiteClassName = $loadedClass;
break;
foreach (self::$loadedClasses as $loadedClass) {
if (stripos(substr($loadedClass, $offset - 1), '\\' . $suiteClassName) === 0) {
$suiteClassName = $loadedClass;
break;
public function createDatabasePlatformForVersion($version)
{
$mariadb = stripos($version, 'mariadb') !== false;
if ($mariadb && version_compare($this->getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) {
return new MariaDb1027Platform();
}
{
$mariadb = stripos($version, 'mariadb') !== false;
if ($mariadb && version_compare($this->getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) {
return new MariaDb1027Platform();
}
public function getServerVersion()
{
$serverInfos = $this->conn->get_server_info();
if (stripos($serverInfos, 'mariadb') !== false) {
return $serverInfos;
}
{
$serverInfos = $this->conn->get_server_info();
if (stripos($serverInfos, 'mariadb') !== false) {
return $serverInfos;
}
$this->conn = $conn;
$this->sql = $sql;
if (stripos($sql, 'INSERT INTO ') !== 0) {
return;
}
$this->sql = $sql;
if (stripos($sql, 'INSERT INTO ') !== 0) {
return;
}
$forceFetch = $input->getOption('force-fetch');
assert(is_bool($forceFetch));
if (stripos($sql, 'select') === 0 || $forceFetch) {
$resultSet = $conn->fetchAllAssociative($sql);
} else {
$resultSet = $conn->executeStatement($sql);
assert(is_bool($forceFetch));
if (stripos($sql, 'select') === 0 || $forceFetch) {
$resultSet = $conn->fetchAllAssociative($sql);
} else {
$resultSet = $conn->executeStatement($sql);
$response = ftp_raw($this->connection, 'HELP');
return $this->isPureFtpdServer = stripos(implode(' ', $response), 'Pure-FTPd') !== false;
}
public function fileExists(string $path): bool
return $this->isPureFtpdServer = stripos(implode(' ', $response), 'Pure-FTPd') !== false;
}
public function fileExists(string $path): bool
$path = $this->escapePath($path);
}
return ftp_rawlist($connection, $options . ' ' . $path, stripos($options, 'R') !== false) ?: [];
}
public function move(string $source, string $destination, Config $config): void
}
return ftp_rawlist($connection, $options . ' ' . $path, stripos($options, 'R') !== false) ?: [];
}
public function move(string $source, string $destination, Config $config): void
spl_autoload_register(function ($class) {
if (stripos($class, 'PHPCompatibility') !== 0) {
return;
}
if (stripos($class, 'PHPCompatibility') !== 0) {
return;
}
{
if (PlatformRepository::isPlatformPackage($packageName)) {
if (0 === stripos($packageName, 'php') || $packageName === 'hhvm') {
$version = self::getPlatformPackageVersion($pool, $packageName, phpversion());
$msg = "- Root composer.json requires ".$packageName.self::constraintToText($constraint).' but ';
if (PlatformRepository::isPlatformPackage($packageName)) {
if (0 === stripos($packageName, 'php') || $packageName === 'hhvm') {
$version = self::getPlatformPackageVersion($pool, $packageName, phpversion());
$msg = "- Root composer.json requires ".$packageName.self::constraintToText($constraint).' but ';
}
if (0 === stripos($packageName, 'ext-')) {
if (false !== strpos($packageName, ' ')) {
return array('- ', "PHP extension ".$packageName.' should be required as '.str_replace(' ', '-', $packageName).'.');
}
if (0 === stripos($packageName, 'ext-')) {
if (false !== strpos($packageName, ' ')) {
return array('- ', "PHP extension ".$packageName.' should be required as '.str_replace(' ', '-', $packageName).'.');
}
}
if (0 === stripos($packageName, 'lib-')) {
if (strtolower($packageName) === 'lib-icu') {
$error = extension_loaded('intl') ? 'it has the wrong version installed, try upgrading the intl extension.' : 'it is missing from your system, make sure the intl extension is loaded.';
if (0 === stripos($packageName, 'lib-')) {
if (strtolower($packageName) === 'lib-icu') {
$error = extension_loaded('intl') ? 'it has the wrong version installed, try upgrading the intl extension.' : 'it is missing from your system, make sure the intl extension is loaded.';