Skip to content
Code-Schnipsel Gruppen Projekte
Commit 35c06789 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

psr2

Übergeordneter c0d021f6
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
...@@ -23,13 +23,14 @@ class Manager ...@@ -23,13 +23,14 @@ class Manager
/** /**
* Add a cron * Add a cron
* *
* @param String $cron - Name of the Cron * @param string $cron - Name of the Cron
* @param String $min - On which minute should it start * @param string $min - On which minute should it start
* @param String $hour - On which hour should it start * @param string $hour - On which hour should it start
* @param String $day - On which day should it start * @param string $day - On which day should it start
* @param String $month - On which month should it start * @param string $month - On which month should it start
* @param String $dayOfWeek - day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) * @param string $dayOfWeek - day of week (0 - 6) (0 to 6 are Sunday to Saturday,
* @param Array $params - Cron Parameter * or use names; 7 is Sunday, the same as 0)
* @param array $params - Cron Parameter
* *
* @throws QUI\Exception * @throws QUI\Exception
*/ */
...@@ -37,7 +38,7 @@ class Manager ...@@ -37,7 +38,7 @@ class Manager
{ {
Permission::checkPermission('quiqqer.cron.add'); Permission::checkPermission('quiqqer.cron.add');
if (!$this->_cronExists($cron)) { if (!$this->cronExists($cron)) {
throw new QUI\Exception( throw new QUI\Exception(
QUI::getLocale()->get('quiqqer/cron', 'exception.cron.1001'), QUI::getLocale()->get('quiqqer/cron', 'exception.cron.1001'),
1001 1001
...@@ -73,14 +74,14 @@ class Manager ...@@ -73,14 +74,14 @@ class Manager
/** /**
* Edit the cron * Edit the cron
* *
* @param String $cron - Name of the Cron * @param string $cron - Name of the Cron
* @param Integer $cronId * @param integer $cronId
* @param String $min * @param string $min
* @param String $hour * @param string $hour
* @param String $day * @param string $day
* @param String $month * @param string $month
* @param String $dayOfWeek * @param string $dayOfWeek
* @param Array $params * @param array $params
* *
* @throws QUI\Exception * @throws QUI\Exception
*/ */
...@@ -96,7 +97,7 @@ class Manager ...@@ -96,7 +97,7 @@ class Manager
) { ) {
Permission::checkPermission('quiqqer.cron.edit'); Permission::checkPermission('quiqqer.cron.edit');
if (!$this->_cronExists($cron)) { if (!$this->cronExists($cron)) {
throw new QUI\Exception( throw new QUI\Exception(
QUI::getLocale()->get('quiqqer/cron', 'exception.cron.1002'), QUI::getLocale()->get('quiqqer/cron', 'exception.cron.1002'),
1002 1002
...@@ -139,7 +140,7 @@ class Manager ...@@ -139,7 +140,7 @@ class Manager
/** /**
* activate a cron in the cron list * activate a cron in the cron list
* *
* @param Integer $cronId - ID of the cron * @param integer $cronId - ID of the cron
*/ */
public function activateCron($cronId) public function activateCron($cronId)
{ {
...@@ -155,7 +156,7 @@ class Manager ...@@ -155,7 +156,7 @@ class Manager
/** /**
* deactivate a cron in the cron list * deactivate a cron in the cron list
* *
* @param Integer $cronId - ID of the cron * @param integer $cronId - ID of the cron
*/ */
public function deactivateCron($cronId) public function deactivateCron($cronId)
{ {
...@@ -171,7 +172,7 @@ class Manager ...@@ -171,7 +172,7 @@ class Manager
/** /**
* Delete the crons * Delete the crons
* *
* @param Array $ids - Array of the Cron-Ids * @param array $ids - Array of the Cron-Ids
*/ */
public function deleteCronIds($ids) public function deleteCronIds($ids)
{ {
...@@ -250,7 +251,7 @@ class Manager ...@@ -250,7 +251,7 @@ class Manager
/** /**
* Execute a cron * Execute a cron
* *
* @param Integer $cronId - ID of the cron * @param integer $cronId - ID of the cron
* *
* @return \QUI\Cron\Manager * @return \QUI\Cron\Manager
* @throws QUI\Exception * @throws QUI\Exception
...@@ -290,7 +291,7 @@ class Manager ...@@ -290,7 +291,7 @@ class Manager
) )
); );
QUI::getDataBase()->insert(self::TableHistory(), array( QUI::getDataBase()->insert(self::tableHistory(), array(
'cronid' => $cronId, 'cronid' => $cronId,
'lastexec' => date('Y-m-d H:i:s'), 'lastexec' => date('Y-m-d H:i:s'),
'uid' => QUI::getUserBySession()->getId() 'uid' => QUI::getUserBySession()->getId()
...@@ -309,7 +310,7 @@ class Manager ...@@ -309,7 +310,7 @@ class Manager
/** /**
* Return the Crons which are available and from other Plugins provided * Return the Crons which are available and from other Plugins provided
* *
* @return Array * @return array
*/ */
public function getAvailableCrons() public function getAvailableCrons()
{ {
...@@ -338,9 +339,9 @@ class Manager ...@@ -338,9 +339,9 @@ class Manager
/** /**
* Return the data of a inserted cron * Return the data of a inserted cron
* *
* @param Integer $cronId - ID of the Cron * @param integer $cronId - ID of the Cron
* *
* @return Array|false - Cron Data * @return array|false - Cron Data
*/ */
public function getCronById($cronId) public function getCronById($cronId)
{ {
...@@ -363,9 +364,9 @@ class Manager ...@@ -363,9 +364,9 @@ class Manager
* Return the data of a specific cron from the available cron list * Return the data of a specific cron from the available cron list
* This cron is not in the cron list * This cron is not in the cron list
* *
* @param String $cron - Name of the Cron * @param string $cron - Name of the Cron
* *
* @return Array|false - Cron Data * @return array|false - Cron Data
*/ */
public function getCronData($cron) public function getCronData($cron)
{ {
...@@ -399,7 +400,7 @@ class Manager ...@@ -399,7 +400,7 @@ class Manager
} }
$data = QUI::getDataBase()->fetch(array( $data = QUI::getDataBase()->fetch(array(
'from' => self::TableHistory(), 'from' => self::tableHistory(),
'limit' => $limit, 'limit' => $limit,
'order' => $order 'order' => $order
)); ));
...@@ -430,7 +431,6 @@ class Manager ...@@ -430,7 +431,6 @@ class Manager
$entry['username'] = $Users->get($entry['uid'])->getName(); $entry['username'] = $Users->get($entry['uid'])->getName();
} catch (QUI\Exception $Exception) { } catch (QUI\Exception $Exception) {
} }
$result[] = $entry; $result[] = $entry;
...@@ -442,12 +442,12 @@ class Manager ...@@ -442,12 +442,12 @@ class Manager
/** /**
* Return the history count, how many history entries exist * Return the history count, how many history entries exist
* *
* @return Integer * @return integer
*/ */
public function getHistoryCount() public function getHistoryCount()
{ {
$result = QUI::getDataBase()->fetch(array( $result = QUI::getDataBase()->fetch(array(
'from' => self::TableHistory(), 'from' => self::tableHistory(),
'count' => 'id' 'count' => 'id'
)); ));
...@@ -457,7 +457,7 @@ class Manager ...@@ -457,7 +457,7 @@ class Manager
/** /**
* Return the cron list * Return the cron list
* *
* @return Array * @return array
*/ */
public function getList() public function getList()
{ {
...@@ -473,7 +473,7 @@ class Manager ...@@ -473,7 +473,7 @@ class Manager
* *
* @return Bool * @return Bool
*/ */
protected function _cronExists($cron) protected function cronExists($cron)
{ {
return $this->getCronData($cron) === false ? false : true; return $this->getCronData($cron) === false ? false : true;
} }
...@@ -485,9 +485,9 @@ class Manager ...@@ -485,9 +485,9 @@ class Manager
/** /**
* Return the cron tabe * Return the cron tabe
* *
* @return String * @return string
*/ */
static function Table() public static function TABLE()
{ {
return QUI_DB_PRFX . 'cron'; return QUI_DB_PRFX . 'cron';
} }
...@@ -495,9 +495,9 @@ class Manager ...@@ -495,9 +495,9 @@ class Manager
/** /**
* Return the cron tabe * Return the cron tabe
* *
* @return String * @return string
*/ */
static function TableHistory() public static function tableHistory()
{ {
return QUI_DB_PRFX . 'cron_history'; return QUI_DB_PRFX . 'cron_history';
} }
...@@ -505,11 +505,11 @@ class Manager ...@@ -505,11 +505,11 @@ class Manager
/** /**
* Return the Crons from a XML File * Return the Crons from a XML File
* *
* @param String $file * @param string $file
* *
* @return Array * @return array
*/ */
static function getCronsFromFile($file) public static function getCronsFromFile($file)
{ {
if (!file_exists($file)) { if (!file_exists($file)) {
return array(); return array();
...@@ -554,6 +554,7 @@ class Manager ...@@ -554,6 +554,7 @@ class Manager
if ($Params->length) { if ($Params->length) {
foreach ($Params as $Param) { foreach ($Params as $Param) {
/* @var $Param \DOMElement */
$params[] = array( $params[] = array(
'name' => $Param->getAttribute('name'), 'name' => $Param->getAttribute('name'),
'type' => $Param->getAttribute('type') 'type' => $Param->getAttribute('type')
...@@ -577,7 +578,7 @@ class Manager ...@@ -577,7 +578,7 @@ class Manager
* *
* @param String $message - Message * @param String $message - Message
*/ */
static function log($message) public static function log($message)
{ {
QUI\System\Log::addInfo($message, array(), 'cron'); QUI\System\Log::addInfo($message, array(), 'cron');
} }
......
...@@ -18,7 +18,7 @@ class QuiqqerCrons ...@@ -18,7 +18,7 @@ class QuiqqerCrons
/** /**
* Clear the temp folder * Clear the temp folder
*/ */
static function clearTempFolder() public static function clearTempFolder()
{ {
$Temp = QUI::getTemp(); $Temp = QUI::getTemp();
$Temp->clear(); $Temp->clear();
...@@ -27,7 +27,7 @@ class QuiqqerCrons ...@@ -27,7 +27,7 @@ class QuiqqerCrons
/** /**
* Clear complete cache * Clear complete cache
*/ */
static function clearCache() public static function clearCache()
{ {
QUI\Cache\Manager::clearAll(); QUI\Cache\Manager::clearAll();
} }
...@@ -35,7 +35,7 @@ class QuiqqerCrons ...@@ -35,7 +35,7 @@ class QuiqqerCrons
/** /**
* Purge the cache * Purge the cache
*/ */
static function purgeCache() public static function purgeCache()
{ {
QUI\Cache\Manager::purge(); QUI\Cache\Manager::purge();
} }
...@@ -43,7 +43,7 @@ class QuiqqerCrons ...@@ -43,7 +43,7 @@ class QuiqqerCrons
/** /**
* Clear the media cache of the administration * Clear the media cache of the administration
*/ */
static function clearAdminMediaCache() public static function clearAdminMediaCache()
{ {
QUI\Utils\System\File::unlink(VAR_DIR . 'cache/admin/media/'); QUI\Utils\System\File::unlink(VAR_DIR . 'cache/admin/media/');
} }
...@@ -52,12 +52,12 @@ class QuiqqerCrons ...@@ -52,12 +52,12 @@ class QuiqqerCrons
* Check project sites release dates * Check project sites release dates
* Activate or deactivate sites * Activate or deactivate sites
* *
* @param Array $params - Cron Parameter * @param array $params - Cron Parameter
* @param \QUI\Cron\Manager $CronManager * @param \QUI\Cron\Manager $CronManager
* *
* @throws QUI\Exception * @throws QUI\Exception
*/ */
static function realeaseDate($params, $CronManager) public static function realeaseDate($params, $CronManager)
{ {
if (!isset($params['project'])) { if (!isset($params['project'])) {
throw new QUI\Exception('Need a project parameter to search release dates'); throw new QUI\Exception('Need a project parameter to search release dates');
...@@ -159,7 +159,7 @@ class QuiqqerCrons ...@@ -159,7 +159,7 @@ class QuiqqerCrons
* @param array $params * @param array $params
* @param \QUI\Cron\Manager $CronManager * @param \QUI\Cron\Manager $CronManager
*/ */
static function mailQueue($params, $CronManager) public static function mailQueue($params, $CronManager)
{ {
$MailQueue = new QUI\Mail\Queue(); $MailQueue = new QUI\Mail\Queue();
...@@ -167,4 +167,4 @@ class QuiqqerCrons ...@@ -167,4 +167,4 @@ class QuiqqerCrons
$MailQueue->send(); $MailQueue->send();
} }
} }
} }
\ No newline at end of file
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren