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


PHP Engine::getRemoteDir方法代码示例

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


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

示例1: getCSSAndJSDependencies

 public final function getCSSAndJSDependencies($appendTemplateDefaultPublicDirectory = true)
 {
     $values = array();
     foreach ($this->CSS as $value) {
         $url = strpos($value, "http://") > -1 || strpos($value, "https://") > -1 ? $value : Engine::getRemoteDir($appendTemplateDefaultPublicDirectory ? $this->getLocalDir() . '/public/' . $value : $value);
         array_push($values, "<link href='" . $url . "' rel='stylesheet' type='text/css'/>");
     }
     foreach ($this->JS as $value) {
         $url = strpos($value, "http:") > -1 || strpos($value, "https://") > -1 ? $value : Engine::getRemoteDir($appendTemplateDefaultPublicDirectory ? $this->getLocalDir() . '/public/' . $value : $value);
         array_push($values, "<script src='" . $url . "'></script>");
     }
     return $values;
 }
开发者ID:shaungeorge,项目名称:facebook_analyser,代码行数:13,代码来源:Template.php

示例2: test_getRemoteDir

 public function test_getRemoteDir()
 {
     /*
     	This unit test is against the filepath of the engine.
     	This is so that the function gives us a relative URL 
     	rather than a filepath, this then allows us to transform
     	paths such as CSS etc to their correct local on a website.
     	With the assistance of getRemoteAbsolutePath, we can get 
     	the server address and also the virtualhost address if there
     	is one. (e.g. Cardiff Uni project server use your email username,
     	in other words, mine is /JamesM27 on the project.cs.cf.ac.uk domain
     	however, without this fix, apache treats the folder as root, i.e. "/").
     */
     //Remove the unit test folder for our actual document path
     $_SERVER['DOCUMENT_ROOT'] = realpath(__DIR__ . '../');
     //Pretend we are a web server running index.php to set our environment
     $_SERVER["PHP_SELF"] = "/index.php";
     $this->assertEquals("/", Engine::getRemoteDir("/"));
     //Test against a realworld scenario, i.e. our actual file path.
     $this->assertEquals("/home", Engine::getRemoteDir(__DIR__ . "/home"));
 }
开发者ID:shaungeorge,项目名称:facebook_analyser,代码行数:21,代码来源:EngineTest.php

示例3: onSubmit

 public function onSubmit()
 {
     rename(TEMP_CONFIG_FILE, CONFIG_FILE);
     $this->sendStatus(false, Engine::getRemoteDir($_SERVER['REQUEST_URI']));
 }
开发者ID:shaungeorge,项目名称:facebook_analyser,代码行数:5,代码来源:FinishSetup.php


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