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


PHP files::write方法代码示例

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


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

示例1: siteMap

    function siteMap()
    {
        db::table('pages');
        db::where('site_id', ADMIN_SITE_ID);
        db::where('page_map', '1');
        db::where('page_dynamic', '0');
        $res = db::select();
        $content = '';
        while ($row = mysql_fetch_assoc($res)) {
            $content .= '
<url>
	<loc>http://' . ADMIN_SITE . $row['page_folder'] . '</loc>
	<lastmod>' . substr($row['page_date'], 0, 10) . '</lastmod>
</url>';
        }
        $xml = '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">' . $content . '
</urlset>';
        if (files::write(ROOT . '/sitemap.xml', $xml)) {
            buffer::set('sitemap.xml успешно создан.');
        } else {
            buffer::set('Не удалось записать sitemap.xml.');
        }
    }
开发者ID:rigidus,项目名称:ea,代码行数:27,代码来源:map.module.php

示例2: save

 function save()
 {
     $array = file(ROOT . '/config.php');
     $content = '';
     foreach ($array as $k => $v) {
         if (strstr($v, '#system_style')) {
             $array[$k] = "define('SYS_STYLE', '" . params::get('system_style') . "'); #system_style\r\n";
         }
         if (strstr($v, '#system_lang')) {
             $array[$k] = "define('LANG_INDEX', '" . params::get('system_lang') . "'); #system_lang\r\n";
         }
         if (strstr($v, '#global_cache')) {
             if (params::get('global_cache')) {
                 $array[$k] = "define('GLOBAL_CACHE', true); #global_cache\r\n";
             } else {
                 $array[$k] = "define('GLOBAL_CACHE', false); #global_cache\r\n";
             }
         }
         if (strstr($v, '#global_time')) {
             $array[$k] = "define('GLOBAL_CACHE_TIME', " . params::get('global_cache_time') . "); #global_time\r\n";
         }
         $content .= $array[$k];
     }
     files::write(ROOT . '/config.php', $content);
     headers::self();
 }
开发者ID:rigidus,项目名称:ea,代码行数:26,代码来源:settings.module.php

示例3: save

 function save()
 {
     $content = ob_get_contents();
     ob_clean();
     files::write(self::$file, $content);
     echo $content;
 }
开发者ID:rigidus,项目名称:ea,代码行数:7,代码来源:cache.php

示例4: write

 function write($array = false, $file = false, $sections = true)
 {
     if (!$file) {
         $file = self::$file;
     }
     if (!$array) {
         $array = self::$ini;
     }
     $string = '';
     if ($sections) {
         foreach (array_keys($array) as $key) {
             $string .= '[' . $key . "]\r\n";
             $string .= self::_write($array[$key], '') . "\r\n";
         }
     } else {
         foreach ($array as $k => $v) {
             $string .= self::__write($k, $v) . "\r\n";
         }
     }
     files::write($file, $string);
 }
开发者ID:rigidus,项目名称:ea,代码行数:21,代码来源:ini.php

示例5: restoreVersion

 function restoreVersion($app, $tmpl_file, $version_id)
 {
     db::table('templates_versions');
     db::where('version_id', $version_id);
     $row = db::assoc();
     $rows = db::rows();
     $code = stripslashes($row['version_code']);
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
     header("Content-Type: text/plain; charset=UTF-8");
     files::write($file, $code);
     if ($rows != 0) {
         self::deleteVersion($version_id);
     }
     router::delQs('restore');
     headers::selfQs();
 }
开发者ID:rigidus,项目名称:ea,代码行数:16,代码来源:apps.module.php

示例6: _save

 function _save()
 {
     $tmpl_file = params::get('tmpl_file');
     $tmpl_id = params::get('tmpl_id');
     if (empty($tmpl_file)) {
         $tmpl_file = 'tmpl' + $tmpl_id + '.html';
     }
     db::table('templates');
     db::where('tmpl_id', $tmpl_id);
     db::update(array('tmpl_pub' => '1', 'tmpl_name' => params::get('tmpl_name'), 'tmpl_file' => $tmpl_file));
     /*
     	Code write
     */
     $code = stripslashes(params::get('tmpl_code'));
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $tmpl_file;
     header("Content-Type: text/plain; charset=UTF-8");
     files::write($file, $code);
     $allPages = params::get('allPages');
     $pages = params::get('pages');
     if ($allPages !== false) {
         db::table('pages');
         db::where('site_id', ADMIN_SITE_ID);
         db::update('tmpl_id', $tmpl_id);
     } else {
         if ($pages) {
             foreach ($pages as $v) {
                 db::table('pages');
                 db::where('page_id', $v);
                 db::update('tmpl_id', $tmpl_id);
             }
         }
     }
     if (events::detect('save')) {
         self::saveVersion($tmpl_id, $code);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:36,代码来源:main.module.php


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