当前位置: 首页>>代码示例>>PHP>>正文


PHP Server::getDaemon方法代码示例

本文整理汇总了PHP中Server::getDaemon方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::getDaemon方法的具体用法?PHP Server::getDaemon怎么用?PHP Server::getDaemon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server的用法示例。


在下文中一共展示了Server::getDaemon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionConfigs

 public function actionConfigs($id)
 {
     Yii::app()->user->can($id, 'edit configs', true);
     $configs = ConfigFile::model()->findAll();
     $dmn = Server::getDaemon($id);
     $list = array();
     $error = '';
     foreach ($configs as $cfg) {
         if (!$cfg->enabled) {
             continue;
         }
         $res = McBridge::get()->cmd($dmn, 'server ' . $id . ':cfgfile check:' . $cfg->file . ':' . $cfg->dir . ':');
         if (!$res['success'] || !isset($res['data'][0])) {
             $error = CHtml::encode($res['error']);
             continue;
         }
         foreach ($res['data'] as $data) {
             if ($data['valid'] != 'True') {
                 continue;
             }
             $name = $this->replData($cfg->name, $data['file'], $data['dir']);
             $desc = $this->replData($cfg->description, $data['file'], $data['dir']);
             $list[] = array('id' => $cfg->id, 'name' => $name, 'desc' => $desc, 'ro' => $data['ro'], 'file' => $data['file'], 'dir' => $data['dir'], 'action' => $data['ro'] == 'True' ? 'View' : 'Edit');
         }
     }
     $perm = McBridge::get()->cmd($dmn, 'server ' . $id . ':cfgfile check:[Pp]ermissions.[Jj][Aa][Rr]:plugins/:');
     if ($perm['success'] && isset($perm['data'][0])) {
         $perm = true;
     } else {
         $perm = false;
     }
     $this->render('configs', array('dataProvider' => new CArrayDataProvider($list, array('sort' => array('attributes' => array('name')), 'pagination' => array('pageSize' => 10))), 'model' => $this->loadModel($id), 'error' => $error, 'perm' => $perm));
 }
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:33,代码来源:ServerController.php

示例2: serverCmd

 public function serverCmd($server, $cmd, &$data = null, $broadcast = false, $nocache = false)
 {
     $command = $cmd;
     $r = array();
     if (($cache = CommandCache::get($server, $command, $r)) === 1) {
         if (@$r['success']) {
             $data = @$r['data'];
             return true;
         }
         $this->addError(@$r['error']);
         return false;
     }
     $cmd = 'server ' . $server . ':' . $cmd;
     $ret = array();
     if ($broadcast) {
         $ret = $this->globalCmd($cmd);
     } else {
         $ret = array($this->cmd(Server::getDaemon($server), $cmd));
     }
     $e = '';
     foreach ($ret as $r) {
         if ($cache !== 0) {
             CommandCache::set($server, $command, $r);
         }
         if ($r['success']) {
             $data = $r['data'];
             return true;
         }
         $e = $r['error'];
     }
     $this->addError($e);
     return false;
 }
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:33,代码来源:McBridge.php


注:本文中的Server::getDaemon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。