chore: Проверки к типам
This commit is contained in:
parent
8786e84568
commit
18cc1cad01
8 changed files with 34 additions and 28 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue