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


PHP Filesystem::getPlatformPath方法代碼示例

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


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param array            $repoConfig       The repository configuration
  * @param IOInterface      $io               The IO instance
  * @param Config           $config           The composer configuration
  * @param ProcessExecutor  $process          Process instance, injectable for mocking
  * @param RemoteFilesystem $remoteFilesystem Remote Filesystem, injectable for mocking
  */
 public final function __construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
 {
     if (Filesystem::isLocalPath($repoConfig['url'])) {
         $repoConfig['url'] = Filesystem::getPlatformPath($repoConfig['url']);
     }
     $this->url = $repoConfig['url'];
     $this->originUrl = $repoConfig['url'];
     $this->repoConfig = $repoConfig;
     $this->io = $io;
     $this->config = $config;
     $this->process = $process ?: new ProcessExecutor($io);
     $this->remoteFilesystem = $remoteFilesystem ?: new RemoteFilesystem($io, $config);
 }
開發者ID:hanovruslan,項目名稱:composer,代碼行數:22,代碼來源:VcsDriver.php

示例2: supports

 /**
  * {@inheritDoc}
  */
 public static function supports(IOInterface $io, Config $config, $url, $deep = false)
 {
     if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?bitbucket.org|https://(?:.*?)\\.kilnhg.com)#i', $url)) {
         return true;
     }
     // local filesystem
     if (Filesystem::isLocalPath($url)) {
         $url = Filesystem::getPlatformPath($url);
         if (!is_dir($url)) {
             throw new \RuntimeException('Directory does not exist: ' . $url);
         }
         $process = new ProcessExecutor();
         // check whether there is a hg repo in that path
         if ($process->execute('hg summary', $output, $url) === 0) {
             return true;
         }
     }
     if (!$deep) {
         return false;
     }
     $processExecutor = new ProcessExecutor();
     $exit = $processExecutor->execute(sprintf('hg identify %s', ProcessExecutor::escape($url)), $ignored);
     return $exit === 0;
 }
開發者ID:composer-fork,項目名稱:composer,代碼行數:27,代碼來源:HgDriver.php

示例3: supports

 /**
  * {@inheritDoc}
  */
 public static function supports(IOInterface $io, Config $config, $url, $deep = false)
 {
     if (preg_match('#(^git://|\\.git/?$|git(?:olite)?@|//git\\.|//github.com/)#i', $url)) {
         return true;
     }
     // local filesystem
     if (Filesystem::isLocalPath($url)) {
         $url = Filesystem::getPlatformPath($url);
         if (!is_dir($url)) {
             return false;
         }
         $process = new ProcessExecutor($io);
         // check whether there is a git repo in that path
         if ($process->execute('git tag', $output, $url) === 0) {
             return true;
         }
     }
     if (!$deep) {
         return false;
     }
     $process = new ProcessExecutor($io);
     if ($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0) {
         return true;
     }
     return false;
 }
開發者ID:neon64,項目名稱:composer,代碼行數:29,代碼來源:GitDriver.php

示例4: supports

 /**
  * {@inheritDoc}
  */
 public static function supports(IOInterface $io, Config $config, $url, $deep = false)
 {
     if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?(?:chiselapp\\.com|fossil\\.))#i', $url)) {
         return true;
     }
     if (preg_match('!/fossil/|\\.fossil!', $url)) {
         return true;
     }
     // local filesystem
     if (Filesystem::isLocalPath($url)) {
         $url = Filesystem::getPlatformPath($url);
         if (!is_dir($url)) {
             return false;
         }
         $process = new ProcessExecutor();
         // check whether there is a fossil repo in that path
         if ($process->execute('fossil info', $output, $url) === 0) {
             return true;
         }
     }
     return false;
 }
開發者ID:neon64,項目名稱:composer,代碼行數:25,代碼來源:FossilDriver.php

示例5: supports

 /**
  * {@inheritDoc}
  */
 public static function supports(IOInterface $io, Config $config, $url, $deep = false)
 {
     if (preg_match('#(^git://|\\.git$|git(?:olite)?@|//git\\.|//github.com/)#i', $url)) {
         return true;
     }
     // local filesystem
     if (Filesystem::isLocalPath($url)) {
         $url = Filesystem::getPlatformPath($url);
         if (!is_dir($url)) {
             throw new \RuntimeException('Directory does not exist: ' . $url);
         }
         $process = new ProcessExecutor($io);
         // check whether there is a git repo in that path
         if ($process->execute('git tag', $output, $url) === 0) {
             return true;
         }
     }
     if (!$deep) {
         return false;
     }
     // TODO try to connect to the server
     return false;
 }
開發者ID:composer-fork,項目名稱:composer,代碼行數:26,代碼來源:GitDriver.php

示例6: supports

 public static function supports(IOInterface $io, Config $config, $url, $deep = false)
 {
     if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?bitbucket.org|https://(?:.*?)\\.kilnhg.com)#i', $url)) {
         return true;
     }
     if (Filesystem::isLocalPath($url)) {
         $url = Filesystem::getPlatformPath($url);
         if (!is_dir($url)) {
             return false;
         }
         $process = new ProcessExecutor();
         if ($process->execute('hg summary', $output, $url) === 0) {
             return true;
         }
     }
     if (!$deep) {
         return false;
     }
     $processExecutor = new ProcessExecutor();
     $exit = $processExecutor->execute(sprintf('hg identify %s', ProcessExecutor::escape($url)), $ignored);
     return $exit === 0;
 }
開發者ID:VicDeo,項目名稱:poc,代碼行數:22,代碼來源:HgDriver.php


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