✏️ 正在编辑: AtualizacaoSistemaController.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/controllers/AtualizacaoSistemaController.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class AtualizacaoSistemaController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { $request = $this->getRequest(); if( Yuppie_Auth::hasIdentity() ){ $configFile = APPLICATION_PATH . '/../docs/atualizacao-sistema.txt'; if( file_exists($configFile) ){ $dtTime = filemtime($configFile); $dateFile = new Zend_Date($dtTime); $this->view->data_ultima_atualizacao = $dateFile->get('dd/MM/yyyy HH:mm:ss'); $cfg = file($configFile); if( count($cfg) > 0 ){ $this->view->cfg = $cfg; if( $request->isXmlHttpRequest() ){ $now = Zend_Date::now(); $dias = floor(((($now->get() - $dateFile->get()) / 60) / 60) / 24); //exibir o badge // 1) se a última atualização foi na sexta e hoje é segunda // 2) se q diferença de dias if( ($now->get(Zend_Date::WEEKDAY_DIGIT ) == 1 && $dateFile->get(Zend_Date::WEEKDAY_DIGIT == 5) && $dias < 3) || ($dias <= 1) ){ $this->_helper->json(array( 'success' => "Houve uma atualização no sistema.", 'badge' => count($cfg) )); } } } } } } }
💾 保存文件
← 返回文件管理器