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


PHP mail_qa_team函数代码示例

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


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

示例1: shell_exec

            }
            $ldd = shell_exec("ldd {$php} 2>/dev/null");
        }
        $failed_tests_data .= "Autoconf:\n{$autoconf}\n";
        $failed_tests_data .= "Bundled Libtool:\n{$libtool}\n";
        $failed_tests_data .= "System Libtool:\n{$sys_libtool}\n";
        $failed_tests_data .= "Compiler:\n{$compiler}\n";
        $failed_tests_data .= "Bison:\n" . @shell_exec('bison --version 2>/dev/null') . "\n";
        $failed_tests_data .= "Libraries:\n{$ldd}\n";
        $failed_tests_data .= "\n";
        if (isset($user_email)) {
            $failed_tests_data .= "User's E-mail: " . $user_email . "\n\n";
        }
        $failed_tests_data .= $sep . "PHPINFO" . $sep;
        $failed_tests_data .= shell_exec($php . ' -dhtml_errors=0 -i');
        if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) {
            file_put_contents($output_file, $failed_tests_data);
            if (!$just_save_results) {
                echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n";
            }
            echo "Please send " . $output_file . " to " . PHP_QA_EMAIL . " manually, thank you.\n";
        } else {
            fwrite($fp, "\nThank you for helping to make PHP better.\n");
            fclose($fp);
        }
    }
}
if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) {
    exit(1);
}
exit(0);
开发者ID:lyhiving,项目名称:slowphp,代码行数:31,代码来源:run-tests.php

示例2: save_or_mail_results

function save_or_mail_results()
{
    global $sum_results, $just_save_results, $failed_test_summary, $PHP_FAILED_TESTS, $CUR_DIR, $php, $output_file, $compression;
    /* We got failed Tests, offer the user to send an e-mail to QA team, unless NO_INTERACTION is set */
    if (false) {
        $fp = fopen("php://stdin", "r+");
        if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED'] || $sum_results['XFAILED']) {
            echo "\nYou may have found a problem in PHP.";
        }
        echo "\nWe would like to send this report automatically to the\n";
        echo "PHP QA team, to give us a better understanding of how\nthe test cases are doing. If you don't want to send it\n";
        echo "immediately, you can choose \"s\" to save the report to\na file that you can send us later.\n";
        echo "Do you want to send this report now? [Yns]: ";
        flush();
        $user_input = fgets($fp, 10);
        $just_save_results = strtolower($user_input[0]) == 's';
    }
    if ($just_save_results || false) {
        if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
            /*
             * Collect information about the host system for our report
             * Fetch phpinfo() output so that we can see the PHP enviroment
             * Make an archive of all the failed tests
             * Send an email
             */
            if ($just_save_results) {
                $user_input = 's';
            }
            /* Ask the user to provide an email address, so that QA team can contact the user */
            if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) {
                echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): ";
                flush();
                $user_email = trim(fgets($fp, 1024));
                $user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email));
            }
            $failed_tests_data = '';
            $sep = "\n" . str_repeat('=', 80) . "\n";
            $failed_tests_data .= $failed_test_summary . "\n";
            $failed_tests_data .= get_summary(true, false) . "\n";
            if ($sum_results['FAILED']) {
                foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) {
                    $failed_tests_data .= $sep . $test_info['name'] . $test_info['info'];
                    $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output']));
                    $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff']));
                    $failed_tests_data .= $sep . "\n\n";
                }
                $status = "failed";
            } else {
                $status = "success";
            }
            $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
            $failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n";
            $ldd = $autoconf = $sys_libtool = $libtool = $compiler = 'N/A';
            if (substr(PHP_OS, 0, 3) != "WIN") {
                /* If PHP_AUTOCONF is set, use it; otherwise, use 'autoconf'. */
                if (getenv('PHP_AUTOCONF')) {
                    $autoconf = shell_exec(getenv('PHP_AUTOCONF') . ' --version');
                } else {
                    $autoconf = shell_exec('autoconf --version');
                }
                /* Always use the generated libtool - Mac OSX uses 'glibtool' */
                $libtool = shell_exec($CUR_DIR . '/libtool --version');
                /* Use shtool to find out if there is glibtool present (MacOSX) */
                $sys_libtool_path = shell_exec(realpath(dirname(__FILE__)) . '/build/shtool path glibtool libtool');
                if ($sys_libtool_path) {
                    $sys_libtool = shell_exec(str_replace("\n", "", $sys_libtool_path) . ' --version');
                }
                /* Try the most common flags for 'version' */
                $flags = array('-v', '-V', '--version');
                $cc_status = 0;
                foreach ($flags as $flag) {
                    system(getenv('CC') . " {$flag} >/dev/null 2>&1", $cc_status);
                    if ($cc_status == 0) {
                        $compiler = shell_exec(getenv('CC') . " {$flag} 2>&1");
                        break;
                    }
                }
                $ldd = shell_exec("ldd {$php} 2>/dev/null");
            }
            $failed_tests_data .= "Autoconf:\n{$autoconf}\n";
            $failed_tests_data .= "Bundled Libtool:\n{$libtool}\n";
            $failed_tests_data .= "System Libtool:\n{$sys_libtool}\n";
            $failed_tests_data .= "Compiler:\n{$compiler}\n";
            $failed_tests_data .= "Bison:\n" . shell_exec('bison --version 2>/dev/null') . "\n";
            $failed_tests_data .= "Libraries:\n{$ldd}\n";
            $failed_tests_data .= "\n";
            if (isset($user_email)) {
                $failed_tests_data .= "User's E-mail: " . $user_email . "\n\n";
            }
            $failed_tests_data .= $sep . "PHPINFO" . $sep;
            $failed_tests_data .= shell_exec($php . ' -ddisplay_errors=stderr -dhtml_errors=0 -i 2> /dev/null');
            if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) {
                file_put_contents($output_file, $failed_tests_data);
                if (!$just_save_results) {
                    echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n";
                }
                echo "Please send " . $output_file . " to " . PHP_QA_EMAIL . " manually, thank you.\n";
            } else {
                fwrite($fp, "\nThank you for helping to make PHP better.\n");
                fclose($fp);
//.........这里部分代码省略.........
开发者ID:wgy0323,项目名称:ffmpeg-php,代码行数:101,代码来源:run-tests.php

示例3: save_or_mail_results

function save_or_mail_results()
{
    global $sum_results, $just_save_results, $failed_test_summary, $PHP_FAILED_TESTS, $CUR_DIR, $php, $output_file, $compression;
    if ($just_save_results || !getenv('NO_INTERACTION')) {
        if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
            /*
             * Collect information about the host system for our report
             * Fetch phpinfo() output so that we can see the PHP enviroment
             * Make an archive of all the failed tests
             * Send an email
             */
            if ($just_save_results) {
                $user_input = 's';
            }
            /* Ask the user to provide an email address, so that QA team can contact the user */
            if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) {
                echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): ";
                flush();
                $user_email = trim(fgets($fp, 1024));
                $user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email));
            }
            $failed_tests_data = '';
            $sep = "\n" . str_repeat('=', 80) . "\n";
            $failed_tests_data .= $failed_test_summary . "\n";
            $failed_tests_data .= get_summary(true, false) . "\n";
            if ($sum_results['FAILED']) {
                foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) {
                    $failed_tests_data .= $sep . $test_info['name'] . $test_info['info'];
                    $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output']), FILE_BINARY);
                    $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff']), FILE_BINARY);
                    $failed_tests_data .= $sep . "\n\n";
                }
                $status = "failed";
            } else {
                $status = "success";
            }
            $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
            $failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n";
            $failed_tests_data .= "\n";
            $failed_tests_data .= $sep . "PHPINFO" . $sep;
            $failed_tests_data .= shell_exec($php . ' -ddisplay_errors=stderr -dhtml_errors=0 -i 2> /dev/null');
            if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) {
                file_put_contents($output_file, $failed_tests_data);
                if (!$just_save_results) {
                    echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n";
                }
                echo "Please send " . $output_file . " to " . PHP_QA_EMAIL . " manually, thank you.\n";
            } else {
                fwrite($fp, "\nThank you for helping to make PHP better.\n");
                fclose($fp);
            }
        }
    }
}
开发者ID:juhyunkwon,项目名称:php-handlersocket,代码行数:54,代码来源:run-tests.php


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