• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP loadFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parseFile

function parseFile($download = false, $config)
{
    $code = "";
    $stylist = new phpStylist();
    if (!isset($config->file) || $config->file == "") {
        return false;
    }
    $code = loadFile($config->file);
    if (isset($config->iso8859)) {
        $code = utf8_encode($code);
    }
    if (!empty($code)) {
        $stylist->options = $config;
        if (isset($config->indent_with_tabs) && $config->indent_with_tabs) {
            $stylist->indent_char = "\t";
        }
        if (!empty($config->indent_size)) {
            $stylist->indent_size = $config->indent_size;
        }
        if (strpos($code, '<?') === false) {
            $code = '<?php ' . $code . ' ?>';
        }
        $formatted = $stylist->formatCode($code);
    }
    return $formatted;
}
开发者ID:CobaltBlueDW,项目名称:oddsandends,代码行数:26,代码来源:phpStylist.php


示例2: loadTemplate

 private function loadTemplate()
 {
     if (is_file($this->_folderTemplate . '/index.html')) {
         loadFile($this->_folderTemplate . '/index.html');
         return true;
     } else {
         return false;
     }
 }
开发者ID:cheevauva,项目名称:trash,代码行数:9,代码来源:View.class.php


示例3: loadLib

 /**
  * Загрузить библиотеку
  * @return bool Статус загрузки
  * @exception Не найден класс/адаптер библиотеки
  */
 private function loadLib()
 {
     if (loadFile($this->forlderLibrary . '/Adapter.php')) {
         if (class_exists($this->nameLibrary)) {
             return $this->{$this->nameLibrary} = new $this->nameLibrary();
         }
         return true;
     }
     return false;
 }
开发者ID:cheevauva,项目名称:trash,代码行数:15,代码来源:Lib.class.php


示例4: __construct

 public function __construct()
 {
     $tempEngineSelect = C('TEMPLATE_ENGINE');
     if ("NoteEng" == $tempEngineSelect) {
         $this->tempEngine = new Templates();
     } else {
         loadFile("notephp.Smarty.{$tempEngineSelect}");
         $this->tempEngine = new Smarty();
     }
     $this->tempEngine->left_delimiter = C('SMARTY_LEFT_DELIMITER');
     $this->tempEngine->right_delimiter = C('SMARTY_RIGHT_DELIMITER');
     $this->tempEngine->cache_dir = PRO_PATH . "/" . ucfirst($GLOBALS['PROJECT_REQUEST_MODULE']) . "/Runtime/Cache";
     $this->tempEngine->compile_dir = PRO_PATH . "/" . ucfirst($GLOBALS['PROJECT_REQUEST_MODULE']) . "/Runtime/Compile";
 }
开发者ID:hebarguan,项目名称:notephp,代码行数:14,代码来源:View.class.php


示例5: testCallbackFieldsInvalidResponse

 function testCallbackFieldsInvalidResponse()
 {
     $client = new Zipmark_Client('wrong_identifier', 'wrong_secret');
     $headerFile = loadFile('callback/headers_invalid.json');
     $bodyFile = loadFile('callback/body.json');
     // Headers should be an array
     $headers = json_decode($headerFile[0], true);
     // Body should be a JSON string
     $body = $bodyFile[0];
     $callback = new Zipmark_Callback($client, $headers, $body);
     $this->assertFalse($callback->isValid());
     $this->assertNull($callback->event());
     $this->assertNull($callback->objectType());
     $this->assertNull($callback->object());
 }
开发者ID:zipmark,项目名称:zipmark-php,代码行数:15,代码来源:callback_test.php


示例6: exit

if (!defined('MAC_ROOT')) {
    exit('Access Denied');
}
if ($method == 'vod') {
    $tpl->P['cp'] = 'map';
    $tpl->P['cn'] = $method . $tpl->P['id'];
    echoPageCache($tpl->P['cp'], $tpl->P['cn']);
    $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
    $sql = "SELECT * FROM {pre}vod WHERE d_hide=0 AND d_id=" . $tpl->P['id'];
    $row = $db->getRow($sql);
    if (!row) {
        showErr('System', '未找到指定数据');
    }
    $tpl->T = $MAC_CACHE['vodtype'][$row['d_type']];
    $tpl->D = $row;
    unset($row);
    $tpl->loadvod("rss");
    $tpl->replaceVod();
    $tpl->playdownlist("play");
    $tpl->playdownlist("down");
} elseif ($method == 'rss' || $method == 'baidu' || $method == 'google' || $method == '360') {
    $tpl->P['cp'] = 'map';
    $tpl->P['cn'] = $method . '-' . $tpl->P['pg'];
    echoPageCache($tpl->P['cp'], $tpl->P['cn']);
    $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
    $tpl->H = loadFile(MAC_ROOT . '/inc/map/' . $method . '.html');
    $tpl->mark();
} else {
    showErr('System', '未找到指定系统模块');
}
开发者ID:klarclm,项目名称:sgv,代码行数:30,代码来源:map.php


示例7: loadFile

	header('Content-Type: image/jpg');
	$url = $_GET["url"];
}

function loadFile($sFilename, $sCharset = 'UTF-8')
{
    if (floatval(phpversion()) >= 4.3) {
        $sData = file_get_contents($sFilename);
    } else {
        if (!file_exists($sFilename)) return -3;
        $rHandle = fopen($sFilename, 'r');
        if (!$rHandle) return -2;

        $sData = '';
        while(!feof($rHandle))
            $sData .= fread($rHandle, filesize($sFilename));
        fclose($rHandle);
    }
    return $sData;
}

if( $url != "" )
{
	echo loadFile($url, "auto");
}
else
{
	echo "URL não definida";
}

?>
开发者ID:netoleal,项目名称:ASF2,代码行数:31,代码来源:index.php


示例8: loadViewTemplate

 public function loadViewTemplate($path)
 {
     return loadFile($path);
 }
开发者ID:electro-framework,项目名称:framework,代码行数:4,代码来源:ViewService.php


示例9: loadAndCompile

 /**
  * Loads a source code file and compiles it.
  *
  * @param string   $sourceFile The filesystem path of the source code file.
  * @param callable $compiler   A function that transforms the source file into the final representation that will be
  *                             cached. It must have a single parameter of type string (the source code).
  * @return mixed
  */
 function loadAndCompile($sourceFile, callable $compiler)
 {
     $sourceCode = loadFile($sourceFile, false);
     if (!$sourceCode) {
         $this->fileNotFound($sourceFile);
     }
     return $compiler($sourceCode);
 }
开发者ID:electro-framework,项目名称:framework,代码行数:16,代码来源:CachingFileCompiler.php


示例10: var_dump

{
    var_dump($_FILES);
    if ($_FILES['donnees-file-to-import']['error'] != 0) {
        return "Une erreur c'est produite durant le transfert";
    }
    if (is_uploaded_file($_FILES['donnees-file-to-import']['tmp_name']) === false) {
        return "Un fichier est requis";
    }
    if (!move_uploaded_file($_FILES['donnees-file-to-import']['tmp_name'], FILE_FLIGHT_DATA)) {
        return "Une erreur s'est produite durant la copie du fichier";
    }
    return TRUE;
}
$fileErr = "";
if (isset($_POST['submit'])) {
    $message = loadFile();
    if ($message === TRUE) {
        header("Location: tableau_bord_post_vol.php");
    } else {
        $fileErr = $message;
    }
}
?>
<!DOCTYPE html>
<html lang="fr-FR">
    <head>
        <title>Chargement des données</title>
        <meta name="description"
              content="Extrait les donnéesdu fichier généré par l'application embarqué">
        <meta charset="UTF-8">
        <meta name="author" content="Baptiste Thevenet">
开发者ID:maxitotogamer,项目名称:iutValence-projetS4-instrumentionFuseeAPoudre,代码行数:31,代码来源:chargement_donnees.php


示例11: exit

if (!defined('MAC_ROOT')) {
    exit('Access Denied');
}
if ($MAC['other']['gbook'] == 0) {
    echo 'gbook closed';
    return;
}
if ($method == 'show') {
    $tpl->C["siteaid"] = 30;
    if ($tpl->P['pg'] < 1) {
        $tpl->P['pg'] = 1;
    }
    $tpl->P['cp'] = 'app';
    $tpl->P['cn'] = 'gbook' . $tpl->P['pg'];
    //echoPageCache($tpl->P['cp'],$tpl->P['cn']);
    $tpl->H = loadFile(MAC_ROOT . "/template/" . $MAC['site']['templatedir'] . "/" . $MAC['site']['htmldir'] . "/home_gbook.html");
    $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
    $tpl->mark();
    $tpl->H = str_replace("{maccms:gbookverify}", $MAC['other']['gbookverify'], $tpl->H);
    if (strpos($tpl->H, '{maccms:count_gbook_all}')) {
        $tpl->H = str_replace("{maccms:count_gbook_all}", $tpl->getDataCount('gbook', "all"), $tpl->H);
    }
    if (strpos($tpl->H, '{maccms:count_gbook_day}')) {
        $tpl->H = str_replace("{maccms:count_gbook_day}", $tpl->getDataCount('gbook', "day"), $tpl->H);
    }
    $tpl->pageshow();
} elseif ($method == 'save') {
    $g_vid = be("all", "g_vid");
    $g_vid = chkSql($g_vid);
    $g_name = be("all", "g_name");
    $g_name = chkSql($g_name);
开发者ID:klarclm,项目名称:sgv,代码行数:31,代码来源:gbook.php


示例12: file_put_contents

// Move bash_complete_zkillboard to the bash_complete folder
try {
    file_put_contents("/etc/bash_completion.d/zkillboard", file_get_contents("{$base}/bash_complete_zkillboard"));
    exec("chmod +x {$base}/../cli.php");
} catch (Exception $ex) {
    out("|r|Error! Couldn't move the bash_complete file into /etc/bash_completion.d/, please do this after the installer is done.");
}
// Now install the db structure
try {
    $sqlFiles = scandir("{$base}/sql");
    foreach ($sqlFiles as $file) {
        if (Util::endsWith($file, ".sql")) {
            $table = str_replace(".sql", "", $file);
            out("Adding table |g|{$table}|n| ... ", false, false);
            $sqlFile = "{$base}/sql/{$file}";
            loadFile($sqlFile);
            // Ensure the table starts with base parameters and doesn't inherit anything from zkillboard.com
            if (!Util::startsWith($table, "ccp_")) {
                Db::execute("truncate table {$table}");
            }
            out("|g|done");
        }
    }
} catch (Exception $ex) {
    out("|r|Error! Removing configuration file.");
    unlink($configLocation);
    throw $ex;
}
try {
    out("|g|Installing default admin user...");
    // Install the default admin user
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:install.php


示例13: unset

     if (is_array($classarr)) {
         if (empty($tpl->P["key"])) {
             $tpl->P["key"] = $classarr["c_name"];
         }
         $tpl->P["des"] = $tpl->P["des"] . "&nbsp;剧情分类为" . $classarr["c_name"];
     }
     unset($classarr);
 }
 if (!empty($tpl->P["ids"])) {
     $arr = explode(',', $tpl->P["ids"]);
     for ($i = 0; $i < count($arr); $i++) {
         $arr[$i] = intval($arr[$i]);
     }
     $tpl->P["ids"] = join(',', $arr);
 }
 $tpl->H = loadFile(MAC_ROOT_TEMPLATE . "/vod_search.html");
 $tpl->mark();
 $tpl->pageshow();
 $colarr = array('{page:des}', '{page:key}', '{page:now}', '{page:order}', '{page:by}', '{page:wd}', '{page:wdencode}', '{page:pinyin}', '{page:letter}', '{page:year}', '{page:starring}', '{page:starringencode}', '{page:directed}', '{page:directedencode}', '{page:area}', '{page:areaencode}', '{page:lang}', '{page:langencode}', '{page:typeid}', '{page:typepid}', '{page:classid}');
 $valarr = array($tpl->P["des"], $tpl->P["key"], $tpl->P["pg"], $tpl->P["order"], $tpl->P["by"], $tpl->P["wd"], urlencode($tpl->P["wd"]), $tpl->P["pinyin"], $tpl->P["letter"], $tpl->P['year'] == 0 ? '' : $tpl->P['year'], $tpl->P["starring"], urlencode($tpl->P["starring"]), $tpl->P["directed"], urlencode($tpl->P["directed"]), $tpl->P["area"], urlencode($tpl->P["area"]), $tpl->P["lang"], urlencode($tpl->P["lang"]), $tpl->P['typeid'], $tpl->P['typepid'], $tpl->P['classid']);
 $tpl->H = str_replace($colarr, $valarr, $tpl->H);
 unset($colarr, $valarr);
 $linktype = $tpl->getLink('vod', 'search', '', array('typeid' => $tpl->P['typepid']));
 $linkyear = $tpl->getLink('vod', 'search', '', array('year' => ''));
 $linkletter = $tpl->getLink('vod', 'search', '', array('letter' => ''));
 $linkarea = $tpl->getLink('vod', 'search', '', array('area' => ''));
 $linklang = $tpl->getLink('vod', 'search', '', array('lang' => ''));
 $linkclass = $tpl->getLink('vod', 'search', '', array('classid' => ''));
 $linkorderasc = $tpl->getLink('vod', 'search', '', array('order' => 'asc'));
 $linkorderdesc = $tpl->getLink('vod', 'search', '', array('order' => 'desc'));
 $linkbytime = $tpl->getLink('vod', 'search', '', array('by' => 'time'));
开发者ID:klarclm,项目名称:sgv,代码行数:31,代码来源:vod.php


示例14: loadFile

        $iterator++;
    }
}
$music_xml_text_en = loadFile('Amazon_product_reviews/music/music.en');
$music_array_xml_text_en = parseXMLString('text', $music_xml_text_en, false);
$iterator = 0;
foreach ($music_array_xml_text_en as $music_en) {
    if (!empty($music_en)) {
        writeFile('music_en/music_en' . $iterator . '.txt', $music_en);
        $iterator++;
    } else {
        writeFile('music_en/music_en' . $iterator . '.txt', 'translation not available');
        $iterator++;
    }
}
$music_xml_text_fr = loadFile('Amazon_product_reviews/music/music.fr');
$music_array_xml_text_fr = parseXMLString('text', $music_xml_text_fr, false);
$iterator = 0;
foreach ($music_array_xml_text_fr as $music_fr) {
    if (!empty($music_fr)) {
        writeFile('music_fr/music_fr' . $iterator . '.txt', $music_fr);
        $iterator++;
    } else {
        writeFile('music_en/music_fr' . $iterator . '.txt', 'translation not available');
        $iterator++;
    }
}
/* * ***********************
 *      FUNCTIONS
 * *********************** */
/**
开发者ID:leloulight,项目名称:Cross-Language-Dataset,代码行数:31,代码来源:parse_APR_collection.php


示例15: loadart

 function loadart()
 {
     if ($this->P['make'] != true && chkCache($this->P['cp'], $this->P['cn'])) {
         $this->H = getCache($this->P['cp'], $this->P['cn']);
     } else {
         $this->H = loadFile(MAC_ROOT_TEMPLATE . "/" . $this->T['t_tpl_art']);
         $this->C["sitetid"] = $this->D['a_type'];
         $this->C["siteid"] = $this->D['a_id'];
         $this->P['arttypeid'] = $this->T['t_id'];
         $this->P['arttypepid'] = $this->T['t_pid'];
         $this->P['similar'] = array('name' => $this->D['a_name'], 'tag' => $this->D['a_tag']);
         $GLOBALS['MAC_CACHE']['arttype'][$this->T['t_id']]['similar'] = 'no';
         if ($this->P['make'] == true) {
             if (strpos($this->H, 'similar=') > 0) {
                 $GLOBALS['MAC_CACHE']['arttype'][$this->T['t_id']]['similar'] = 'ok';
             }
         }
         $this->mark();
         $this->P['pageflag'] = 'art';
         $this->P['pagetype'] = 'detail';
         if ($this->P['make']) {
             return;
         }
         $this->H = str_replace("[art:page]", $this->P["pg"], $this->H);
         $arr = explode("[art:page]", $this->D["a_content"]);
         $arrlen = count($arr);
         if ($this->P['pg'] > $arrlen) {
             $this->P['pg'] = $arrlen;
         }
         $this->P['content'] = $arr[$this->P["pg"] - 1];
         $this->P['pagesize'] = 1;
         $this->P['datacount'] = $arrlen;
         $this->P['pagecount'] = $arrlen;
         $this->pageshow();
         unset($arr);
         $this->replaceArt();
         setCache($this->P['cp'], $this->P['cn'], $this->H);
     }
 }
开发者ID:klarclm,项目名称:sgv,代码行数:39,代码来源:template.php


示例16: set_time_limit

 * This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
 * For more information, see http://creativecommons.org/licenses/by-sa/4.0/
 */
set_time_limit(100000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
/**
 * @see https://github.com/neitanod/forceutf8
 */
require_once 'Encoding.php';
/**
 * @see https://github.com/boudinfl/taln-archives
 */
$path = './input_taln_file.bib';
$encode = new Encoding();
$content = $encode->toUTF8(loadFile($path));
$articles = parseBibTex($content);
foreach ($articles as $article) {
    $authors = parseAuthors($article);
    $url = parseUrl($article);
    $ScholarUrlsResult = getLinksOfScholarResult(googleScholarResearch($authors));
    $SERPUrlsResult = getLinksOfGoogleResult(launchGoogleRequestAndGetResults($authors));
    writeFile(basename($path), $url, $ScholarUrlsResult, $SERPUrlsResult);
}
/* * ***********************
 *      FUNCTIONS
 * *********************** */
function googleScholarResearch($authors)
{
    $url = 'https://scholar.google.fr/scholar?hl=fr&q=' . rawurlencode($authors);
    $content = file_get_contents($url);
开发者ID:leloulight,项目名称:Cross-Language-Dataset,代码行数:31,代码来源:parse_conf_papers_bibtex.php


示例17: get_license

function get_license($sequence_of_image, $license_num)
{
    global $license_names_array;
    // load unique license data
    $current_user = wp_get_current_user();
    $license_unique_number = $_GET['sessionid'] . "_" . $_SESSION['nzshpcrt_cart'][$sequence_of_image]->product_id;
    $agreement_number = $license_unique_number;
    //uniqid();
    $agreement_date = date("m.d.y");
    $customer_name = $current_user->last_name . " " . $current_user->first_name;
    if (trim($customer_name) == '') {
        if (isset($_SESSION['collected_data'])) {
            $customer_name_from_form = trim($_SESSION['collected_data'][1]) . " " . trim($_SESSION['collected_data'][2]);
            $customer_name = $customer_name_from_form;
        }
    }
    //echo("<pre>".print_r($current_user,true)."</pre>");
    //echo("<pre>".print_r($_SESSION['nzshpcrt_cart'],true)."</pre>");
    //echo("<pre>".print_r($_SESSION['collected_data'],true)."</pre>");
    if (isset($_SESSION['collected_data'][5]) && trim($_SESSION['collected_data'][5]) != '') {
        $media_name = "«" . trim($_SESSION['collected_data'][5]) . "»";
    } elseif (isset($current_user->user_description) && $current_user->user_description != '') {
        $media_name = "«" . $current_user->user_description . "»";
    } else {
        $media_name = "[не указано]";
    }
    if (isset($current_user->discount)) {
        $_discount = $current_user->discount;
    } else {
        $_discount = 0;
    }
    if (isset($_SESSION['nzshpcrt_cart'])) {
        $price = $_SESSION['nzshpcrt_cart'][$sequence_of_image]->price;
        if (isset($current_user->discount)) {
            $price = round($price * (100 - $_discount) / 100);
        }
        $image_name = $_SESSION['nzshpcrt_cart'][$sequence_of_image]->name;
        $image_number = $_SESSION['nzshpcrt_cart'][$sequence_of_image]->product_id;
        $author_name = $_SESSION['nzshpcrt_cart'][$sequence_of_image]->author;
    }
    //load License template
    $filename = '';
    //pokazh($license_num,"license_num");
    switch ($license_num) {
        case 1:
            $filename = getcwd() . "/wp-content/plugins/wp-shopping-cart/" . "license_limited_template.htm";
            break;
        case 2:
            $filename = getcwd() . "/wp-content/plugins/wp-shopping-cart/" . "license_standard_template.htm";
            break;
        case 3:
            $filename = getcwd() . "/wp-content/plugins/wp-shopping-cart/" . "license_extended_template.htm";
            break;
        default:
            $filename = getcwd() . "/wp-content/plugins/wp-shopping-cart/" . "license_limited_template.htm";
            break;
    }
    if (isset($current_user) && $current_user->ID == 106) {
        $content = "<div style='color:red;'>Демонстрационная лицензия</div>";
        $content .= loadFile($filename);
    } else {
        $content = loadFile($filename);
    }
    if (isset($current_user) && $current_user->ID == 106) {
        $agreement_number = "XXXXXXX";
        $customer_name = "Демо-пользователь";
        $image_number = "XXXX-номер изображения";
        $image_name = "Название рисунка";
        $author_name = "Имя автора";
        $media_name = "Название компании покупателя";
        $price = "XXX-Цена";
    }
    // replace placeholders
    $content = str_replace('#agreement_number#', $agreement_number, $content);
    $content = str_replace('#agreement_date#', $agreement_date, $content);
    $content = str_replace('#customer_name#', $customer_name, $content);
    $content = str_replace('#image_number#', $image_number, $content);
    $content = str_replace('#image_name#', $image_name, $content);
    $content = str_replace('#author_name#', $author_name, $content);
    $content = str_replace('#media_name#', $media_name, $content);
    $content = str_replace('#price#', $price, $content);
    // save_license
    $license_filename = $agreement_number . ".htm";
    save_license($content, $license_filename);
    $license_names_array[] = $license_filename;
    // output content
    return $content;
}
开发者ID:laiello,项目名称:cartonbank,代码行数:88,代码来源:al_cart_function.php


示例18: exit

<?php

if (!defined('MAC_ROOT')) {
    exit('Access Denied');
}
if ($method != '') {
    $m = be('get', 'm');
    $f = $method;
    $s = substr($m, strpos($m, '.'), strlen($m) - strpos($m, '.'));
    $path = MAC_ROOT_TEMPLATE . '/label_' . $f . $s;
    if (($s == '.html' || $s == '.htm' || $s == '.xml' || $s == '.js') && @file_exists($path)) {
        $tpl->P['cp'] = 'app';
        $tpl->P['cn'] = $m . $tpl->P['pg'];
        echoPageCache($tpl->P['cp'], $tpl->P['cn']);
        $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
        $tpl->H = loadFile($path);
        $tpl->mark();
        $tpl->pageshow();
    } else {
        showErr('System', '未找到指定自定义页面');
    }
} else {
    showErr('System', '未找到指定系统模块');
}
开发者ID:klarclm,项目名称:sgv,代码行数:24,代码来源:label.php


示例19: exec

 /**
  * Loads and runs a PHP file, searching for it on the include path, stripping the BOM (if one is present) and throwing
  * catchable exceptions instead of fatal errors.
  *
  * @param string $filename
  * @return mixed|null The value returned from the executed code, or `null` if no `return` is called.
  */
 static function exec($filename)
 {
     $code = loadFile($filename);
     if (!$code) {
         throw new RuntimeException("Can't load file {$filename}", 1);
     }
     if (!self::validate($code, $out)) {
         throw new RuntimeException("Failed executing file {$filename}.\n\n{$out}", 2);
     }
     return self::catchErrorsOn(function () use($code) {
         self::run($code);
     });
 }
开发者ID:php-kit,项目名称:tools,代码行数:20,代码来源:php-code.php


示例20: createView

 protected function createView()
 {
     $prop = $this->props;
     $ctx = $this->context;
     $controller = $prop->class;
     // Resolve controller for the view (if applicable).
     if (!exists($controller) && exists($prop->view)) {
         $controller = $ctx->findControllerForView($prop->view);
     }
     if (exists($prop->template)) {
         if (exists($controller)) {
             $subComponent = $this->makeShadowController($controller, $prop);
             $subComponent->template = $prop->template;
             $this->setShadowDOM($subComponent);
         } else {
             $this->template = $prop->template;
         }
     } elseif (exists($prop->view)) {
         if (exists($controller)) {
             $subComponent = $this->makeShadowController($controller, $prop);
             $subComponent->templateUrl = $prop->view;
             $this->setShadowDOM($subComponent);
         } else {
             $this->templateUrl = $prop->view;
         }
     } else {
         if (exists($prop->file)) {
             $fileContent = loadFile($prop->file);
             if ($fileContent === false) {
                 throw new FileIOException($prop->file, 'read', explode(PATH_SEPARATOR, get_include_path()));
             }
             echo $fileContent;
             return;
         } else {
             if ($prop->styles) {
                 $ctx->getAssetsService()->outputStyles();
                 return;
             } else {
                 if ($prop->scripts) {
                     $ctx->getAssetsService()->outputScripts();
                     return;
                 }
             }
         }
     }
     parent::createView();
 }
开发者ID:electro-modules,项目名称:matisse,代码行数:47,代码来源:Include_.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP loadFunction函数代码示例发布时间:2022-05-15
下一篇:
PHP loadEmailTemplate函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap