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


PHP getFile函数代码示例

本文整理汇总了PHP中getFile函数的典型用法代码示例。如果您正苦于以下问题:PHP getFile函数的具体用法?PHP getFile怎么用?PHP getFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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&auml;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


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