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


PHP displayExeption函数代码示例

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


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

示例1: dirname

 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
try {
    require_once dirname(__FILE__) . '/../../core/php/core.inc.php';
    include_file('core', 'authentification', 'php');
    if (!isConnect('admin')) {
        throw new Exception(__('401 - Accès non autorisé', __FILE__), -1234);
    }
    if (init('action') == 'remove') {
        $connection = connection::byId(init('id'));
        if (!is_object($connection)) {
            throw new Exception(__('Connexion inconnue. Vérifiez l\'id', __FILE__));
        }
        $connection->remove();
        ajax::success();
    }
    if (init('action') == 'ban') {
        $connection = connection::byId(init('id'));
        if (!is_object($connection)) {
            throw new Exception(__('Connexion inconnue. Vérifiez l\'id', __FILE__));
        }
        $connection->setStatus('Ban');
        $connection->save();
        ajax::success();
    }
    throw new Exception(__('Aucune méthode correspondante à : ', __FILE__) . init('action'));
    /*     * *********Catch exeption*************** */
} catch (Exception $e) {
    ajax::error(displayExeption($e), $e->getCode());
}
开发者ID:GaelGRIFFON,项目名称:core,代码行数:31,代码来源:connection.ajax.php

示例2: syncEqLogicWithTeslaSite

 public static function syncEqLogicWithTeslaSite($_logical_id = null)
 {
     $message = '';
     try {
         $list = self::listAllVehicles();
         $num = $list->{'count'};
     } catch (Exception $e) {
         $num = -1;
         $message = displayExeption($e);
         log::add('tesla', 'error', $e);
     }
     if ($num <= 0) {
         if ($message == '') {
             $message = "Aucun vehicule identifie via l'API Tesla";
         }
         nodejs::pushUpdate('jeedom::alert', array('level' => 'warning', 'message' => __($message, __FILE__)));
         return;
     }
     foreach ($list->{'response'} as $car) {
         $eqLogic = self::byLogicalId($car->{'vehicle_id'}, 'tesla');
         if (!is_object($eqLogic)) {
             $eqLogic = new eqLogic();
             $eqLogic->setEqType_name('tesla');
             $eqLogic->setIsEnable(1);
             $eqLogic->setLogicalId($car->{'vehicle_id'});
             $eqLogic->setName($car->{'display_name'});
             $eqLogic->setConfiguration('options_codes', $car->{'options_codes'});
             $eqLogic->setConfiguration('vin', $car->{'vin'});
             $eqLogic->setConfiguration('state', $car->{'state'});
             $eqLogic->setConfiguration('id', $car->{'id'});
             $eqLogic->setIsVisible(1);
             $eqLogic->save();
             //$eqLogic = tesla::byId($eqLogic->getId());
             //$include_device = $eqLogic->getId();
             //$eqLogic->createCommand(false, $result);
             log::add('tesla', 'error', ' Voiture ajoutee, VIN: ' . $car->{'vin'});
             nodejs::pushUpdate('jeedom::alert', array('level' => 'info', 'message' => 'Nouvelle voiture ajoutee'));
         } else {
             // update data here
             $eqLogic->setName($car->{'display_name'});
             $eqLogic->setConfiguration('options_codes', $car->{'options_codes'});
             $eqLogic->setConfiguration('vin', $car->{'vin'});
             $eqLogic->setConfiguration('state', $car->{'state'});
             log::add('tesla', 'error', 'Voiture mise a jour, VIN: ' . $car->{'vin'});
             $eqLogic->save();
         }
     }
     return;
 }
开发者ID:kaneda-fr,项目名称:jeedom_tesla,代码行数:49,代码来源:tesla.class.php

示例3: include_file

     if (isset($_GET['ajax']) && $_GET['ajax'] == 1) {
         include_file('core', 'authentification', 'php');
         try {
             if (!isConnect()) {
                 throw new Exception('{{401 - Accès non autorisé}}');
             }
             include_file('desktop', init('p'), 'php', init('m'));
         } catch (Exception $e) {
             $_folder = 'desktop/php';
             if (init('m') != '') {
                 $_folder = 'plugins/' . init('m') . '/' . $_folder;
             }
             ob_end_clean();
             //Clean pile after expetion (to prevent no-traduction)
             echo '<div class="alert alert-danger div_alert">';
             echo translate::exec(displayExeption($e), $_folder . '/' . init('modal') . '.php');
             echo '</div>';
         }
         die;
     } else {
         include_file('desktop', 'index', 'php');
         die;
     }
 } else {
     if ($_GET['v'] == "m") {
         if (isset($_GET['modal'])) {
             include_file('mobile', init('modal'), 'modal', init('plugin'));
         } else {
             if (isset($_GET['p']) && isset($_GET['ajax'])) {
                 if (isset($_GET['m'])) {
                     include_file('mobile', $_GET['p'], 'html', $_GET['m']);
开发者ID:GaelGRIFFON,项目名称:core,代码行数:31,代码来源:index.php

示例4: include_file

							</header>
							<main class="container-fluid" id="div_mainContainer">
								<div style="display: none;width : 100%" id="div_alert"></div>

								<div id="div_pageContainer">
									<?php 
    try {
        if (isset($plugin) && is_object($plugin)) {
            include_file('desktop', $page, 'php', $plugin->getId());
        } else {
            include_file('desktop', $page, 'php');
        }
    } catch (Exception $e) {
        ob_end_clean();
        echo '<div class="alert alert-danger div_alert">';
        echo displayExeption($e);
        echo '</div>';
    }
    ?>
								</div>
								<div id="md_modal"></div>
								<div id="md_modal2"></div>
								<div id="md_pageHelp" style="display: none;" title="Aide">
									<ul class="nav nav-tabs">
										<li class="active"><a href="#div_helpWebsite" data-toggle="tab">{{Générale}}</a></li>
										<li><a href="#div_helpSpe" data-toggle="tab">{{Détaillée}}</a></li>
									</ul>
									<div class="tab-content">
										<div class="tab-pane active" id="div_helpWebsite" ></div>
										<div class="tab-pane" id="div_helpSpe" ></div>
									</div>
开发者ID:GaelGRIFFON,项目名称:core,代码行数:31,代码来源:index.php

示例5: include_file

if (!isConnect()) {
    include_file('desktop', '404', 'php');
    die;
}
try {
    $host = config::byKey('influxdbHost', 'influxdb', 0);
    $port = config::byKey('influxdbPort', 'influxdb', 0);
    $dbName = config::byKey('influxdbDatabase', 'influxdb', 0);
    log::add('influxdb', 'debug', "Connexion à InfluxDB: host={$host}, port={$port}, base={$dbName}");
    $client = new InfluxDB\Client($host, $port);
    $database = $client->selectDB($dbName);
    if (!$database->exists()) {
        log::add('influxdb', 'error', "La base de données InfluxDB '{$dbName}' n'existe pas");
    }
} catch (Exception $e) {
    log::add('influxdb', 'error', displayExeption($e));
}
?>
<form class="form-horizontal">
    <fieldset>
        <div class="form-group">
            <label class="col-lg-4 control-label">{{Adresse du serveur}}</label>
            <div class="col-lg-2">
                <input class="configKey form-control" data-l1key="influxdbHost" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-4 control-label">{{Port du serveur}}</label>
            <div class="col-lg-2">
                <input class="configKey form-control" data-l1key="influxdbPort" placeholder="8086" />
            </div>
开发者ID:jeje,项目名称:jeedom-influxdb-plugin,代码行数:31,代码来源:configuration.php


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