Example #1
0
}
// -----------------------------------------------------------------------------
if (defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_USERNAME') && defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_PASSWORD') && defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_WSDL') && false !== DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_USERNAME && false !== DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_PASSWORD && false !== DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_WSDL) {
    $errorMessage = null;
    try {
        $microtime = microtime(true);
        $mailMerge = new MailMerge();
        $mailMerge->setWsdl(DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_WSDL)->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_USERNAME)->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_PASSWORD)->listTemplates();
        $duration = microtime(true) - $microtime;
        unset($mailMerge);
    } catch (Exception $e) {
        $duration = -1;
        $errorMessage = $e->getMessage();
    }
    if (is_null($errorMessage)) {
        $result = TEST_PASS;
    } else {
        $result = TEST_FAIL;
        $failed = true;
    }
    Helper::printLineToc($counter, sprintf('[PREMIUM] Logging into backend service (%01.2fs)', $duration), $result);
    $counter++;
}
// -----------------------------------------------------------------------------
if (true === $failed) {
    $message = 'One or more tests failed. The web server environment, in which this script is running, does not meet the requirements for the Zend Framework LiveDocx component.';
} else {
    $message = 'Congratulations! All tests passed. The server environment, in which this script is running, is suitable for the Zend Framework LiveDocx component.';
}
Helper::printLine(PHP_EOL . $message . PHP_EOL . PHP_EOL);
// -----------------------------------------------------------------------------