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


PHP Utilities::print_error_message方法代码示例

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


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

示例1: get_expsearch_results

/**
 * Get results of the user's search of experiments
 * @return array|null
 */
public static function get_expsearch_results( $inputs)
{
    $experiments = array();

    try
    {
        switch ( $inputs["search-key"])
        {
            case 'experiment-name':
                $experiments = Airavata::searchExperimentsByName(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
                break;
            case 'experiment-description':
                $experiments = Airavata::searchExperimentsByDesc(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
                break;
            case 'application':
                $experiments = Airavata::searchExperimentsByApplication(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
                break;
            case 'creation-time':
                $experiments = Airavata::searchExperimentsByCreationTime(Session::get('gateway_id'), Session::get('username'), strtotime( $inputs["from-date"])*1000, strtotime( $inputs["to-date"])*1000 );
                break;
            case '':
        }
    }
    catch (InvalidRequestException $ire)
    {
        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
    }
    catch (AiravataClientException $ace)
    {
        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
    }
    catch (AiravataSystemException $ase)
    {
        if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
        {
            Utilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
                                <a href="create_project.php">here</a> to create a new project.</p>');
        }
        else
        {
            Utilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
            //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
        }
    }
    catch (TTransportException $tte)
    {
        Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
    }

    //get values of all experiments
    $expContainer = array();
    $expNum = 0;
    foreach( $experiments as $experiment)
    {
        $expValue = Utilities::get_experiment_values( $experiment, Utilities::get_project($experiment->projectID), true );
        $expContainer[$expNum]['experiment'] = $experiment;
        if( $expValue["experimentStatusString"] == "FAILED")
            $expValue["editable"] = false;
        $expContainer[$expNum]['expValue'] = $expValue;
        $expNum++;
    }

    return $expContainer;
}
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:69,代码来源:ExpUtilities.php

示例2: catch

            if( Session::has("admin"))
                $admin = " Admin";
            else
                $admin = "";

            echo '<h4>Welcome'. $admin . ', '. Session::get("username") . '!</h4>';

            if( Session::get("username") == 'admin1') // temporary hard-coded admin user. will replace with admin role in future
            {
                try
                {
                    Utilities::open_tokens_file($tokenFilePath);
                }
                catch (Exception $e)
                {
                    Utilities::print_error_message($e->getMessage());
                }


                if(isset($_GET['tokenId']))
                {
                    try
                    {
                        Utilities::write_new_token($_GET['tokenId']);

                        Utilties::print_success_message('Received new XSEDE token ' . $tokenFile->tokenId .
                            '! Click <a href="' . $req_url .
                            '?gatewayName=' . $gatewayName .
                            '&email=' . $email .
                            '&portalUserName=' . $_SESSION['username'] .
                            '">here</a> to fetch a new token.');
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:31,代码来源:home.blade.php

示例3: get_all_user_experiments_with_pagination

    /**
     * Get results of the user's all experiments with pagination.
     * Results are ordered creation time DESC
     * @return array|null
     */
    public static function get_all_user_experiments_with_pagination($limit, $offset)
    {
        $experiments = array();

        try
        {
            $experiments = Airavata::getAllUserExperimentsWithPagination(
                Session::get('gateway_id'), Session::get('username'), $limit, $offset
            );
        }
        catch (InvalidRequestException $ire)
        {
            Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
        }
        catch (AiravataClientException $ace)
        {
            Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
        }
        catch (AiravataSystemException $ase)
        {
            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
            {
                Utilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
                                <a href="create_project.php">here</a> to create a new project.</p>');
            }
            else
            {
                Utilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
            }
        }
        catch (TTransportException $tte)
        {
            Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
        }

        //get values of all experiments
        $expContainer = array();
        $expNum = 0;
        foreach( $experiments as $experiment)
        {
            $expValue = Utilities::get_experiment_values( $experiment, Utilities::get_project($experiment->projectID), true );
            $expContainer[$expNum]['experiment'] = $experiment;
            if( $expValue["experimentStatusString"] == "FAILED")
                $expValue["editable"] = false;
            $expContainer[$expNum]['expValue'] = $expValue;
            $expNum++;
        }

        return $expContainer;
    }
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:57,代码来源:Utilities.php

示例4:

<body>

<?php Utilities::create_nav_bar(); ?>

<?php
    // Alerts if guests users try to go to the link without signing in.
    if( Session::has("login-alert"))
    {
        Utilities::print_error_message("You need to login to use this service.");
        Session::forget("login-alert");
    } 
    // if signed in user is not an admin.           
    if( Session::has("admin-alert"))
    {
        Utilities::print_error_message("You need to be an admin to use this service.");
        Session::forget("admin-alert");
    }
?>

@show

@yield('content')

</body>
@section('scripts')
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

    <!-- Jira Issue Collector - Report Issue -->
    <script type="text/javascript"
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:30,代码来源:basic.blade.php


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