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


PHP Website::getFileContents方法代码示例

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


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

示例1: loadFromFile

 public function loadFromFile($path)
 {
     if (Website::fileExists($path)) {
         $content = Website::getFileContents($path);
         $this->loadFromString($content);
     } else {
         new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>');
     }
 }
开发者ID:aottibia,项目名称:www,代码行数:9,代码来源:configlua.php

示例2: loadFromFile

 public function loadFromFile($path)
 {
     if (Website::fileExists($path)) {
         $content = Website::getFileContents($path);
         $this->loadedFromPath = $path;
         $lines = explode("\n", $content);
         unset($lines[0]);
         // remove <?php
         unset($lines[count($lines)]);
         // remove ? >
         $this->loadFromString(implode("\n", $lines));
     } else {
         WebsiteErrors::addError('#C-4', 'ERROR: <b>#C-4</b> : Class::ConfigPHP - PHP config file doesn\'t exist. Path: <b>' . $path . '</b>');
     }
 }
开发者ID:aottibia,项目名称:www,代码行数:15,代码来源:configphp.php

示例3: foreach

    }
    if (!empty($guild_errors)) {
        $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url(' . $layout_name . '/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
        foreach ($guild_errors as $guild_error) {
            $main_content .= '<li>' . $guild_error . '</li>';
        }
        $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div>  </div></div><br>';
        unset($todo);
    }
    if ($todo == 'save') {
        $new_guild = new Guild();
        $new_guild->setCreationData(time());
        $new_guild->setName($new_guild_name);
        $new_guild->setOwner($player);
        $new_guild->setDescription('New guild. Leader must edit this text :)');
        $new_guild->setGuildLogo('image/gif', Website::getFileContents('./images/default_guild_logo.gif'));
        $new_guild->save();
        $ranks = $new_guild->getGuildRanksList(true);
        foreach ($ranks as $rank) {
            if ($rank->getLevel() == 3) {
                $player->setRank($rank);
                $player->save();
            }
        }
        $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR=' . $config['site']['vdarkborder'] . '><TD CLASS=white><B>Create guild</B></TD></TR><TR BGCOLOR=' . $config['site']['darkborder'] . '><TD WIDTH=100%><b>Congratulations!</b><br/>You have created guild <b>' . htmlspecialchars($new_guild_name) . '</b>. <b>' . htmlspecialchars($player->getName()) . '</b> is leader of this guild. Now you can invite players, change picture, description and motd of guild. Press submit to open guild manager.</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild=' . $new_guild->getId() . '" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="' . $layout_name . '/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
    } else {
        $main_content .= 'To play on ' . $config['server']['serverName'] . ' you need an account. 
		All you have to do to create your new account is to enter your email address, password to new account, verification code from picture and to agree to the terms presented below. 
		If you have done so, your account number, password and e-mail address will be shown on the following page and your account and password will be sent 
		to your email address along with further instructions.<BR><BR>
		<FORM ACTION="?subtopic=guilds&action=createguild&todo=save" METHOD=post>
开发者ID:s3kk,项目名称:Gesior1.x,代码行数:31,代码来源:guilds.php


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