当前位置: 首页>>代码示例>>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;未经允许,请勿转载。