本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}