/**
  * Start process
  * @param array $arg
  * @return int|void
  */
 public function run($arg)
 {
     if (Yii::app()->mutex->lock('sync_data', 300)) {
         if ($this->setOptions() and self::$_status) {
             $this->_logger->log(__METHOD__ . " Insert/update data in db_long");
             if (self::$LOG) {
                 dd::msg("\n");
                 dd::msg_date("Insert/update data in db_long");
             }
             foreach (self::$_tables as $Class => $Column) {
                 $this->syncTable($Class, $Column);
             }
             $this->_logger->log(__METHOD__ . " Delete long term data in db");
             if (self::$LOG) {
                 dd::msg("\n");
                 dd::msg_date("Delete long term data in db");
             }
             self::$_tables = array_reverse(self::$_tables);
             foreach (self::$_tables as $Class => $Column) {
                 $this->deleteOldRowTable($Class, $Column);
             }
             $this->_logger->log(__METHOD__ . " END");
         }
         Yii::app()->mutex->unlock();
     }
 }
Beispiel #2
0
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . '/classes2/autoloadclasses.php';
restore_error_handler();
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
$tristar = TS_TriStar::get();
$current_user = new TS_User();
if (!$current_user->hasAccess('Admin', 'test_scripts')) {
    die('Sorry, je hebt geen toegang tot deze pagina.');
}
?>
<html><head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>[Test] Personeel Vrij Planning</title>
	<link rel="stylesheet" type="text/css" href="<?php 
echo TS_Module_HRM_PresencePlanning_Constants::MODULE_ROOT_PATH . 'css/mainstyles.css';
?>
">
</head><body style="font: 12px Verdana, Geneva, sans-serif;"><pre>
<?php 
$filter_ar = array('month' => 9, 'year' => 2015);
$result = TS_Module_HRM_PresencePlanning_Tables_PlanningTable::getJSONRecordsData($current_user, $filter_ar);
dd::show($result);
?>
</pre></body></html>