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


PHP Utility::diagnosticLine方法代碼示例

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


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

示例1: diagnostics

 /**
  * Gets diagnostic information for debugging.
  *
  * @return array
  */
 public function diagnostics()
 {
     $utilityObj = new Utility();
     $diagnostics = array();
     $aclCheck = $this->fs->get_bucket_acl($this->bucket);
     if ((int) $aclCheck->status == 200) {
         $storageSize = $this->fs->get_bucket_filesize($this->bucket, true);
         $diagnostics[] = $utilityObj->diagnosticLine(true, sprintf('Connection to bucket "%s" is okay.', $this->bucket));
         $diagnostics[] = $utilityObj->diagnosticLine(true, sprintf('Total space used in bucket "%s" is %s.', $this->bucket, $storageSize));
     } else {
         $diagnostics[] = $utilityObj->diagnosticLine(false, sprintf('Connection to bucket "%s" is NOT okay.', $this->bucket));
     }
     return $diagnostics;
 }
開發者ID:nicolargo,項目名稱:frontend,代碼行數:19,代碼來源:FileSystemS3.php

示例2: diagnostics

 public function diagnostics()
 {
     $diagnostics = array();
     $utilityObj = new Utility();
     try {
         $queryDropboxFolder = $this->dropbox->getMetaData($this->dropboxFolder);
         if (isset($queryDropboxFolder['is_deleted']) && $queryDropboxFolder['is_deleted'] == 1) {
             $diagnostics[] = $utilityObj->diagnosticLine(false, 'The specified Dropbox directory has been deleted.');
         } else {
             $diagnostics[] = $utilityObj->diagnosticLine(true, 'The Dropbox directory exists and looks okay.');
         }
     } catch (Dropbox_Exception_NotFound $e) {
         $diagnostics[] = $utilityObj->diagnosticLine(false, 'Could not get meta data for your Dropbox Directory.');
     } catch (Dropbox_Exception $e) {
         $diagnostics[] = $utilityObj->diagnosticLine(false, 'An unknown error occured when trying to connect to Dropbox.');
     }
     return $diagnostics;
 }
開發者ID:gg1977,項目名稱:frontend,代碼行數:18,代碼來源:FileSystemDropboxBase.php

示例3: diagnostics

 /**
  * Gets diagnostic information for debugging.
  *
  * @return array
  */
 public function diagnostics()
 {
     $utilityObj = new Utility();
     $diagnostics = array();
     if (is_writable($this->root)) {
         $diagnostics[] = $utilityObj->diagnosticLine(true, 'File system is writable.');
     } else {
         $diagnostics[] = $utilityObj->diagnosticLine(false, 'File system is NOT writable.');
     }
     $ch = curl_init(sprintf('%s://%s/', trim($utilityObj->getProtocol(false)), $this->host));
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     $result = curl_exec($ch);
     $resultCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     if ($resultCode == '403') {
         $diagnostics[] = $utilityObj->diagnosticLine(true, 'Photo path correctly returns 403.');
     } else {
         $diagnostics[] = $utilityObj->diagnosticLine(false, sprintf('Photo path returns %d instead of 403.', $resultCode));
     }
     return $diagnostics;
 }
開發者ID:nicolargo,項目名稱:frontend,代碼行數:25,代碼來源:FileSystemLocal.php

示例4: diagnostics

 public function diagnostics()
 {
     $diagnostics = array();
     $utilityObj = new Utility();
     try {
         $queryBoxAccount = $this->box->get('get_account_info');
         if ($queryBoxAccount['status'] === self::statusGetAccountInfoOk) {
             $queryBoxFolder = $this->box->folder($this->boxFolderId);
             $diagnostics[] = $utilityObj->diagnosticLine(true, 'The Box was connected to successfully.');
             $diagnostics[] = $utilityObj->diagnosticLine(true, sprintf('Total space available: %s.', $queryBoxAccount['user']['space_amount']));
             $diagnostics[] = $utilityObj->diagnosticLine(true, sprintf('Total space used: %s.', $queryBoxAccount['user']['space_used']));
             if ($queryBoxFolder->attr('id') !== null) {
                 $diagnostics[] = $utilityObj->diagnosticLine(true, 'The default folder for uploads is okay.');
             } else {
                 $diagnostics[] = $utilityObj->diagnosticLine(false, 'The default folder for uploads encountered a problem. Uploads may not work.');
             }
         } else {
             $diagnostics[] = $utilityObj->diagnosticLine(false, 'Could not connect to the box account.');
         }
     } catch (Box_Rest_Client_Exception $e) {
         $diagnostics[] = $utilityObj->diagnosticLine(false, 'An unexpected error occurred when accessing your Box account.');
     }
     return $diagnostics;
 }
開發者ID:gg1977,項目名稱:frontend,代碼行數:24,代碼來源:FileSystemBoxBase.php

示例5: diagnostics

 /**
  * Gets diagnostic information for debugging.
  *
  * @return array
  */
 public function diagnostics()
 {
     $utilityObj = new Utility();
     $diagnostics = array();
     $res = $this->db->execute("SELECT * FROM `{$this->mySqlTablePrefix}photo` WHERE owner=:owner LIMIT 1", array(':owner' => $this->owner));
     if ($res == 1) {
         $diagnostics[] = $utilityObj->diagnosticLine(true, 'Database connectivity is okay.');
     } else {
         $diagnostics[] = $utilityObj->diagnosticLine(false, 'Could not properly connect to the database.');
     }
     return $diagnostics;
 }
開發者ID:jjdelc,項目名稱:frontend,代碼行數:17,代碼來源:DatabaseMySql.php

示例6: diagnostics

 /**
  * Gets diagnostic information for debugging.
  *
  * @return array
  */
 public function diagnostics()
 {
     $diagnostics = array();
     $utilityObj = new Utility();
     $domains = array('', 'Action', 'Credential', 'Group', 'User', 'Tag', 'Webhook');
     $queue = $this->getBatchRequest();
     foreach ($domains as $domain) {
         $this->db->batch($queue)->domain_metadata("{$this->domainPhoto}{$domain}");
     }
     $responses = $this->db->batch($queue)->send();
     if ($responses->areOK()) {
         $diagnostics[] = $utilityObj->diagnosticLine(true, 'All SimpleDb domains are accessible.');
     } else {
         foreach ($responses as $key => $res) {
             if ((int) $res->status !== 200) {
                 $diagnostics[] = $utilityObj->diagnosticLine(false, sprintf('The SimpleDb domains "%s" is NOT accessible.', $domains[$key]));
             }
         }
     }
     return $diagnostics;
 }
開發者ID:nicolargo,項目名稱:frontend,代碼行數:26,代碼來源:DatabaseSimpleDb.php


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