Public Member Functions | |
__construct ($name) | |
isNew () | |
getExt ($filename) | |
processWork () | |
processNews ($xml, $xml_filename=null, $specific=false) | |
processMeldung ($parserXML, $xml_filename=null) | |
processBild ($parserXML, $xml_filename=null) | |
processRemoval ($xml, $xml_filename=null) | |
clearOld () | |
removeFilesByName ($files) | |
checkMMParents () | |
makeRelations () | |
makePath ($folder, $file) | |
makeWorkPath ($file) | |
makeDonePath ($file) | |
makeErrorPath ($file) | |
makeImagesPath ($file) | |
makeVideosPath ($file) | |
moveToWork () | |
moveFileToDone ($file) | |
moveFileToError ($file) | |
moveDoneFileToError ($file) |
Public Attributes | |
$name | |
$fertigPath | |
$path | |
$workPath | |
$donePath | |
$errorPath | |
$wwwPath | |
$imagesPath | |
$videosPath |
Static Public Attributes | |
static | $instance |
Created by JetBrains PhpStorm. User: Andrew Date: 07.06.13 Time: 19:35 To change this template use File | Settings | File Templates. Class for process a channel (import news from xml into database)
all parameters will be described in the part of current channel because 1 object of this class = 1 channel !!!
Definition at line 20 of file Channel.php.
Channel::__construct | ( | $name | ) |
Constructor initializes all parameters and makes necessary folders if they are not
Definition at line 93 of file Channel.php.
References isNew().
Channel::checkMMParents | ( | ) |
Function removes multimedia records which have not parent news
Definition at line 483 of file Channel.php.
References ApalinesMM\model().
Referenced by processWork().
Channel::clearOld | ( | ) |
Function removes news and child news,files those lifetime is up
Definition at line 437 of file Channel.php.
References ApalinesNews\model().
Channel::getExt | ( | $filename | ) |
Function returns extension of filename
string | $filename | - name of file |
Definition at line 175 of file Channel.php.
Referenced by processWork().
Channel::isNew | ( | ) |
Function checks whether channel has updates
Definition at line 164 of file Channel.php.
Referenced by __construct().
Channel::makeDonePath | ( | $file | ) |
Function makes path to file which placed in done folder
string | $file | name of the file |
Definition at line 548 of file Channel.php.
References makePath().
Referenced by moveDoneFileToError(), and moveFileToDone().
Channel::makeErrorPath | ( | $file | ) |
Function makes path to file which placed in error folder
string | $file | name of the file |
Definition at line 559 of file Channel.php.
References makePath().
Referenced by moveDoneFileToError(), and moveFileToError().
Channel::makeImagesPath | ( | $file | ) |
Function makes path to file which placed in images folder
string | $file | name of the file |
Definition at line 570 of file Channel.php.
References makePath().
Referenced by processWork(), and removeFilesByName().
Channel::makePath | ( | $folder, | |
$file | |||
) |
Function makes path to the file which placed in recieved folder path
string | $folder | path to folder where the file placed |
string | $file | name of the file |
Definition at line 526 of file Channel.php.
Referenced by makeDonePath(), makeErrorPath(), makeImagesPath(), makeVideosPath(), makeWorkPath(), and moveToWork().
Channel::makeRelations | ( | ) |
Function make relations between database apa records
Definition at line 493 of file Channel.php.
References ApalinesNews\model(), and ApalinesMM\model().
Referenced by processWork().
Channel::makeVideosPath | ( | $file | ) |
Function makes path to file which placed in videos folder
string | $file | name of the file |
Definition at line 581 of file Channel.php.
References makePath().
Referenced by processWork(), and removeFilesByName().
Channel::makeWorkPath | ( | $file | ) |
Function makes path to file which placed in work folder
string | $file | name of the file |
Definition at line 537 of file Channel.php.
References makePath().
Referenced by moveFileToDone(), moveFileToError(), moveToWork(), and processWork().
Channel::moveDoneFileToError | ( | $file | ) |
Function moves the file from done folder to error folder. This function is needed if multimedia was successfully imported but it has not parents, so it should be removed and marked as error
Definition at line 631 of file Channel.php.
References makeDonePath(), and makeErrorPath().
Channel::moveFileToDone | ( | $file | ) |
Function moves the file from work folder to done folder
string | $file | name of the file |
Definition at line 610 of file Channel.php.
References makeDonePath(), and makeWorkPath().
Referenced by processNews(), and processRemoval().
Channel::moveFileToError | ( | $file | ) |
Function moves the file from work folder to error folder
string | $file | name of the file |
Definition at line 620 of file Channel.php.
References makeErrorPath(), and makeWorkPath().
Referenced by processNews(), and processRemoval().
Channel::moveToWork | ( | ) |
Function moves all files from main channel folder to work folder
Definition at line 588 of file Channel.php.
References makePath(), and makeWorkPath().
Channel::processBild | ( | $parserXML, | |
$xml_filename = null |
|||
) |
Function processes multimedia xml files
object | $parserXML | object of parserXml class |
string | $xml_filename | name of xml file |
Definition at line 345 of file Channel.php.
References ApalinesMM\model().
Referenced by processNews().
Channel::processMeldung | ( | $parserXML, | |
$xml_filename = null |
|||
) |
Function processes news xml files
object | $parserXML | object of parserXml class |
string | $xml_filename | name of xml file |
Definition at line 279 of file Channel.php.
References ApalinesNews\model().
Referenced by processNews().
Channel::processNews | ( | $xml, | |
$xml_filename = null , |
|||
$specific = false |
|||
) |
Function processes: news and multimedia(images/video) xml files
object | $xml | SimpleXMLElement |
string | $xml_filename | name of xml file |
array | $specific | what files should be processed |
Definition at line 245 of file Channel.php.
References moveFileToDone(), moveFileToError(), processBild(), and processMeldung().
Referenced by processWork().
Channel::processRemoval | ( | $xml, | |
$xml_filename = null |
|||
) |
Function processes removing xml files
object | $parserXML | object of parserXml class |
string | $xml_filename | name of xml file |
Definition at line 412 of file Channel.php.
References ApalinesNews\model(), ApalinesMM\model(), moveFileToDone(), and moveFileToError().
Referenced by processWork().
Channel::processWork | ( | ) |
Function processes files in work folder: distributes what handler should process each file
Definition at line 182 of file Channel.php.
References checkMMParents(), getExt(), makeImagesPath(), makeRelations(), makeVideosPath(), makeWorkPath(), processNews(), and processRemoval().
Channel::removeFilesByName | ( | $files | ) |
Function removes multimedia files from public folder by file names
array | $files | - names of files which should be removed |
Definition at line 468 of file Channel.php.
References makeImagesPath(), and makeVideosPath().