chore: Проверки к типам

This commit is contained in:
origami11@yandex.ru 2025-12-02 13:16:02 +03:00
parent 8786e84568
commit 18cc1cad01
8 changed files with 34 additions and 28 deletions

View file

@ -8,13 +8,13 @@ namespace ctiso;
* @param string $delimiter
* @param string $enclosure
* @param string $escape
* @return array
* @return array|false
*/
function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\")
{
$fiveMBs = 1024;
$fp = fopen("php://temp/maxmemory:$fiveMBs", 'r+');
$data = '';
$data = [];
if (is_resource($fp)) {
fputs($fp, $input);
rewind($fp);
@ -41,7 +41,7 @@ function process_exists($pid)
foreach ($processes as $process) {
if ($process != "") {
$csv = str_getcsv($process);
if ($pid == $csv[1]) return true;
if ($csv && $pid == $csv[1]) return true;
}
}
return false;