當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CATSUtility::changeConfigSetting方法代碼示例

本文整理匯總了PHP中CATSUtility::changeConfigSetting方法的典型用法代碼示例。如果您正苦於以下問題:PHP CATSUtility::changeConfigSetting方法的具體用法?PHP CATSUtility::changeConfigSetting怎麽用?PHP CATSUtility::changeConfigSetting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CATSUtility的用法示例。


在下文中一共展示了CATSUtility::changeConfigSetting方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: printFooter

 /**
  * Prints footer HTML for non-report pages.
  *
  * @return void
  */
 public static function printFooter()
 {
     $build = $_SESSION['CATS']->getCachedBuild();
     $loadTime = $_SESSION['CATS']->getExecutionTime();
     if ($build > 0) {
         $buildString = ' build ' . $build;
     } else {
         $buildString = '';
     }
     /* THE MODIFICATION OF THE COPYRIGHT AND 'Powered by CATS' LINES IS NOT ALLOWED
                BY THE TERMS OF THE CPL FOR CATS OPEN SOURCE EDITION.
     
                  II) The following copyright notice must be retained and clearly legible
                  at the bottom of every rendered HTML document: Copyright (C) 2005 - 2007
                  Cognizo Technologies, Inc. All rights reserved.
     
                  III) The "Powered by CATS" text or logo must be retained and clearly
                  legible on every rendered HTML document. The logo, or the text
                  "CATS", must be a hyperlink to the CATS Project website, currently
                  http://www.catsone.com/.
            */
     echo '<div class="footerBlock">', "\n";
     echo '<p id="footerText">CATS Version ', CATS_VERSION, $buildString, '. <span id="toolbarVersion"></span>Powered by <a href="http://www.catsone.com/"><strong>CATS</strong></a>.</p>', "\n";
     echo '<span id="footerResponse">Server Response Time: ', $loadTime, ' seconds.</span><br />';
     echo '<span id="footerCopyright">', COPYRIGHT_HTML, '</span>', "\n";
     if (!eval(Hooks::get('TEMPLATEUTILITY_SHOWPRIVACYPOLICY'))) {
         return;
     }
     echo '</div>', "\n";
     eval(Hooks::get('TEMPLATE_UTILITY_PRINT_FOOTER'));
     echo '</body>', "\n";
     echo '</html>', "\n";
     if ((!file_exists('modules/asp') || defined('CATS_TEST_MODE') && CATS_TEST_MODE) && LicenseUtility::isProfessional() && !rand(0, 10)) {
         if (!LicenseUtility::validateProfessionalKey(LICENSE_KEY)) {
             CATSUtility::changeConfigSetting('LICENSE_KEY', "''");
         }
     }
 }
開發者ID:rankinp,項目名稱:OpenCATS,代碼行數:43,代碼來源:TemplateUtility.php

示例2: wizard_checkKey

 public function wizard_checkKey()
 {
     $fileError = false;
     if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) {
         echo 'CATS has lost your session!';
         return;
     }
     /* Bail out if the user doesn't have SA permissions. */
     if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
         echo 'You do not have access to set the key.';
         return;
     }
     if (isset($_GET[$id = 'key']) && $_GET[$id] != '') {
         $license = new License();
         $key = strtoupper(trim($_GET[$id]));
         $configWritten = false;
         if ($license->setKey($key) !== false) {
             if ($license->isProfessional()) {
                 if (!CATSUtility::isSOAPEnabled()) {
                     echo "CATS Professional requires the PHP SOAP library which isn't currently installed.\n\n" . "Installation Instructions:\n\n" . "WAMP/Windows Users:\n" . "1) Left click on the wamp icon.\n" . "2) Select \"PHP Settings\" from the drop-down list.\n" . "3) Select \"PHP Extensions\" from the drop-down list.\n" . "4) Check the \"php_soap\" option.\n" . "5) Restart WAMP.\n\n" . "Linux Users:\n" . "Re-install PHP with the --enable-soap configuration option.\n\n" . "Please visit http://www.catsone.com for more support options.";
                     return;
                 } else {
                     if (!LicenseUtility::validateProfessionalKey($key)) {
                         echo "That is not a valid CATS Professional license key. Please visit " . "http://www.catsone.com/professional for more information about CATS Professional.\n\n" . "For a free open-source key, please visit http://www.catsone.com/ and " . "click on \"Downloads\".";
                         return;
                     }
                 }
             }
             if (CATSUtility::changeConfigSetting('LICENSE_KEY', "'" . $key . "'")) {
                 $configWritten = true;
             }
         }
         if ($configWritten) {
             echo 'Ok';
             return;
         }
     }
     // The key hasn't been written. But they may have manually inserted the key into their config.php, check
     if (LicenseUtility::isLicenseValid()) {
         echo 'Ok';
         return;
     }
     if ($fileError) {
         echo 'You entered a valid key, but this wizard is unable to write to your config.php file! You have ' . 'two choices: ' . "\n\n" . '1) Change the file permissions of your config.php file.' . "\n" . 'If you\'re using unix, try:' . "\n" . 'chmod 777 config.php' . "\n\n" . '2) Edit your config.php file manually and enter your valid key near this line: ' . "\n" . 'define(\'LICENSE_KEY\', \'ENTER YOUR KEY HERE\');' . "\n" . 'Once you\'ve done this, refresh your browser.' . "\n\n" . 'For more help, visit our website at http://www.catsone.com for support options.';
     }
     echo 'That is not a valid key. You can register for a free open source license key on our website ' . 'at http://www.catsone.com or a professional key to unlock all of the available features at ' . 'http://www.catsone.com/professional';
 }
開發者ID:rankinp,項目名稱:OpenCATS,代碼行數:47,代碼來源:SettingsUI.php

示例3: MySQLQueryMultiple

     MySQLQueryMultiple($schema, ";\n");
     //Check if we need to update from 0.6.0 to 0.7.0
     $tables = array();
     $result = MySQLQuery(sprintf("SHOW TABLES FROM %s", DATABASE_NAME));
     while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
         $tables[$row[0]] = true;
     }
     if (!isset($tables['history'])) {
         // FIXME: File exists?!
         $schema = file_get_contents('db/upgrade-0.6.x-0.7.0.sql');
         MySQLQueryMultiple($schema);
     }
     echo '<script type="text/javascript">Installpage_populate(\'a=resumeParsing\');</script>';
     break;
 case 'onLoadDemoData':
     CATSUtility::changeConfigSetting('ENABLE_DEMO_MODE', 'true');
     include_once 'lib/FileCompressor.php';
     MySQLConnect();
     $extractor = new ZipFileExtractor('./db/cats_testdata.bak');
     /* Extract the file.  This command also executes all sql commands in the file. */
     /* Normally, we could just do the following lines, but we want a custom extractor
        that ignores the file 'database', and executes all of the catsbackup.sql.xxx
        files rather than extracting them. */
     /* 
         if (!$extractor->open() || !$extractor->extractAll())
         {
             echo($extractor->getErrorMessage());
         }
     */
     if (!$extractor->open()) {
         echo $extractor->getErrorMessage();
開發者ID:PublicityPort,項目名稱:OpenCATS,代碼行數:31,代碼來源:ui.php


注:本文中的CATSUtility::changeConfigSetting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。