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


PHP PhabricatorEnv::getCDNURI方法代码示例

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


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

示例1: processRequest

 public function processRequest()
 {
     $root = dirname(phutil_get_library_root('phabricator'));
     require_once $root . '/support/phame/libskin.php';
     $this->cssResources = array();
     $css = $this->getPath('css/');
     if (Filesystem::pathExists($css)) {
         foreach (Filesystem::listDirectory($css) as $path) {
             if (!preg_match('/.css$/', $path)) {
                 continue;
             }
             $this->cssResources[] = phutil_tag('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $this->getResourceURI('css/' . $path)));
         }
     }
     $map = CelerityResourceMap::getNamedInstance('phabricator');
     $resource_symbol = 'syntax-highlighting-css';
     $resource_uri = $map->getURIForSymbol($resource_symbol);
     $this->cssResources[] = phutil_tag('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => PhabricatorEnv::getCDNURI($resource_uri)));
     $this->cssResources = phutil_implode_html("\n", $this->cssResources);
     $request = $this->getRequest();
     // Render page parts in order so the templates execute in order, if we're
     // using templates.
     $header = $this->renderHeader();
     $content = $this->renderContent($request);
     $footer = $this->renderFooter();
     if (!$content) {
         $content = $this->render404Page();
     }
     $content = array($header, $content, $footer);
     $response = new AphrontWebpageResponse();
     $response->setContent(phutil_implode_html("\n", $content));
     return $response;
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:33,代码来源:PhameBasicTemplateBlogSkin.php

示例2: getViewURI

 public function getViewURI()
 {
     if (!$this->getPHID()) {
         throw new Exception("You must save a file before you can generate a view URI.");
     }
     $name = phutil_escape_uri($this->getName());
     $path = '/file/data/' . $this->getSecretKey() . '/' . $this->getPHID() . '/' . $name;
     return PhabricatorEnv::getCDNURI($path);
 }
开发者ID:ramons03,项目名称:phabricator,代码行数:9,代码来源:PhabricatorFile.php

示例3: getProfileImageVersion

 /**
  * Get a version identifier for a user's profile image.
  *
  * This version will change if the image changes, or if any of the
  * environment configuration which goes into generating a URI changes.
  *
  * @return string Cache version.
  * @task image-cache
  */
 private function getProfileImageVersion()
 {
     $parts = array(PhabricatorEnv::getCDNURI('/'), PhabricatorEnv::getEnvConfig('cluster.instance'), $this->getProfileImagePHID());
     $parts = serialize($parts);
     return PhabricatorHash::digestForIndex($parts);
 }
开发者ID:demon,项目名称:phabricator,代码行数:15,代码来源:PhabricatorUser.php

示例4: getURI

 public function getURI(CelerityResourceMap $map, $name, $use_primary_domain = false)
 {
     $uri = $map->getURIForName($name);
     // If we have a postprocessor selected, add it to the URI.
     $postprocessor_key = $this->getPostprocessorKey();
     if ($postprocessor_key) {
         $uri = preg_replace('@^/res/@', '/res/' . $postprocessor_key . 'X/', $uri);
     }
     // In developer mode, we dump file modification times into the URI. When a
     // page is reloaded in the browser, any resources brought in by Ajax calls
     // do not trigger revalidation, so without this it's very difficult to get
     // changes to Ajaxed-in CSS to work (you must clear your cache or rerun
     // the map script). In production, we can assume the map script gets run
     // after changes, and safely skip this.
     if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) {
         $mtime = $map->getModifiedTimeForName($name);
         $uri = preg_replace('@^/res/@', '/res/' . $mtime . 'T/', $uri);
     }
     if ($use_primary_domain) {
         return PhabricatorEnv::getURI($uri);
     } else {
         return PhabricatorEnv::getCDNURI($uri);
     }
 }
开发者ID:truSense,项目名称:phabricator,代码行数:24,代码来源:CelerityStaticResourceResponse.php

示例5: getTransformedURI

 private function getTransformedURI($transform)
 {
     $parts = array();
     $parts[] = 'file';
     $parts[] = 'xform';
     $instance = PhabricatorEnv::getEnvConfig('cluster.instance');
     if (strlen($instance)) {
         $parts[] = '@' . $instance;
     }
     $parts[] = $transform;
     $parts[] = $this->getPHID();
     $parts[] = $this->getSecretKey();
     $path = implode('/', $parts);
     $path = $path . '/';
     return PhabricatorEnv::getCDNURI($path);
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:16,代码来源:PhabricatorFile.php

示例6: getResourceURI

 public final function getResourceURI($resource)
 {
     $root = $this->getSpecification()->getRootDirectory();
     $path = $root . DIRECTORY_SEPARATOR . $resource;
     $data = Filesystem::readFile($path);
     $hash = PhabricatorHash::digest($data);
     $hash = substr($hash, 0, 6);
     $id = $this->getBlog()->getID();
     $uri = '/phame/r/' . $id . '/' . $hash . '/' . $resource;
     $uri = PhabricatorEnv::getCDNURI($uri);
     return $uri;
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:12,代码来源:PhameBasicBlogSkin.php


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