src/Handlers/OkFileHandler.php
/**
     * Query whether or not, the passed CSV filename is in the passed OK file. If the filename was found,
     * the OK file will be cleaned-up.
     *
     * @param string $filename   The filename to be cleaned-up
     * @param string $okFilename The filename of the .OK filename
     *
     * @return bool TRUE if the passed filename matches the also passed .OK file
     * @throws \Exception Is thrown, if the passed filename is NOT in the OK file or the OK can not be cleaned-up
     */
Query whether or not, the passed CSV filename is in the passed OK file. If the filename was found,
the OK file will be cleaned-up.

@param string $filename   The filename to be cleaned-up
@param string $okFilename The filename of the .OK filename

@return bool TRUE if the passed filename matches the also passed .OK file
@throws \Exception Is thrown, if the passed filename is NOT in the OK file or the OK can not be cleaned-up
Query whether or not the passed CSV filename is in the passed OK file . If the filename was found the OK file will be cleaned - up . @param string $filename The filename to be cleaned - up @param string $okFilename The filename of the . OK filename @return bool TRUE if the passed filename matches the also passed . OK file @throws \ Exception Is thrown if the passed filename is NOT in the OK file or the OK can not be cleaned - up
public function cleanUpOkFile(string $filename, string $okFilename) : bool
    {
        try {
            if ($this->isEqualFilename($filename, $okFilename) && $this->size($okFilename) === 0) {
                $this->delete($okFilename);
                return true;
            } else {
                foreach ($this->getFilesystemAdapter()->read($okFilename) as $line) {
                    if (strcmp(basename($filename), $trimmedLine = trim($line, PHP_EOL)) === 0) {
                        $this->removeLineFromFilename($trimmedLine, $okFilename);
                        , if empty
                        if ($this->size($okFilename) === 0) {
                            $this->delete($okFilename);
                        }
                        return true;
                    }
                }
            }
        } catch (LineNotFoundException $lne) {
            throw new \Exception(
                sprintf(
                    'Can\'t remove filename "%s" from .OK file: "%s"',
                    $filename,
                    $okFilename
                ),
                null,
                $lne
            );
        }
        return false;
    }
public function cleanUpOkFile ( string $ filename , string $ okFilename ) : bool { try { if ( $ this -> isEqualFilename ( $ filename , $ okFilename ) && $ this -> size ( $ okFilename ) === 0 ) { $ this -> delete ( $ okFilename ) ; return true ; } else { foreach ( $ this -> getFilesystemAdapter ( ) -> read ( $ okFilename ) as $ line ) { if ( strcmp ( basename ( $ filename ) , $ trimmedLine = trim ( $ line , PHP_EOL ) ) === 0 ) { $ this -> removeLineFromFilename ( $ trimmedLine , $ okFilename ) ; if ( $ this -> size ( $ okFilename ) === 0 ) { $ this -> delete ( $ okFilename ) ; } return true ; } } } } catch ( LineNotFoundException $ lne ) { throw new \ Exception ( sprintf ( 'Can\'t remove filename "%s" from .OK file: "%s"' , $ filename , $ okFilename ) , null , $ lne ) ; } return false ; }
Query whether or not, the passed CSV filename is in the passed OK file.
Query whether or not the passed CSV filename is in the passed OK file .
// if the OK filename matches the CSV filename AND the OK file is empty // finally delete the .OK file // and return TRUE // if the OK filename matches the CSV filename AND the OK file is empty // else, remove the CSV filename from the OK file // finally delete the .OK file, if empty // return TRUE, when the line has successfully been removed // wrap and re-throw the exception // otherwise, return FALSE