Sfoglia il codice sorgente

Removed demo username and password from LiveDocx demos

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20558 44c647ce-9c0f-0410-b52a-842ac1e357ba
jonathan_maron 16 anni fa
parent
commit
8f9a90525c
24 ha cambiato i file con 162 aggiunte e 70 eliminazioni
  1. 62 17
      demos/Zend/Service/LiveDocx/Helper.php
  2. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/bitmaps/generate-bitmaps.php
  3. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/constructors/credentials.ini
  4. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/constructors/hosted-licensed.php
  5. 4 4
      demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php
  6. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document-concat.php
  7. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document.php
  8. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/metafiles/generate-metafiles.php
  9. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/pdf-security/generate-document.php
  10. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts-cached.php
  11. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts.php
  12. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php
  13. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php
  14. 4 4
      demos/Zend/Service/LiveDocx/MailMerge/telephone-bill/generate-document.php
  15. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/template-info/list-template-info.php
  16. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/templates/delete-all.php
  17. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/templates/download.php
  18. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/templates/list.php
  19. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/templates/template-exists.php
  20. 2 2
      demos/Zend/Service/LiveDocx/MailMerge/templates/upload.php
  21. 0 6
      demos/Zend/Service/LiveDocx/README
  22. 4 4
      demos/Zend/Service/LiveDocx/check-environment.php
  23. 9 1
      demos/Zend/Service/LiveDocx/common.php
  24. 45 0
      demos/Zend/Service/LiveDocx/configuration.php.dist

+ 62 - 17
demos/Zend/Service/LiveDocx/Helper.php

@@ -34,34 +34,79 @@ require_once 'Zend/Date.php';
 class Demos_Zend_Service_LiveDocx_Helper
 {
     /**
-     * LiveDocx demonstration username
-     * 
-     * IMPORTANT: These login credentials may be used for demonstration purposes only.
-     *            Getting your own username and password takes less than 1 minute.
-     *            Goto http://is.gd/5dK5A to sign up.
+     * Name of configuration file stored in /demos/Zend/Service/LiveDocx/
      */
-    const USERNAME = 'zfdemos';
-    
-    /**
-     * LiveDocx demonstration password
-     *
-     * IMPORTANT: These login credentials may be used for demonstration purposes only.
-     *            Getting your own username and password takes less than 1 minute.
-     *            Goto http://is.gd/5dK5A to sign up.
-     */    
-    const PASSWORD = 'fkj3487o4zf35';
-    
+    const CONFIGURATION_FILE = 'configuration.php';
+        
     /**
      * Line length in characters (used to wrap long lines)
      */
     const LINE_LENGTH = 80;
     
     /**
-     * Default Locale
+     * Default locale
      */
     const LOCALE = 'en_US';
     
     /**
+     * Return true, if configuration file exists and constants
+     * DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME and
+     * DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD have been set.
+     *  
+     * @return boolean
+     */
+    public static function credentialsAvailable()
+    {
+        $ret = false;
+        
+        $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . self::CONFIGURATION_FILE;
+        if (is_file($filename) && is_readable($filename)) {
+            include_once $filename;
+            if (defined('DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME') &&
+                defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD') &&
+                false !== DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME  &&
+                false !== DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD ) {
+                    $ret = true;
+                }
+        }
+        
+        return $ret;
+    } 
+    
+    /**
+     * Return instructions on how to register to use LiveDocx service and enter
+     * username and password into configuration file.
+     * 
+     * @return string
+     */
+    public static function credentialsHowTo()
+    {
+        $ret  = PHP_EOL;
+        $ret .= sprintf('ERROR: LIVEDOCX USERNAME AND PASSWORD HAVE NOT BEEN SET.%s', PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('1. Using a web browser, register to use the LiveDocx service at:%s', PHP_EOL);
+        $ret .= sprintf('   https://www.livedocx.com/user/account_registration.aspx%s', PHP_EOL);
+        $ret .= sprintf('   (takes less than 1 minute).%s', PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('2. Change directory into:%s', PHP_EOL);
+        $ret .= sprintf('   %s%s', dirname(__FILE__), PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('3. Copy %s.dist to %s.%s', self::CONFIGURATION_FILE, self::CONFIGURATION_FILE, PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('4. Open %s in a text editor and enter the username and password%s', self::CONFIGURATION_FILE, PHP_EOL);
+        $ret .= sprintf('   you obtained in step 1 (lines 43 and 44).%s', PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('5. Save and close configuration.php.%s', PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('Congratulations!%s', PHP_EOL);
+        $ret .= PHP_EOL;
+        $ret .= sprintf('You have now set up the Zend_Service_LiveDocx demo applications.%s', PHP_EOL);
+        $ret .= PHP_EOL;
+        
+        return $ret;
+    }
+    
+    /**
      * Decorator to format return value of list methods
      *
      * @param array $result

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/bitmaps/generate-bitmaps.php

@@ -6,8 +6,8 @@ require_once dirname(__FILE__) . '/../../common.php';
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->setLocalTemplate('template.docx');
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/constructors/credentials.ini

@@ -1,2 +1,2 @@
-username = zfdemos
-password = fkj3487o4zf35
+username = myUsername
+password = myPassword

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/constructors/hosted-licensed.php

@@ -17,8 +17,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
 $phpLiveDocx->setWsdl('https://api.example.com/1.2/mailmerge.asmx?WSDL')
-            ->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+            ->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->getTemplateFormats(); // then call methods as usual
 

+ 4 - 4
demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php

@@ -16,8 +16,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->getTemplateFormats(); // then call methods as usual
 
@@ -39,8 +39,8 @@ unset($phpLiveDocx);
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
     array (
-        'username' => Demos_Zend_Service_LiveDocx_Helper::USERNAME,
-        'password' => Demos_Zend_Service_LiveDocx_Helper::PASSWORD,
+        'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
+        'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD,
     )
 );
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document-concat.php

@@ -92,8 +92,8 @@ $tempFilenames = array();
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->setLocalTemplate('template.docx');
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/license-agreement/generate-document.php

@@ -6,8 +6,8 @@ require_once dirname(__FILE__) . '/../../common.php';
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->setLocalTemplate('template.docx');
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/metafiles/generate-metafiles.php

@@ -6,8 +6,8 @@ require_once dirname(__FILE__) . '/../../common.php';
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->setLocalTemplate('template.docx');
             

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/pdf-security/generate-document.php

@@ -8,8 +8,8 @@ $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 // Set WSDL of your premium service server
 $phpLiveDocx->setWsdl('https://api.example.com/1.2/mailmerge.asmx?WSDL');
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $phpLiveDocx->setLocalTemplate('template.docx');
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts-cached.php

@@ -25,8 +25,8 @@ if (! $fonts = $cache->load($cacheId)) {
     
     $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
     
-    $phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-                ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+    $phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+                ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
     
     $fonts = $phpLiveDocx->getFontNames();
     

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/supported-fonts/show-supported-fonts.php

@@ -6,8 +6,8 @@ require_once dirname(__FILE__) . '/../../common.php';
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 system('clear');
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php

@@ -35,8 +35,8 @@ if (! $formats = $cache->load($cacheId)) {
     
     $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
     
-    $phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-                ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+    $phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+                ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
     
     $formats = new StdClass();
     

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php

@@ -16,8 +16,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 printf("Supported TEMPLATE file formats (input)  : %s%s",
     Demos_Zend_Service_LiveDocx_Helper::arrayDecorator($phpLiveDocx->getTemplateFormats()), PHP_EOL);

+ 4 - 4
demos/Zend/Service/LiveDocx/MailMerge/telephone-bill/generate-document.php

@@ -6,8 +6,8 @@ require_once dirname(__FILE__) . '/../../common.php';
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 /*
  * ALTERNATIVE: Specify username and password in constructor
@@ -16,8 +16,8 @@ $phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
 /*
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
     array (
-        'username' => Demos_Zend_Service_LiveDocx_Helper::USERNAME,
-        'password' => Demos_Zend_Service_LiveDocx_Helper::PASSWORD
+        'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
+        'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD
     )
 );
 */

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/template-info/list-template-info.php

@@ -16,8 +16,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 // -----------------------------------------------------------------------------
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/templates/delete-all.php

@@ -14,8 +14,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $counter = 1;
 foreach ($phpLiveDocx->listTemplates() as $result) {

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/templates/download.php

@@ -14,8 +14,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 $counter = 1;
 foreach ($phpLiveDocx->listTemplates() as $result) {

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/templates/list.php

@@ -16,8 +16,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 print(Demos_Zend_Service_LiveDocx_Helper::listDecorator($phpLiveDocx->listTemplates()));
 

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/templates/template-exists.php

@@ -14,8 +14,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 print('Checking whether a template is available... ');
 if (true === $phpLiveDocx->templateExists('template-1.docx')) {

+ 2 - 2
demos/Zend/Service/LiveDocx/MailMerge/templates/upload.php

@@ -14,8 +14,8 @@ print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
 
 $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
-$phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
-            ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
+$phpLiveDocx->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
+            ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
 
 print('Uploading template... ');
 $phpLiveDocx->uploadTemplate('template-1.docx');

+ 0 - 6
demos/Zend/Service/LiveDocx/README

@@ -1,6 +0,0 @@
-Zend_Service_LiveDocx Demonstration Applications
-------------------------------------------------
-
-Before these demonstration applications can be used, you may need set the path
-to your locally installed Zend Framework Standard Trunk in lines 7 and 8 of
-"common.php". By default, this is set up automatically.

+ 4 - 4
demos/Zend/Service/LiveDocx/check-environment.php

@@ -203,8 +203,8 @@ $counter ++;
 
 // -----------------------------------------------------------------------------
 
-if (defined('Demos_Zend_Service_LiveDocx_Helper::USERNAME') &&
-    defined('Demos_Zend_Service_LiveDocx_Helper::PASSWORD')) {
+if (defined('DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME') &&
+    defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD')) {
     $result = TEST_PASS;
 } else {
     $result = TEST_FAIL;
@@ -223,8 +223,8 @@ try {
     $microtime = microtime(true);
     $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
         array (
-            'username' => Demos_Zend_Service_LiveDocx_Helper::USERNAME,
-            'password' => Demos_Zend_Service_LiveDocx_Helper::PASSWORD
+            'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
+            'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD
         )
     );
     $duration = microtime(true) - $microtime;

+ 9 - 1
demos/Zend/Service/LiveDocx/common.php

@@ -16,4 +16,12 @@ $autoloader = Zend_Loader_Autoloader::getInstance();
 // Set default locale
 Zend_Locale::setDefault(Demos_Zend_Service_LiveDocx_Helper::LOCALE);
 $locale = new Zend_Locale(Zend_Locale::ZFDEFAULT);
-Zend_Registry::set('Zend_Locale', $locale);
+Zend_Registry::set('Zend_Locale', $locale);
+
+// Ensure LiveDocx credentials are available
+if (false === Demos_Zend_Service_LiveDocx_Helper::credentialsAvailable()) {
+    echo Demos_Zend_Service_LiveDocx_Helper::wrapLine(
+            Demos_Zend_Service_LiveDocx_Helper::credentialsHowTo()
+    );
+    exit();
+}

+ 45 - 0
demos/Zend/Service/LiveDocx/configuration.php.dist

@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Service
+ * @subpackage LiveDocx
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
+ */
+
+/**
+ * This file defines configuration for running the Zend_Service_LiveDocx demo
+ * applications.
+ *
+ * Do not edit this file. Instead, copy this file to configuration.php,
+ * and edit the new file. Never commit plaintext passwords to the source
+ * code repository.
+ */
+
+/**
+ * Zend_Service_LiveDocx configuration
+ *
+ * Define username and password in order to access LiveDocx web services.
+ * 
+ * Get a username and password here:
+ * 
+ * https://www.livedocx.com/user/account_registration.aspx
+ *
+ */
+define('DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME', false);
+define('DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD', false);
+