diff --git a/module/instance/control.php b/module/instance/control.php index 7ba3ae0a77..f752a6c696 100644 --- a/module/instance/control.php +++ b/module/instance/control.php @@ -666,16 +666,16 @@ class instance extends control */ public function cronCleanBackup() { - if(!$this->config->inQuickon) return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'NoCleanBackupFiles'))); + if(!$this->config->inQuickon) return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['NoCleanBackupFiles'])); /* Init instance list. */ $instances = $this->loadModel('space')->getSpaceInstances(0, 'running'); - if(empty($instances)) return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'NoCleanBackupFiles'))); + if(empty($instances)) return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['NoCleanBackupFiles'])); /* Cycle cleaning backup. */ foreach($instances as $instance) $this->instance->cleanBackup($instance); - return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'cleanBackupSuccess'))); + return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['cleanBackupSuccess'])); } /** diff --git a/module/instance/test/model/getbyname.php b/module/instance/test/model/getbyname.php new file mode 100644 index 0000000000..aad616e908 --- /dev/null +++ b/module/instance/test/model/getbyname.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +gen(5); + +/** + +title=instanceModel->getByName(); +timeout=0 +cid=1 + +- 查看获取到的第一条instance +- 查询 禅道开源版 是否存在 @禅道开源版 +- 查询 禅道旗舰版 是否存在 @禅道旗舰版 +- 查询 禅道企业版 是否存在 @禅道企业版 +- 查询 解决方案3 是否存在 @0 +- 查询 解决方案1 是否存在 @0 + */ + +global $tester; +$tester->loadModel('instance'); + +$instance = $tester->instance->getByName('禅道开源版'); +r($instance) && p('name') && e('0'); + +$instance = $tester->instance->getByName('禅道旗舰版'); +r($instance) && p('name') && e('0'); + +$instance = $tester->instance->getByName('禅道企业版'); +r($instance) && p('name') && e('0'); + +$instance = $tester->instance->getByName('解决方案3'); +r(empty($instance)) && p('1') && e('1'); + +$instance = $tester->instance->getByName('解决方案1'); +r(empty($instance)) && p('1') && e('1');