24 $susp = Yii::app()->getRequest()->getPost(
'suspend');
25 $historyCleanupParam = Yii::app()->getRequest()->getPost(
'history');
26 $state = Yii::app()->getRequest()->getPost(
'state');
31 if ($historyCleanupParam != null)
36 "taskType" => $taskType,
48 $reqFile = tempnam(Yii::app()->getBasePath() .
'/json_temp',
'');
49 $request = fopen($reqFile,
"w");
50 fwrite($request,
$json);
71 $this->operation =
"Suspend site";
72 } elseif ($state == 1) {
73 $this->operation =
"Run site";
78 "description" => null,
82 "httpTimeout" => null,
86 "maxResourceSize" => null,
87 "maxResources" => null,
91 "requestDelay" => null,
100 "processingDelay" => null,
103 "avgSpeedCounter" => null,
104 "maxURLsFromPage" => null,
105 "criterions" => array(
106 "WHERE" =>
"`State`<>$state"
109 "recrawlPeriod" => null,
110 "recrawlDate" => null,
111 "collectedURLs" => null,
118 $reqFile = tempnam(Yii::app()->getBasePath() .
'/json_temp',
'');
119 $request = fopen($reqFile,
"w");
120 fwrite($request,
$json);
123 $api = Yii::app()->params[
'api'];
125 $path = Yii::app()->getBasePath() .
'/shell/';
126 $cmd =
"sh " . $path .
"rnd_site_update.sh $api $reqFile";
128 $json = shell_exec($cmd);
131 Yii::app()->user->setFlash(
'error' . (
string)$state, $this->operation .
' ERROR: ' . $error);
133 Yii::app()->user->setFlash(
'success' . (
string)$state, $this->operation .
': SUCCESS');
150 $this->operation =
"Cleanup";
152 $api = Yii::app()->params[
'api'];
154 $path = Yii::app()->getBasePath() .
'/shell/';
155 $cmd =
"sh " . $path .
"rnd_site_cleanup.sh $api $reqFile";
157 $json = shell_exec($cmd);
160 Yii::app()->user->setFlash(
'error2', $this->operation .
' ERROR: ' . $error);
162 Yii::app()->user->setFlash(
'success2', $this->operation .
': SUCCESS');