当前位置: 首页>>代码示例>>PHP>>正文


PHP Filesystem::realpath方法代码示例

本文整理汇总了PHP中Piwik\Filesystem::realpath方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::realpath方法的具体用法?PHP Filesystem::realpath怎么用?PHP Filesystem::realpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Filesystem的用法示例。


在下文中一共展示了Filesystem::realpath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute()
 {
     $label = $this->translator->translate('CustomPiwikJs_DiagnosticPiwikJsWritable');
     $file = new File(PIWIK_DOCUMENT_ROOT . '/piwik.js');
     if ($file->hasWriteAccess()) {
         return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_OK, ''));
     }
     $comment = $this->translator->translate('CustomPiwikJs_DiagnosticPiwikJsNotWritable');
     if (!SettingsServer::isWindows()) {
         $realpath = Filesystem::realpath(PIWIK_INCLUDE_PATH . '/piwik.js');
         $command = "<br/><code> chmod +w {$realpath}<br/> chown " . Filechecks::getUserAndGroup() . " " . $realpath . "</code><br />";
         $comment .= $this->translator->translate('CustomPiwikJs_DiagnosticPiwikJsMakeWritable', $command);
     }
     return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_WARNING, $comment));
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:15,代码来源:PiwikJsCheck.php

示例2: getAutoUpdateMakeWritableMessage

 /**
  * Returns the help message when the auto update can't run because of missing permissions
  *
  * @return string
  */
 public static function getAutoUpdateMakeWritableMessage()
 {
     $realpath = Filesystem::realpath(PIWIK_INCLUDE_PATH . '/');
     $message = '';
     $message .= "<code>chown -R " . self::getUserAndGroup() . " " . $realpath . "</code><br />";
     $message .= "<code>chmod -R 0755 " . $realpath . "</code><br />";
     $message .= 'After you execute these commands (or change permissions via your FTP software), refresh the page and you should be able to use the "Automatic Update" feature.';
     return $message;
 }
开发者ID:piwikjapan,项目名称:piwik,代码行数:14,代码来源:Filechecks.php

示例3: getOwnerOfPiwikFiles

 public static function getOwnerOfPiwikFiles()
 {
     $index = Filesystem::realpath(PIWIK_INCLUDE_PATH . '/index.php');
     $stat = stat($index);
     if (!$stat) {
         return '';
     }
     $group = posix_getgrgid($stat[5]);
     $group = $group['name'];
     $user = posix_getpwuid($stat[4]);
     $user = $user['name'];
     return "{$user}:{$group}";
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:13,代码来源:Filechecks.php


注:本文中的Piwik\Filesystem::realpath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。