本文整理汇总了PHP中getFile函数的典型用法代码示例。如果您正苦于以下问题:PHP getFile函数的具体用法?PHP getFile怎么用?PHP getFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: install
function install($rootFolder)
{
out('Installing');
chdir("{$rootFolder}/htdocs");
getFile("{$rootFolder}/htdocs/dashboard.php", "https://raw.github.com/gist/1512137/dashboard.php");
return true;
}
开发者ID:GusTheSadGeek,项目名称:dashboard,代码行数:7,代码来源:install.php
示例2: replaceIncludeCallback
function replaceIncludeCallback($matches)
{
$path = $matches[1];
$contents = getFile($path, true);
$result = $contents;
return $result;
}
开发者ID:raykai,项目名称:porter,代码行数:7,代码来源:make.php
示例3: getDirFiles
function getDirFiles($dir)
{
global $quiz;
$files = array();
$i = 0;
$d = dir($dir);
$short_dir = str_replace($quiz->getDir(), "", $dir);
while (false !== ($entry = $d->read())) {
if ($entry[0] != '.') {
$files[$i++] = $entry;
}
}
$tab_fic = array();
sort($files);
foreach ($files as $nb => $file) {
$fic = getFile($short_dir, $file);
$keys = array_keys($fic);
$key = $keys[0];
if (!array_key_exists($key, $tab_fic)) {
$tab_fic[$key] = array();
}
array_push($tab_fic[$key], $fic[$key]);
}
return $tab_fic;
}
开发者ID:CedricDinont,项目名称:PaperQuiz,代码行数:25,代码来源:view_files_common.php
示例4: getHTMLinjector
function getHTMLinjector()
{
$path = "widgets/" . $this->id . "/" . $this->html;
if ($this->html == null || $this->html == "") {
return "//Not HTML file includedc in the JSON config file.";
}
if (file_exists($path)) {
$html = str_replace("\n", "", getFile($path, true));
$html = str_replace("'", "\"", $html);
//replacing the tags
if ($this->tags != null) {
foreach ($this->tags as $key => $value) {
$html = str_replace("{" . $key . "}", $value, $html);
}
}
//$htmlT="var htmlTemplate = '".$htmlT."';\n";
//$htmlT .= "var target='".$this->templateTarget."';\n";
$htmlT = "(function (\$) { \n";
$htmlT .= "\t\$(function () { \n";
$htmlT .= "\t\t\$('." . $this->templateTarget . "').append('" . $html . "'); \n";
$htmlT .= "\t}); \n";
$htmlT .= "})(jQuery);\n";
return $htmlT;
}
throw new RuntimeException("HTML file(" . $path . ") couldnt be opened");
}
开发者ID:4ndr01d3,项目名称:biosual,代码行数:26,代码来源:Widget.inc.php
示例5: introAdk
function introAdk()
{
global $context, $txt;
$context['sub_template'] = 'introAdk';
$context['page_title'] = $txt['adkmod_modules_intro'];
global $sourcedir;
require_once $sourcedir . '/Subs-Package.php';
$context['file'] = getFile('http://www.smfpersonal.net/xml/read_modules.php');
}
开发者ID:lucasruroken,项目名称:adkportal,代码行数:9,代码来源:Adk-AdminModules.php
示例6: result
function result()
{
$RESULT = getFile($RESULT);
echo '<TABLE width="100%">';
echo '<tr><td>' . count($RESULT) . '</td></tr>';
foreach ($RESULT as $item) {
echo "<tr><td>" . $item . "</td></tr>/n";
}
echo '</TABLE>';
}
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:10,代码来源:addfontttf.php
示例7: delWords
function delWords($n = NULL)
{
if (!is_null($n) and is_numeric($n)) {
$text = getFile();
foreach ($text as $k => $v) {
if ($n < mb_strlen($text[$k])) {
unset($text[$k]);
}
}
file_put_contents("./words", implode(" ", $text));
}
}
开发者ID:AshMorrow,项目名称:homework,代码行数:12,代码来源:3.php
示例8: getFile
function getFile($dir)
{
$dp = opendir($dir);
$fileArr = array();
while (!false == ($curFile = readdir($dp))) {
if ($curFile != "." && $curFile != ".." && $curFile != "") {
if (is_dir($curFile)) {
$fileArr = getFile($dir . "/" . $curFile);
} else {
$fileArr[] = $dir . "/" . $curFile;
}
}
}
return $fileArr;
}
开发者ID:HanyuGuo,项目名称:Employee-Management-System,代码行数:15,代码来源:index.php
示例9: getInvitationTemplate
function getInvitationTemplate($_requestid, $_internid, $_sessid, $_name, $_groupid)
{
global $CONFIG;
$template = !@file_exists(FILE_INVITATIONLOGO) ? getFile(TEMPLATE_SCRIPT_INVITATION) : getFile(TEMPLATE_SCRIPT_INVITATION_LOGO);
$template = str_replace("<!--request_id-->", $_requestid, $template);
$template = str_replace("<!--site_name-->", $CONFIG["gl_site_name"], $template);
$template = str_replace("<!--sess_id-->", $_sessid, $template);
$template = str_replace("<!--intern_name-->", $_name, $template);
$template = str_replace("<!--group_id-->", base64UrlEncode($_groupid), $template);
$template = str_replace("<!--intern_id-->", base64UrlEncode($_internid), $template);
$template = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $template);
$template = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $template);
$template = str_replace("<!--server-->", LIVEZILLA_URL, $template);
$template = str_replace("<!--intern_image-->", file_exists(PATH_INTERN_IMAGES . md5($_internid) . FILE_EXTENSION_PROFILE_PICTURE) ? md5($_internid) . FILE_EXTENSION_PROFILE_PICTURE . "?acid=" . uniqid(rand()) : "nopic" . FILE_EXTENSION_PROFILE_PICTURE, $template);
return doReplacements($template);
}
开发者ID:afzet,项目名称:cake-cart,代码行数:16,代码来源:functions.tracking.inc.php
示例10: makeArrayFromFile
function makeArrayFromFile($path)
{
$data = getFile($path);
$opt_array = array();
foreach ($data as $key => $val) {
if (!in_array($key, array(0, 31))) {
$data = explode(" ", $val);
foreach ($data as $d => $v) {
$tmp = trim($v);
if (!empty($tmp) && strlen($tmp)) {
$opt_array[$key][] = $tmp;
}
}
}
}
return $opt_array;
}
开发者ID:suman1234,项目名称:code-17-07-15,代码行数:17,代码来源:function.php
示例11: __autoload
function __autoload($name)
{
try {
$file = getFile($name);
if ($file !== NULL) {
include $file;
} else {
throw new Exception('Die Klasse <font color="red">' . $name . '</font> wurde nicht gefunden.');
}
if (!class_exists($name)) {
throw new Exception('Die Datei <b>' . $file . '</b> enthält nicht die Klasse <font color="red">' . $name . '</font>');
}
return true;
} catch (Exception $error) {
die($error->getMessage());
}
}
开发者ID:Tungse,项目名称:croncase,代码行数:17,代码来源:autoload.php
示例12: Generate
function Generate()
{
foreach ($this->InternalGroups as $groupId => $group) {
$this->XMLGroups .= "<v id=\"" . base64_encode($groupId) . "\" desc=\"" . base64_encode($group["gr_desc_array"]) . "\" created=\"" . base64_encode($group["gr_created"]) . "\" email=\"" . base64_encode($group["gr_email"]) . "\" extern=\"" . base64_encode($group["gr_extern"]) . "\" standard=\"" . base64_encode($group["gr_standard"]) . "\" vf=\"" . base64_encode($group["gr_vfilters"]) . "\">\r\n";
foreach ($group["gr_predefined"] as $premes) {
$this->XMLGroups .= $premes->GetXML();
}
$this->XMLGroups .= "</v>\r\n";
}
foreach ($this->InternalUsers as $sysId => $internaluser) {
$b64sysId = base64_encode($sysId);
$sessiontime = getDataSetTime($this->Caller->SessionFile);
if (file_exists($this->InternalUsers[$sysId]->PictureFile)) {
if ($_POST[POST_INTERN_XMLCLIP_HASH_PICTURES_PROFILE] == XML_CLIP_NULL || @filemtime($this->InternalUsers[$sysId]->PictureFile) >= $sessiontime) {
$this->XMLProfilePictures .= "<v os=\"" . $b64sysId . "\" content=\"" . fileToBase64($this->InternalUsers[$sysId]->PictureFile) . "\" />\r\n";
}
} else {
$this->XMLProfilePictures .= "<v os=\"" . $b64sysId . "\" content=\"" . base64_encode("") . "\" />\r\n";
}
if ($sysId != CALLER_SYSTEM_ID && file_exists($this->InternalUsers[$sysId]->WebcamFile)) {
if ($_POST[POST_INTERN_XMLCLIP_HASH_PICTURES_PROFILE] == XML_CLIP_NULL || @filemtime($this->InternalUsers[$sysId]->WebcamFile) >= $sessiontime) {
$this->XMLWebcamPictures .= "<v os=\"" . $b64sysId . "\" content=\"" . fileToBase64($this->InternalUsers[$sysId]->WebcamFile) . "\" />\r\n";
}
} else {
$this->XMLWebcamPictures .= "<v os=\"" . $b64sysId . "\" content=\"" . base64_encode("") . "\" />\r\n";
}
$CPONL = $this->InternalUsers[CALLER_SYSTEM_ID]->Level == USER_LEVEL_ADMIN ? " cponl=\"" . base64_encode($internaluser->IsPasswordChangeNeeded() ? 1 : 0) . "\"" : "";
$PASSWORD = SERVERSETUP ? " pass=\"" . base64_encode($this->InternalUsers[$sysId]->LoadPassword()) . "\"" : "";
$this->XMLInternal .= "<v status=\"" . base64_encode($this->InternalUsers[$sysId]->Status) . "\" id=\"" . $b64sysId . "\" userid=\"" . base64_encode($this->InternalUsers[$sysId]->UserId) . "\" email=\"" . base64_encode($this->InternalUsers[$sysId]->Email) . "\" websp=\"" . base64_encode($this->InternalUsers[$sysId]->Webspace) . "\" name=\"" . base64_encode($this->InternalUsers[$sysId]->Fullname) . "\" desc=\"" . base64_encode($this->InternalUsers[$sysId]->Description) . "\" groups=\"" . base64_encode($this->InternalUsers[$sysId]->GroupsArray) . "\" perms=\"" . base64_encode($this->InternalUsers[$sysId]->PermissionSet) . "\" ip=\"" . base64_encode($this->InternalUsers[$sysId]->IP) . "\" level=\"" . base64_encode($this->InternalUsers[$sysId]->Level) . "\" " . $CPONL . " " . $PASSWORD . ">\r\n";
foreach ($internaluser->PredefinedMessages as $premes) {
$this->XMLInternal .= $premes->GetXML();
}
$this->XMLInternal .= "</v>\r\n";
if ($sysId != $this->Caller->SystemId && $this->InternalUsers[$sysId]->Status != USER_STATUS_OFFLINE) {
$this->XMLTyping .= "<v id=\"" . $b64sysId . "\" tp=\"" . base64_encode($this->Caller->SystemId === $this->InternalUsers[$sysId]->Typing ? 1 : 0) . "\" />\r\n";
}
if (file_exists($internaluser->VisitcardFile)) {
if (isset($_POST[POST_INTERN_XMLCLIP_HASH_VISITCARDS]) && $_POST[POST_INTERN_XMLCLIP_HASH_VISITCARDS] == XML_CLIP_NULL || @filemtime($internaluser->VisitcardFile) >= $sessiontime) {
$this->XMLVisitcards .= "<v os=\"" . $b64sysId . "\" content=\"" . base64_encode(getFile($internaluser->VisitcardFile)) . "\"/>\r\n";
} else {
$this->XMLVisitcards .= "<v os=\"" . $b64sysId . "\"/>\r\n";
}
}
}
}
开发者ID:afzet,项目名称:cake-cart,代码行数:45,代码来源:objects.internal.inc.php
示例13: getFile
function getFile($dir, $dir2 = "", $fileArray = array())
{
if (false != ($handle = opendir($dir . $dir2))) {
while (false !== ($file = readdir($handle))) {
//去掉"“.”、“..”以及带“.xxx”后缀的文件
if ($file != "." && $file != "..") {
// print_r($file."<br>");
if (is_dir($dir . $file)) {
$fileArray = array_merge($fileArray, getFile($dir, $dir2 . $file . '/'));
} else {
if (substr($file, -5) == ".html") {
$fileArray[] = $dir2 . $file;
}
}
}
}
//关闭句柄
closedir($handle);
}
return $fileArray;
}
开发者ID:shaokr,项目名称:FN-toop,代码行数:21,代码来源:dir.php
示例14: getFile
function getFile($name = 'Mojo.class.php', $path = '.', $level = 0)
{
$target = "";
if (file_exists($path . $name)) {
return $path . $name;
}
//if you have your mojo lib in a diff set of libs set them here
$scan = array('lib', 'vendor', 'src', 'tasks', 'Mojo-Tasks', $name);
$dh = @opendir($path);
while (false !== ($file = @readdir($dh))) {
if (in_array($file, $scan)) {
if (is_dir("{$path}/{$file}")) {
return getFile($name, $path . DIRECTORY_SEPARATOR . $file, $level + 1);
} else {
if ($file == $name) {
$target = $path . DIRECTORY_SEPARATOR . $file;
return realpath($target);
}
}
}
}
@closedir($dh);
return $target;
}
开发者ID:slajax,项目名称:Mojo-Tasks,代码行数:24,代码来源:MojoFunctions.php
示例15: htmlspecialchars
$class = htmlspecialchars($_GET['class']);
$file = htmlspecialchars($_GET['file']);
/* 获取目录数据 */
if ($class) {
$menus = getFile(__API__ . '/' . $class);
if ($menus) {
asort($menus);
}
$menus = $menus ?: $menus;
} else {
$directory = getDir(__API__);
$menus = array();
if ($directory) {
asort($directory);
foreach ($directory as $k => $v) {
$file = getFile(__API__ . '/' . $v);
$menus[$k]['num'] = count($file);
$menus[$k]['name'] = $v;
}
} else {
$menus = $directory;
}
}
/* 读取解析文档内容 */
if ($file) {
$file_name = __API__ . '/' . $class . '/' . $file;
$content = readFileText($file_name);
$content = $content ? Parsedown::instance()->parse($content) : $content;
} else {
$content = '';
}
开发者ID:flycmd,项目名称:doc-tools-markdown,代码行数:31,代码来源:index.php
示例16: getTicketInputs
function getTicketInputs($_html)
{
global $CONFIG;
$inputshtml = "";
$inputsareahtml = "";
$inputtpl = getFile(TEMPLATE_LOGIN_INPUT);
$areatpl = str_replace("<!--maxlength-->", 16777216, getFile(TEMPLATE_LOGIN_AREA));
$CONFIG["gl_ti_list"] = $CONFIG["gl_ci_list"];
$custom_inputs = $CONFIG["gl_ti_list"];
foreach ($custom_inputs as $index => $caption) {
$area = false;
if ($index == 114) {
$area = true;
$input = $areatpl;
} else {
$input = $inputtpl;
}
$input = str_replace("<!--name-->", $index, $input);
$input = str_replace("<!--caption-->", $caption, $input);
if (!$area) {
$inputshtml .= $input;
} else {
$inputsareahtml .= $input;
}
}
return str_replace("<!--ticket_inputs-->", $inputshtml . $inputsareahtml, $_html);
}
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:27,代码来源:functions.external.inc.php
示例17: Date
<param name="flashvars" value="trustedOrigins=getbootstrap.com%2C%2F%2Fgetbootstrap.com%2Chttp%3A%2F%2Fgetbootstrap.com">
<embed src="/assets/flash/ZeroClipboard.swf?noCache=1419347221407" loop="false" menu="false" quality="best"
bgcolor="#ffffff" width="100%" height="100%" name="global-zeroclipboard-flash-bridge" allowscriptaccess="sameDomain"
allowfullscreen="false" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="trustedOrigins=getbootstrap.com%2C%2F%2Fgetbootstrap.com%2Chttp%3A%2F%2Fgetbootstrap.com" scale="exactfit">
</object>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="1140" height="500" viewBox="0 0 1140 500" preserveAspectRatio="none" style="visibility: hidden; position: absolute; top: -100%; left: -100%;">
<defs></defs>
<text x="0" y="53" style="font-weight:bold;font-size:53pt;font-family:Arial, Helvetica, Open Sans, sans-serif;dominant-baseline:middle">
Thirdslide</text>
</svg>
<div id="status">
</div>
<div id="fb-root"></div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-50682719-4', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
<?php
require_once getFile('functions/phpFuncEnd.php');
开发者ID:k2yoon,项目名称:test1-1,代码行数:30,代码来源:master.php
示例18: mb_internal_encoding
mb_internal_encoding('UTF-8');
set_time_limit("1800");
//30 min
ini_set("default_socket_timeout", "1800");
$googleKey = "AIzaSyBQTntV81uQOrj6haI8OKYqhGlAFYPAAI4";
$project = $_GET["project"];
$langpath = "./tmp/lang." . $_GET["lang_in"] . ".php";
$langnewpath = "./tmp/lang." . $_GET["lang_out"] . ".php";
require_once $langpath;
$fh = fopen($langnewpath, "w");
fputs($fh, "<?\n");
foreach ($texts as $key => $singleMessage) {
$i++;
$url = "https://www.googleapis.com/language/translate/v2?key={$googleKey}&q=" . urlencode($singleMessage) . "&source=" . $_GET["lang_in"] . "&target=" . $_GET["lang_out"];
echo "Trying ... " . $url;
$fileIn = getFile($url);
fputs($fh, '$texts["' . $key . "\"]=\"" . getTranslation($fileIn) . '";' . "\n");
}
function getTranslation($fileIn)
{
$arr = json_decode($fileIn);
print_r($arr);
return str_replace('"', '\\"', $arr->data->translations[0]->translatedText);
}
function getFile($url)
{
$content = file($url);
foreach ($content as $line) {
$all .= $line . "\n";
}
return $all;
开发者ID:patrickjaja,项目名称:php-xsd-to-documentation-generator,代码行数:31,代码来源:gui.locale.php
示例19: regenerateThumbs
case "regenerateThumbs":
regenerateThumbs();
break;
case "search":
if (isset($_POST['terms'])) {
search($_POST['terms']);
}
break;
case "getFolder":
if (isset($_POST['path'])) {
getFolder($_POST['path']);
}
break;
case "getFile":
if (isset($_GET['path'])) {
getFile($_GET['path']);
}
break;
case "folderIsDeletable":
if (isset($_POST['path'])) {
folderIsDeletable($_POST['path']);
}
break;
case "getFilePackage":
if (isset($_GET['paths'])) {
getFilePackage($_GET['paths']);
}
break;
case "emailFilePackage":
if (isset($_GET['fileid'], $_GET['to'], $_GET['from'], $_GET['message'])) {
emailFilePackage($_GET['fileid'], $_GET['to'], $_GET['from'], $_GET['message']);
开发者ID:kkappel,项目名称:relay,代码行数:31,代码来源:relay.php
示例20: loadArticleData
function loadArticleData()
{
global $config;
if ($this->preview) {
//get from db
dbConnect();
$artData = new artEditorLib();
$artData->preview = true;
$artData->preview = $this->preview;
$artData->getArtFromDB($this->artId);
$this->art = $artData->getArtString();
} else {
$file = $config["articleVault"] . getHash($this->artId) . "/{$this->artId}.dat";
if ($page = getFile($file)) {
$this->art = unserialize($page);
//set stats
$statLog["aid"] = $this->art["artId"];
$statLog["conf"] = $this->art["conference"];
} else {
logit(REPORT, "Could not open article file {$file} (Refer: {$_SERVER["HTTP_REFERER"]})");
$error = true;
}
}
//get images
if (is_numeric($this->artId)) {
$sql = "SELECT artId FROM articleImages WHERE artId = {$this->artId} ";
if ($rc = dbQuery($sql)) {
if ($rowImg = dbFetch($rc)) {
$this->art["image"] = "/img_{$this->art["artId"]}.jpg";
} else {
$this->art["image"] = "";
}
} else {
logit(WARN, " DB Error: {$sql} in " . __FILE__ . " on line: " . __LINE__);
}
//get Image, internal
$sql = "SELECT artId FROM articleInternalImages WHERE artId = {$this->artId} ";
if ($rc = dbQuery($sql)) {
if ($rowImg = dbFetch($rc)) {
$this->art["imageInternal"] = "/imgNews_{$this->art["artId"]}.jpg";
} else {
$this->art["imageInternal"] = $this->art["image"];
//if no internal use hp
}
} else {
logit(WARN, " DB Error: {$sql} in " . __FILE__ . " on line: " . __LINE__);
}
} else {
$this->art["imageInternal"] = "";
$this->art["image"] = "";
}
//get subtopic names
/*
if (is_array($this->art["subtopics"]))
$sql="SELECT confId,confName FROM confNames WHERE confId IN (".implode(",",$this->art["subtopics"]).",{$this->art["conference"]}) ";
else $sql="SELECT confId,confName FROM confNames WHERE confId ='{$this->art["conference"]}' ";
*/
//get all confs because the page now needs all of them
$sql = "SELECT confId,confName FROM confNames";
if ($rc = dbQuery($sql)) {
while ($row = dbFetch($rc)) {
$this->confNames[$row["confId"]] = $row["confName"];
}
} else {
logit(WARN, " DB Error: {$sql} in " . __FILE__ . " on line: " . __LINE__);
}
//dumpVar($this->art);
if ($this->preview) {
$this->art["headline"] .= " (preview)";
}
}
开发者ID:billnobes,项目名称:samples,代码行数:71,代码来源:articleModern.php
注:本文中的getFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论