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


PHP CApplication类代码示例

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


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

示例1: CCheckBox

 $form->addVar('hostid', $_REQUEST['hostid']);
 $table->setHeader(array(new CCheckBox('all_applications', NULL, "checkAll('" . $form->getName() . "','all_applications','applications');"), $_REQUEST['hostid'] > 0 ? null : S_HOST, make_sorting_header(S_APPLICATION, 'name'), S_SHOW));
 $sortfield = getPageSortField('name');
 $sortorder = getPageSortOrder();
 $options = array('output' => API_OUTPUT_SHORTEN, 'editable' => 1, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1);
 if ($pageFilter->hostid > 0) {
     $options['hostids'] = $pageFilter->hostid;
 } else {
     if ($pageFilter->groupid > 0) {
         $options['groupids'] = $pageFilter->groupid;
     }
 }
 $applications = CApplication::get($options);
 $paging = getPagingLine($applications);
 $options = array('applicationids' => zbx_objectValues($applications, 'applicationid'), 'output' => API_OUTPUT_EXTEND, 'select_items' => API_OUTPUT_REFER, 'expandData' => 1);
 $applications = CApplication::get($options);
 order_result($applications, $sortfield, $sortorder);
 foreach ($applications as $anum => $application) {
     $applicationid = $application['applicationid'];
     if ($application['templateid'] == 0) {
         $name = new CLink($application['name'], 'applications.php?form=update&applicationid=' . $applicationid);
     } else {
         $template_host = get_realhost_by_applicationid($application['templateid']);
         $name = array(new CLink($template_host['host'], 'applications.php?hostid=' . $template_host['hostid']), ':', $application['name']);
     }
     $table->addRow(array(new CCheckBox('applications[' . $applicationid . ']', NULL, NULL, $applicationid), $_REQUEST['hostid'] > 0 ? null : $application['host'], $name, array(new CLink(S_ITEMS, 'items.php?hostid=' . $_REQUEST['hostid'] . '&filter_set=1&filter_application=' . urlencode($application['name'])), SPACE . '(' . count($application['items']) . ')')));
 }
 // goBox
 $goBox = new CComboBox('go');
 $goOption = new CComboItem('activate', S_ACTIVATE_SELECTED);
 $goOption->setAttribute('confirm', S_ACTIVATE_SELECTED_APPLICATIONS);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:applications.php

示例2: require_once

<?
require_once($_SERVER['DOCUMENT_ROOT'] . '/apps/vendor/autoload.php');  // init Composer
require_once($_SERVER['DOCUMENT_ROOT'] . '/apps/vendor/phpoffice/phpexcel-1-8-1/Classes/PHPExcel.php');  // init Composer
require_once("tools.php");
require_once("classes/cb24.php");
require_once("classes/capplication.php");

global $firstDay, $lastDay, $arDate;

if (!empty($_REQUEST)) {
    $obApp = new CApplication();
    $obApp->start();
   if ($obApp->is_ajax_mode) {
       $obApp->manageAjax($_REQUEST['operation']);
   } else {
       header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
       header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
       header("Cache-Control: no-cache, must-revalidate");
       header("Pragma: no-cache");
       $obApp->getItems($arDate[$obApp->arSettings['firstDay']], $arDate[$obApp->arSettings['lastDay']]);
       $obApp->draw_main_UI();

      // echo "<pre>" . var_export($arDate) . "</pre> "; // Вывод отладочной инфы
   }
}





开发者ID:Nikktr,项目名称:report-master,代码行数:25,代码来源:index.php

示例3: parseMain


//.........这里部分代码省略.........
                     add_host_profile_ext($current_host['hostid'], $profile_ext);
                 }
                 // }}} HOST PROFILES
                 // ITEMS {{{
                 if (isset($rules['item']['exist']) || isset($rules['item']['missed'])) {
                     $items = $xpath->query('items/item', $host);
                     foreach ($items as $inum => $item) {
                         $item_db = self::mapXML2arr($item, XML_TAG_ITEM);
                         $item_db['hostid'] = $current_host['hostid'];
                         if ($current_item = CItem::exists($item_db)) {
                             $options = array('filter' => array('hostid' => $item_db['hostid'], 'key_' => $item_db['key_']), 'webitems' => 1, 'output' => API_OUTPUT_EXTEND, 'editable' => 1);
                             $current_item = CItem::get($options);
                             if (empty($current_item)) {
                                 throw new APIException(1, 'No permission for Item [' . $item_db['key_'] . ']');
                             }
                             $current_item = reset($current_item);
                         }
                         if (!$current_item && !isset($rules['item']['missed'])) {
                             info('Item [' . $item_db['key_'] . '] skipped - user rule');
                             continue;
                             // break if not update exist
                         }
                         if ($current_item && !isset($rules['item']['exist'])) {
                             info('Item [' . $item_db['key_'] . '] skipped - user rule');
                             continue;
                             // break if not update exist
                         }
                         // ITEM APPLICATIONS {{{
                         $applications = $xpath->query('applications/application', $item);
                         $item_applications = array();
                         $applications_to_add = array();
                         foreach ($applications as $application) {
                             $application_db = array('name' => $application->nodeValue, 'hostid' => $current_host['hostid']);
                             if ($current_application = CApplication::exists($application_db)) {
                                 $current_application = CApplication::get(array('filter' => $application_db, 'output' => API_OUTPUT_EXTEND));
                                 if (empty($current_application)) {
                                     throw new APIException(1, 'No permission for Application [' . $application_db['name'] . ']');
                                 }
                             }
                             if ($current_application) {
                                 $item_applications = array_merge($item_applications, $current_application);
                             } else {
                                 $applications_to_add[] = $application_db;
                             }
                         }
                         if (!empty($applications_to_add)) {
                             $result = CApplication::create($applications_to_add);
                             if (!$result) {
                                 throw new APIException(1, CApplication::resetErrors());
                             }
                             $options = array('applicationids' => $result['applicationids'], 'output' => API_OUTPUT_EXTEND);
                             $new_applications = CApplication::get($options);
                             $item_applications = array_merge($item_applications, $new_applications);
                         }
                         // }}} ITEM APPLICATIONS
                         if ($current_item && isset($rules['item']['exist'])) {
                             $item_db['itemid'] = $current_item['itemid'];
                             $result = CItem::update($item_db);
                             if (!$result) {
                                 throw new APIException(1, CItem::resetErrors());
                             }
                             $options = array('itemids' => $result['itemids'], 'webitems' => 1, 'output' => API_OUTPUT_EXTEND);
                             $current_item = CItem::get($options);
                         }
                         if (!$current_item && isset($rules['item']['missed'])) {
                             $result = CItem::create($item_db);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:67,代码来源:export.inc.php

示例4: db_save_httptest

function db_save_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps)
{
    $history = 30;
    // TODO !!! Allow user to set this parameter
    $trends = 90;
    // TODO !!! Allow user to set this parameter
    if (!preg_match('/^([' . ZBX_PREG_PRINT . '])+$/u', $name)) {
        error(S_ONLY_CHARACTERS_ARE_ALLOWED);
        return false;
    }
    DBstart();
    try {
        $sql = 'SELECT t.httptestid' . ' FROM httptest t, applications a' . ' WHERE t.applicationid=a.applicationid' . ' AND a.hostid=' . $hostid . ' AND t.name=' . zbx_dbstr($name);
        $t = DBfetch(DBselect($sql));
        if (isset($httptestid) && $t && $t['httptestid'] != $httptestid || $t && !isset($httptestid)) {
            throw new Exception(S_SCENARIO_WITH_NAME . ' [ ' . $name . ' ] ' . S_ALREADY_EXISTS_SMALL);
        }
        $sql = 'SELECT applicationid FROM applications WHERE name=' . zbx_dbstr($application) . ' AND hostid=' . $hostid;
        if ($applicationid = DBfetch(DBselect($sql))) {
            $applicationid = $applicationid['applicationid'];
        } else {
            $result = CApplication::create(array('name' => $application, 'hostid' => $hostid));
            if (!$result) {
                throw new Exception(S_CANNOT_ADD_NEW_APPLICATION . ' [ ' . $application . ' ]');
            } else {
                $applicationid = reset($result['applicationids']);
            }
        }
        if (isset($httptestid)) {
            $sql = 'UPDATE httptest SET ' . ' applicationid=' . $applicationid . ', ' . ' name=' . zbx_dbstr($name) . ', ' . ' authentication=' . $authentication . ', ' . ' http_user=' . zbx_dbstr($http_user) . ', ' . ' http_password=' . zbx_dbstr($http_password) . ', ' . ' delay=' . $delay . ', ' . ' status=' . $status . ', ' . ' agent=' . zbx_dbstr($agent) . ', ' . ' macros=' . zbx_dbstr($macros) . ', ' . ' error=' . zbx_dbstr('') . ', ' . ' curstate=' . HTTPTEST_STATE_UNKNOWN . ' WHERE httptestid=' . $httptestid;
            if (!DBexecute($sql)) {
                throw new Exception('DBerror');
            }
        } else {
            $httptestid = get_dbid('httptest', 'httptestid');
            $values = array('httptestid' => $httptestid, 'applicationid' => $applicationid, 'name' => zbx_dbstr($name), 'authentication' => $authentication, 'http_user' => zbx_dbstr($http_user), 'http_password' => zbx_dbstr($http_password), 'delay' => $delay, 'status' => $status, 'agent' => zbx_dbstr($agent), 'macros' => zbx_dbstr($macros), 'curstate' => HTTPTEST_STATE_UNKNOWN);
            $sql = 'INSERT INTO httptest (' . implode(', ', array_keys($values)) . ') VALUES (' . implode(', ', $values) . ')';
            if (!DBexecute($sql)) {
                throw new Exception('DBerror');
            }
        }
        $httpstepids = array();
        foreach ($steps as $sid => $s) {
            if (!isset($s['name'])) {
                $s['name'] = '';
            }
            if (!isset($s['timeout'])) {
                $s['timeout'] = 15;
            }
            if (!isset($s['url'])) {
                $s['url'] = '';
            }
            if (!isset($s['posts'])) {
                $s['posts'] = '';
            }
            if (!isset($s['required'])) {
                $s['required'] = '';
            }
            if (!isset($s['status_codes'])) {
                $s['status_codes'] = '';
            }
            $result = db_save_step($hostid, $applicationid, $httptestid, $name, $s['name'], $sid + 1, $s['timeout'], $s['url'], $s['posts'], $s['required'], $s['status_codes'], $delay, $history, $trends);
            if (!$result) {
                throw new Exception('Cannot create web step');
            }
            $httpstepids[$result] = $result;
        }
        /* clean unneeded steps */
        $sql = 'SELECT httpstepid FROM httpstep WHERE httptestid=' . $httptestid;
        $db_steps = DBselect($sql);
        while ($step_data = DBfetch($db_steps)) {
            if (!isset($httpstepids[$step_data['httpstepid']])) {
                delete_httpstep($step_data['httpstepid']);
            }
        }
        $monitored_items = array(array('description' => 'Download speed for scenario \'$1\'', 'key_' => 'web.test.in[' . $name . ',,bps]', 'type' => ITEM_VALUE_TYPE_FLOAT, 'units' => 'Bps', 'httptestitemtype' => HTTPSTEP_ITEM_TYPE_IN), array('description' => 'Failed step of scenario \'$1\'', 'key_' => 'web.test.fail[' . $name . ']', 'type' => ITEM_VALUE_TYPE_UINT64, 'units' => '', 'httptestitemtype' => HTTPSTEP_ITEM_TYPE_LASTSTEP));
        foreach ($monitored_items as $item) {
            $item_data = DBfetch(DBselect('select i.itemid,i.history,i.trends,i.status,i.delta,i.valuemapid ' . ' from items i, httptestitem hi ' . ' where hi.httptestid=' . $httptestid . ' and hi.itemid=i.itemid ' . ' and hi.type=' . $item['httptestitemtype']));
            if (!$item_data) {
                $item_data = DBfetch(DBselect('select i.itemid,i.history,i.trends,i.status,i.delta,i.valuemapid ' . ' from items i where i.key_=' . zbx_dbstr($item['key_']) . ' and i.hostid=' . $hostid));
            }
            $item_args = array('description' => $item['description'], 'key_' => $item['key_'], 'hostid' => $hostid, 'delay' => $delay, 'type' => ITEM_TYPE_HTTPTEST, 'snmp_community' => '', 'snmp_oid' => '', 'value_type' => $item['type'], 'data_type' => ITEM_DATA_TYPE_DECIMAL, 'trapper_hosts' => 'localhost', 'snmp_port' => 161, 'units' => $item['units'], 'multiplier' => 0, 'snmpv3_securityname' => '', 'snmpv3_securitylevel' => 0, 'snmpv3_authpassphrase' => '', 'snmpv3_privpassphrase' => '', 'formula' => 0, 'logtimefmt' => '', 'delay_flex' => '', 'authtype' => 0, 'username' => '', 'password' => '', 'publickey' => '', 'privatekey' => '', 'params' => '', 'ipmi_sensor' => '', 'applications' => array($applicationid));
            if (!$item_data) {
                $item_args['history'] = $history;
                $item_args['status'] = ITEM_STATUS_ACTIVE;
                $item_args['delta'] = 0;
                $item_args['trends'] = $trends;
                $item_args['valuemapid'] = 0;
                if (!($itemid = add_item($item_args))) {
                    throw new Exception('Cannot add item');
                }
            } else {
                $itemid = $item_data['itemid'];
                $item_args['history'] = $item_data['history'];
                $item_args['status'] = $item_data['status'];
                $item_args['delta'] = $item_data['delta'];
                $item_args['trends'] = $item_data['trends'];
                $item_args['valuemapid'] = $item_data['valuemapid'];
                if (!update_item($itemid, $item_args)) {
                    throw new Exception('Cannot update item');
//.........这里部分代码省略.........
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:httptest.inc.php

示例5: get


//.........这里部分代码省略.........
                 if (isset($item['triggerid']) && is_null($options['select_triggers'])) {
                     if (!isset($result[$item['itemid']]['triggers'])) {
                         $result[$item['itemid']]['triggers'] = array();
                     }
                     $result[$item['itemid']]['triggers'][] = array('triggerid' => $item['triggerid']);
                     unset($item['triggerid']);
                 }
                 // graphids
                 if (isset($item['graphid']) && is_null($options['select_graphs'])) {
                     if (!isset($result[$item['itemid']]['graphs'])) {
                         $result[$item['itemid']]['graphs'] = array();
                     }
                     $result[$item['itemid']]['graphs'][] = array('graphid' => $item['graphid']);
                     unset($item['graphid']);
                 }
                 // applicationids
                 if (isset($item['applicationid']) && is_null($options['select_applications'])) {
                     if (!isset($result[$item['itemid']]['applications'])) {
                         $result[$item['itemid']]['applications'] = array();
                     }
                     $result[$item['itemid']]['applications'][] = array('applicationid' => $item['applicationid']);
                     unset($item['applicationid']);
                 }
                 $result[$item['itemid']] += $item;
             }
         }
     }
     COpt::memoryPick();
     if (!is_null($options['countOutput'])) {
         if (is_null($options['preservekeys'])) {
             $result = zbx_cleanHashes($result);
         }
         return $result;
     }
     // Adding Objects
     // Adding hosts
     if (!is_null($options['select_hosts'])) {
         if (is_array($options['select_hosts']) || str_in_array($options['select_hosts'], $subselects_allowed_outputs)) {
             $obj_params = array('nodeids' => $nodeids, 'itemids' => $itemids, 'templated_hosts' => 1, 'output' => $options['select_hosts'], 'nopermissions' => 1, 'preservekeys' => 1);
             $hosts = CHost::get($obj_params);
             foreach ($hosts as $hostid => $host) {
                 $hitems = $host['items'];
                 unset($host['items']);
                 foreach ($hitems as $inum => $item) {
                     $result[$item['itemid']]['hosts'][] = $host;
                 }
             }
             $templates = CTemplate::get($obj_params);
             foreach ($templates as $templateid => $template) {
                 $titems = $template['items'];
                 unset($template['items']);
                 foreach ($titems as $inum => $item) {
                     $result[$item['itemid']]['hosts'][] = $template;
                 }
             }
         }
     }
     // Adding triggers
     if (!is_null($options['select_triggers']) && str_in_array($options['select_triggers'], $subselects_allowed_outputs)) {
         $obj_params = array('nodeids' => $nodeids, 'output' => $options['select_triggers'], 'itemids' => $itemids, 'preservekeys' => 1);
         $triggers = CTrigger::get($obj_params);
         foreach ($triggers as $triggerid => $trigger) {
             $titems = $trigger['items'];
             unset($trigger['items']);
             foreach ($titems as $inum => $item) {
                 $result[$item['itemid']]['triggers'][] = $trigger;
             }
         }
     }
     // Adding graphs
     if (!is_null($options['select_graphs']) && str_in_array($options['select_graphs'], $subselects_allowed_outputs)) {
         $obj_params = array('nodeids' => $nodeids, 'output' => $options['select_graphs'], 'itemids' => $itemids, 'preservekeys' => 1);
         $graphs = CGraph::get($obj_params);
         foreach ($graphs as $graphid => $graph) {
             $gitems = $graph['items'];
             unset($graph['items']);
             foreach ($gitems as $inum => $item) {
                 $result[$item['itemid']]['graphs'][] = $graph;
             }
         }
     }
     // Adding applications
     if (!is_null($options['select_applications']) && str_in_array($options['select_applications'], $subselects_allowed_outputs)) {
         $obj_params = array('nodeids' => $nodeids, 'output' => $options['select_applications'], 'itemids' => $itemids, 'preservekeys' => 1);
         $applications = CApplication::get($obj_params);
         foreach ($applications as $applicationid => $application) {
             $aitems = $application['items'];
             unset($application['items']);
             foreach ($aitems as $inum => $item) {
                 $result[$item['itemid']]['applications'][] = $application;
             }
         }
     }
     COpt::memoryPick();
     // removing keys (hash -> array)
     if (is_null($options['preservekeys'])) {
         $result = zbx_cleanHashes($result);
     }
     return $result;
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:class.citem.php

示例6: application

 private static function application($action, $params)
 {
     CApplication::$error = array();
     switch ($action) {
         default:
             $result = call_user_func(array('CApplication', $action), $params);
     }
     self::$result = $result;
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:9,代码来源:class.czbxrpc.php

示例7: actionEditSensor

 public function actionEditSensor()
 {
     $result = array();
     if (isset($_POST['sensor_id'])) {
         $form = new StationSensorEditForm();
         if ($form->loadBySensorId((int) $_POST['sensor_id'])) {
             $result['form'] = $form->draw();
         }
     }
     if (isset($_POST['StationSensorEditForm'])) {
         $form = new StationSensorEditForm();
         $form->attributes = $_POST['StationSensorEditForm'];
         if ($form->validate()) {
             $result = $form->saveSensor();
             if (empty($result)) {
                 $result['form'] = $form->draw();
             }
         } else {
             $result['form'] = $form->draw();
         }
     }
     echo json_encode($result);
     CApplication::end();
 }
开发者ID:anton-itscript,项目名称:WM,代码行数:24,代码来源:AdminController.php

示例8: get


//.........这里部分代码省略.........
     }
     // Adding discovery hosts
     if (!is_null($options['select_dhosts'])) {
         $obj_params = array('nodeids' => $nodeids, 'hostids' => $hostids, 'nopermissions' => 1, 'preservekeys' => 1);
         if (is_array($options['select_dhosts']) || str_in_array($options['select_dhosts'], $subselects_allowed_outputs)) {
             $obj_params['output'] = $options['select_dhosts'];
             $dhosts = CDHost::get($obj_params);
             if (!is_null($options['limitSelects'])) {
                 order_result($dhosts, 'dhostid');
             }
             foreach ($dhosts as $dhostid => $dhost) {
                 unset($dhosts[$dhostid]['hosts']);
                 foreach ($dhost['hosts'] as $hnum => $host) {
                     if (!is_null($options['limitSelects'])) {
                         if (!isset($count[$host['hostid']])) {
                             $count[$host['hostid']] = 0;
                         }
                         $count[$host['hostid']]++;
                         if ($count[$host['hostid']] > $options['limitSelects']) {
                             continue;
                         }
                     }
                     $result[$host['hostid']]['dhosts'][] =& $dhosts[$dhostid];
                 }
             }
         } else {
             if (API_OUTPUT_COUNT == $options['select_dhosts']) {
                 $obj_params['countOutput'] = 1;
                 $obj_params['groupCount'] = 1;
                 $dhosts = CDHost::get($obj_params);
                 $dhosts = zbx_toHash($dhosts, 'hostid');
                 foreach ($result as $hostid => $host) {
                     if (isset($dhosts[$hostid])) {
                         $result[$hostid]['dhosts'] = $dhosts[$hostid]['rowscount'];
                     } else {
                         $result[$hostid]['dhosts'] = 0;
                     }
                 }
             }
         }
     }
     // Adding applications
     if (!is_null($options['select_applications'])) {
         $obj_params = array('nodeids' => $nodeids, 'hostids' => $hostids, 'nopermissions' => 1, 'preservekeys' => 1);
         if (is_array($options['select_applications']) || str_in_array($options['select_applications'], $subselects_allowed_outputs)) {
             $obj_params['output'] = $options['select_applications'];
             $applications = CApplication::get($obj_params);
             if (!is_null($options['limitSelects'])) {
                 order_result($applications, 'name');
             }
             foreach ($applications as $applicationid => $application) {
                 unset($applications[$applicationid]['hosts']);
                 foreach ($application['hosts'] as $hnum => $host) {
                     if (!is_null($options['limitSelects'])) {
                         if (!isset($count[$host['hostid']])) {
                             $count[$host['hostid']] = 0;
                         }
                         $count[$host['hostid']]++;
                         if ($count[$host['hostid']] > $options['limitSelects']) {
                             continue;
                         }
                     }
                     $result[$host['hostid']]['applications'][] =& $applications[$applicationid];
                 }
             }
         } else {
             if (API_OUTPUT_COUNT == $options['select_applications']) {
                 $obj_params['countOutput'] = 1;
                 $obj_params['groupCount'] = 1;
                 $applications = CApplication::get($obj_params);
                 $applications = zbx_toHash($applications, 'hostid');
                 foreach ($result as $hostid => $host) {
                     if (isset($applications[$hostid])) {
                         $result[$hostid]['applications'] = $applications[$hostid]['rowscount'];
                     } else {
                         $result[$hostid]['applications'] = 0;
                     }
                 }
             }
         }
     }
     // Adding macros
     if (!is_null($options['select_macros']) && str_in_array($options['select_macros'], $subselects_allowed_outputs)) {
         $obj_params = array('nodeids' => $nodeids, 'output' => $options['select_macros'], 'hostids' => $hostids, 'preservekeys' => 1);
         $macros = CUserMacro::get($obj_params);
         foreach ($macros as $macroid => $macro) {
             $mhosts = $macro['hosts'];
             unset($macro['hosts']);
             foreach ($mhosts as $num => $host) {
                 $result[$host['hostid']]['macros'][] = $macro;
             }
         }
     }
     Copt::memoryPick();
     // removing keys (hash -> array)
     if (is_null($options['preservekeys'])) {
         $result = zbx_cleanHashes($result);
     }
     return $result;
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:class.chost.php

示例9: actionDeleteScheduleTypeDestination

 public function actionDeleteScheduleTypeDestination()
 {
     $ex_schedule_id = isset($_REQUEST['sid']) ? intval($_REQUEST['sid']) : null;
     $destination_id = isset($_REQUEST['did']) ? intval($_REQUEST['did']) : null;
     $return = array('ok' => 0);
     if ($ex_schedule_id && $destination_id) {
         $res = ScheduleTypeReportDestination::model()->deleteAllByAttributes(array('ex_schedule_id' => $ex_schedule_id, 'ex_schedule_destination_id' => $destination_id));
         if ($res) {
             $return['ok'] = 1;
         }
     }
     print json_encode($return);
     CApplication::end();
 }
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:14,代码来源:AjaxController.php

示例10: init

 /**
  * Initializes the application by creating the command runner.
  */
 protected function init()
 {
     parent::init();
     if (empty($_SERVER['argv'])) {
         die('This script must be run from the command line.');
     }
     $this->_runner = $this->createCommandRunner();
     $this->_runner->commands = $this->commandMap;
     $this->_runner->addCommands($this->getCommandPath());
 }
开发者ID:omonra,项目名称:blog,代码行数:13,代码来源:CConsoleApplication.php

示例11: init

 /**
  * Initializes the application by creating the command runner.
  */
 protected function init()
 {
     parent::init();
     if (!isset($_SERVER['argv'])) {
         // || strncasecmp(php_sapi_name(),'cli',3))
         die('This script must be run from the command line.');
     }
     $this->_runner = $this->createCommandRunner();
     $this->_runner->commands = $this->commandMap;
     $this->_runner->addCommands($this->getCommandPath());
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:14,代码来源:CConsoleApplication.php

示例12: init

 /**
  * Initializes the application.
  * This method overrides the parent implementation by preloading the 'request' component.
  */
 public function init()
 {
     parent::init();
     $this->setBaseUrl(Nbt::app()->request->baseUrl);
 }
开发者ID:erdincay,项目名称:WIIBOX,代码行数:9,代码来源:CWebApplication.php

示例13: registerCoreComponents

 /**
  * Registers the core application components.
  * This method overrides the parent implementation by registering additional core components.
  */
 protected function registerCoreComponents()
 {
     parent::registerCoreComponents();
     $components = array('gearmanWorker' => array('class' => 'EGearmanWorker'), 'gearmanRouter' => array('class' => 'EGearmanRouter'));
     $this->setComponents($components);
 }
开发者ID:cornernote,项目名称:yii-gearman,代码行数:10,代码来源:EGearmanApplication.php

示例14: init

 protected function init()
 {
     parent::init();
 }
开发者ID:RandomCivil,项目名称:tiny-yii,代码行数:4,代码来源:CWebApplication.php

示例15: registerCoreComponents

 /**
  * Registers the core application components.
  * This method overrides the parent implementation by registering additional core components.
  * @see setComponents
  */
 protected function registerCoreComponents()
 {
     parent::registerCoreComponents();
     $components = array('worker' => array('class' => 'WorkerDaemon'));
     $this->setComponents($components);
 }
开发者ID:lidijakralj,项目名称:bober,代码行数:11,代码来源:WorkerApplication.php


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