src/Subjects/MoveFilesSubject.php
/**
     * Imports the content of the file with the passed filename.
     *
     * @param string $serial   The serial of the actual import
     * @param string $filename The filename to process
     *
     * @return void
     * @throws \Exception Is thrown, if the import can't be processed
     */
Imports the content of the file with the passed filename.
@param string $serial   The serial of the actual import
@param string $filename The filename to process

@return void
@throws \Exception Is thrown, if the import can't be processed
Imports the content of the file with the passed filename . @param string $serial The serial of the actual import @param string $filename The filename to process @return void @throws \ Exception Is thrown if the import can ' t be processed
public function import($serial, $filename)
    {
        $this->setSerial($serial);
        $this->setFilename($filename);
        $newFilename = $this->getNewFilename($filename);
        $newSourceDir = $this->prepareNewSourceDir($serial);
        $this->rename($filename, $target = sprintf('%s/%s', $newSourceDir, $newFilename));
        $this->getSystemLogger()->notice(sprintf('Moved file %s to %s', $filename, $target));
        $this->mergeStatus(
            array(
                RegistryKeys::STATUS => array(
                    RegistryKeys::FILES => array(
                        $filename => array(
                            $this->getUniqueId() => array(
                                RegistryKeys::STATUS         => 1,
                                RegistryKeys::SKIPPED_ROWS   => $this->getSkippedRows(),
                                RegistryKeys::PROCESSED_ROWS => $this->getLineNumber() - 1
                            )
                        )
                    )
                )
            )
        );
    }
public function import ( $ serial , $ filename ) { $ this -> setSerial ( $ serial ) ; $ this -> setFilename ( $ filename ) ; $ newFilename = $ this -> getNewFilename ( $ filename ) ; $ newSourceDir = $ this -> prepareNewSourceDir ( $ serial ) ; $ this -> rename ( $ filename , $ target = sprintf ( '%s/%s' , $ newSourceDir , $ newFilename ) ) ; $ this -> getSystemLogger ( ) -> notice ( sprintf ( 'Moved file %s to %s' , $ filename , $ target ) ) ; $ this -> mergeStatus ( array ( RegistryKeys :: STATUS => array ( RegistryKeys :: FILES => array ( $ filename => array ( $ this -> getUniqueId ( ) => array ( RegistryKeys :: STATUS => 1 , RegistryKeys :: SKIPPED_ROWS => $ this -> getSkippedRows ( ) , RegistryKeys :: PROCESSED_ROWS => $ this -> getLineNumber ( ) - 1 ) ) ) ) ) ) ; }
Imports the content of the file with the passed filename.
Imports the content of the file with the passed filename .
// initialize the serial/filename // prepare the new filename, e. g. in case a specific filename has been // passed on the command line as second argument // prepare the new source directory // move the file to the new source directory // log a message that the original file has been moved // to the target directory, and probably renamed // update the status