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


PHP file::write方法代码示例

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


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

示例1: file

 /**
  * 复制单个镜相文件
  * @param $resource 原文件
  * @param $dest 目标文件
  * @param $data 需要替换的内容
  */
 public function file($resource, $dest, $data = [])
 {
     $code = file_get_contents($this->_tpldir . $resource);
     $othur = $this->_devauthor();
     foreach ($othur as $k => $v) {
         $code = str_replace($k, $v, $code);
         //替换开发者变量信息
     }
     $code = str_replace($data['search'], $data['replace'], $code);
     //替换变量信息
     return file::write($dest, $code);
 }
开发者ID:ybluesky,项目名称:h2o,代码行数:18,代码来源:Image.php

示例2: runtime

 public static function runtime()
 {
     if (!is_file(ZOTOP_RUNTIME . DS . '~runtime.php')) {
         $registers = zotop::register();
         $content = array();
         $content[] = '<?php';
         foreach ($registers as $file) {
             $content[] = file::compile($file);
         }
         $content[] = '?>';
         file::write(ZOTOP_RUNTIME . DS . '~runtime.php', implode("\n", $content));
     }
     //缓存配置文件
     zotop::data(ZOTOP_RUNTIME . DS . '~config.php', zotop::config());
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:15,代码来源:application.php

示例3: hook

 public static function hook()
 {
     //打包全部hook
     $hooks = array();
     $modules = zotop::data('module');
     foreach ($modules as $module) {
         $path = $module['path'] . DS . 'hook';
         $path = path::decode($path);
         $hook = (array) dir::files($path, '', true, true);
         $hooks = array_merge($hooks, $hook);
     }
     $content = runtime::compile($hooks);
     if (!empty($content)) {
         file::write(ZPATH_RUNTIME . DS . 'hook.php', $content, true);
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:16,代码来源:runtime.php

示例4: run

 /**
  * 运行时执行,并加载相关文件
  */
 public static function run()
 {
     //打包配置文件
     zotop::data(ZOTOP_PATH_RUNTIME . DS . 'config.php', zotop::config());
     //打包全部hook文件
     $hooks = runtime::compile(runtime::$hooks);
     if (!empty($hooks)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '_hooks.php', $hooks, true);
     }
     //加载hooks以便核心文件使用
     zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '_hooks.php');
     //打包核心文件
     $libraries = zotop::register();
     $libraries = runtime::compile($libraries);
     if (!empty($libraries)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '.php', $libraries, true);
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:21,代码来源:runtime.php

示例5: build

 /**
  * 运行时执行,并加载相关文件
  */
 public static function build()
 {
     runtime::config();
     runtime::library();
     runtime::hooks();
     //打包配置文件
     zotop::data(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.config.php', zotop::config());
     //打包全部hook文件
     $hooks = runtime::compile(runtime::$hooks);
     if (!empty($hooks)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.hooks.php', $hooks, true);
     }
     //加载hooks以便核心文件使用
     zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.hooks.php');
     //打包核心文件
     $libraries = zotop::register();
     $libraries = runtime::compile($libraries);
     if (!empty($libraries)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.core.php', $libraries, true);
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:24,代码来源:runtime.php

示例6: actionEdit

 public function actionEdit($file = '')
 {
     $file = empty($file) ? zotop::get('file') : $file;
     $file = trim(url::decode($file), '/');
     $filepath = ZOTOP_PATH_ROOT . DS . str_replace('/', DS, $file);
     if (form::isPostBack()) {
         $content = request::post('source');
         $content = trim($content);
         if (empty($content)) {
             msg::error('内容为空,无法保存!');
         }
         file::write($filepath, trim($content));
         msg::success('内容保存成功!');
     }
     $filecontent = file::read($filepath);
     $page = new dialog();
     $page->title = '文件编辑器';
     $page->set('file', $file);
     $page->set('filepath', $filepath);
     $page->set('filecontent', $filecontent);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:22,代码来源:file.php

示例7: actionEdit

 public function actionEdit($file)
 {
     $filepath = realpath(ZOTOP_PATH_ROOT . DS . trim($file, '/'));
     if (empty($file)) {
         return false;
     }
     if (form::isPostBack()) {
         $content = request::post('source');
         $content = trim($content);
         if (empty($content)) {
             msg::error('内容为空,无法保存!');
         }
         file::write($filepath, trim($content));
         msg::success('内容保存成功!');
     }
     $content = file::read($filepath);
     $page = new dialog();
     $page->title = '文件编辑器';
     $page->set('file', $file);
     $page->set('filepath', $filepath);
     $page->set('content', $content);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:23,代码来源:file.php

示例8: end

 /**
  * Save the output with the setting passed by the last call from start,
  * and show it
  *
  * @return bool True if store cache success
  * @see start
  */
 public function end()
 {
     $ret = null;
     if (!empty($this->prmOut)) {
         $content = ob_get_contents();
         ob_end_clean();
         if ($this->obSave) {
             echo $this->obSave . $content;
             ob_start();
         } else {
             echo $content;
         }
         $ret = file::write($this->prmOut['file'], $content);
     }
     $this->prmOut = null;
     return $ret;
 }
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:24,代码来源:file.class.php

示例9: actionNewfile

 public function actionNewfile($dir = '')
 {
     $dir = empty($dir) ? zotop::get('dir') : $dir;
     $dir = trim(url::decode($dir), '/');
     $file = 'newfile.php';
     if (form::isPostBack()) {
         $file = zotop::post('name');
         $title = zotop::post('title');
         $description = zotop::post('description');
         $filepath = site::template($dir . DS . $file);
         $filecontent = "<?php\r\n/**\r\n * title:{$title}\r\n * description:{$description}\r\n*/\r\n?>";
         if (file::exists($filepath)) {
             msg::error(zotop::t('新建失败,当前目录已经存在文件:{$file}', array('file' => $file)));
         }
         if (file::write($filepath, $filecontent)) {
             msg::success('新建文件成功');
         }
         msg::error('新建文件失败');
     }
     $page = new dialog();
     $page->title = zotop::t('模板编辑器');
     $page->set('dir', $dir);
     $page->set('file', $file);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:25,代码来源:template.php

示例10: reboot

 /**
  * 应用程序重启
  *
  *
  * @return null
  */
 public static function reboot()
 {
     //清理运行时文件
     folder::clear(ZOTOP_PATH_RUNTIME);
     //加载全部配置
     zotop::config(@(include ZOTOP_PATH_DATA . DS . 'config.php'));
     zotop::config('zotop.database', @(include ZOTOP_PATH_DATA . DS . 'database.php'));
     zotop::config('zotop.application', @(include ZOTOP_PATH_DATA . DS . 'application.php'));
     zotop::config('zotop.module', @(include ZOTOP_PATH_DATA . DS . 'module.php'));
     zotop::config('zotop.router', @(include ZOTOP_PATH_DATA . DS . 'router.php'));
     zotop::register(@(include ZOTOP_PATH_MODULES . DS . 'system' . DS . 'libraries.php'));
     zotop::register(@(include ZOTOP_PATH_APPLICATION . DS . 'libraries.php'));
     //加载全部开启模块的hook以及注册类文件
     $modules = zotop::config('zotop.module');
     foreach ((array) $modules as $module) {
         if ((int) $module['status'] >= 0 && folder::exists($module['path'])) {
             //加载库文件
             zotop::register(@(include path::decode($module['path']) . DS . 'libraries.php'));
             //加载hook文件
             application::$hooks[] = $module['path'] . DS . 'hooks' . DS . ZOTOP_APPLICATION . '.php';
         }
     }
     //打包配置文件
     zotop::data(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.config.php', zotop::config());
     //打包hook文件
     file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.hooks.php', application::compile(application::$hooks), true);
     //加载hooks以便核心文件使用
     zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.hooks.php');
     //打包类文件
     file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.core.php', application::compile(zotop::register()), true);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:37,代码来源:admin.core.php

示例11: init

$f->add(new init(array("XYZ" => array(2.45, 4.35, 0.65), "DX" => 0.1, "PART_ID" => "ignitor particle", "N_PARTICLES" => 3)));
//Vents
$f->add(new vent(array("mb" => "xmin", "surf_id" => "open")));
$f->add(new vent(array("mb" => "xmax", "surf_id" => "open")));
$f->add(new vent(array("mb" => "ymin", "surf_id" => "open")));
//Boundary Files
$f->add(new bndf(array("QUANTITY" => "RADIATIVE HEAT FLUX")));
$f->add(new bndf(array("QUANTITY" => "CONVECTIVE HEAT FLUX")));
$f->add(new bndf(array("QUANTITY" => "NET HEAT FLUX")));
$f->add(new bndf(array("QUANTITY" => "WALL TEMPERATURE")));
$f->add(new bndf(array("QUANTITY" => "BURNING RATE")));
//Slice Files
$f->add(new slcf(array("PBX" => 2.5, "QUANTITY" => "TEMPERATURE", "VECTOR" => TRUE, "CELL_CENTERED" => TRUE)));
$f->add(new slcf(array("PBX" => 2.5, "QUANTITY" => "HRRPUV", "CELL_CENTERED" => TRUE)));
$f->add(new slcf(array("PBX" => 2.5, "QUANTITY" => "RADIATION LOSS", "CELL_CENTERED" => TRUE)));
$f->add(new slcf(array("PBX" => 2.5, "QUANTITY" => "VISCOSITY", "CELL_CENTERED" => TRUE)));
$f->add(new slcf(array("PBY" => 4.4, "QUANTITY" => "TEMPERATURE", "VECTOR" => TRUE, "CELL_CENTERED" => TRUE)));
$f->add(new slcf(array("PBY" => 4.4, "QUANTITY" => "HRRPUV", "CELL_CENTERED" => TRUE)));
$f->add(new slcf(array("PBY" => 4.4, "QUANTITY" => "RADIATION LOSS", "CELL_CENTERED" => TRUE)));
//Devices
$f->add(new devc(array("XYZ" => array(2.55, 4.4, 0.75), "QUANTITY" => "WALL TEMPERATURE", "IOR" => -2, "ID" => "temp")));
$f->add(new devc(array("XYZ" => array(2.55, 4.4, 0.75), "QUANTITY" => "BURNING RATE", "IOR" => -2, "ID" => "burn")));
$f->add(new devc(array("XYZ" => array(2.55, 4.4, 0.75), "QUANTITY" => "RADIATIVE HEAT FLUX", "IOR" => -2, "ID" => "rad")));
$f->add(new devc(array("XYZ" => array(2.55, 4.4, 0.75), "QUANTITY" => "GAUGE HEAT FLUX", "IOR" => -2, "ID" => "gauge")));
$f->add(new devc(array("XYZ" => array(2.55, 4.4, 0.75), "QUANTITY" => "CONVECTIVE HEAT FLUX", "IOR" => -2, "ID" => "con")));
$f->add(new devc(array("XYZ" => array(2.55, 4.35, 0.75), "QUANTITY" => "TEMPERATURE", "ID" => "gas")));
$f->add(new devc(array("XYZ" => array(2.55, 4.35, 0.75), "QUANTITY" => "HRRPUV", "ID" => "hrrpuv")));
$f->add(new devc(array("XYZ" => array(2.55, 4.35, 0.75), "QUANTITY" => "RADIATION LOSS", "ID" => "qr")));
$f->add(new devc(array("XYZ" => array(2.55, 4.35, 0.75), "QUANTITY" => "INTEGRATED INTENSITY", "ID" => "U")));
$f->write();
开发者ID:briancohan,项目名称:FDSGeoSim,代码行数:30,代码来源:couch.php

示例12: createSesssionFile

 public static function createSesssionFile($name, $ext, $content)
 {
     $name = self::createFileName($name);
     $file = self::$sessionFolder . "/" . $name . $ext;
     if (!file_exists($file)) {
         touch($file);
         chmod($file, 0777);
         file::write($file, $content, false);
     } else {
         file::write($file, $content, false);
     }
     return $file;
 }
开发者ID:vahitserifsaglam1,项目名称:ozsa-src,代码行数:13,代码来源:Session.php

示例13: generateFiles

 /**
  * Generate an XML files and save them to the root directory
  * @param array
  */
 protected function generateFiles($arrArchive)
 {
     $this->import('Database');
     $time = time();
     $strType = $arrArchive['format'] == 'atom' ? 'generateAtom' : 'generateRss';
     $strLink = $arrArchive['feedBase'] != '' ? $arrArchive['feedBase'] : $this->Environment->base;
     $strFile = $arrArchive['feedName'];
     $objFeed = new \Feed($strFile);
     $objFeed->link = $strLink;
     $objFeed->title = $arrArchive['title'];
     $objFeed->description = $arrArchive['description'];
     $objFeed->language = $arrArchive['language'];
     $objFeed->published = $arrArchive['tstamp'];
     // Get items
     $objArticleStmt = $this->Database->prepare("SELECT *, (SELECT name FROM tl_user u WHERE u.id=p.author) AS authorName FROM tl_photoalbums2_album p WHERE pid=? AND (start='' OR start<{$time}) AND (stop='' OR stop>{$time}) AND published=1 ORDER BY sorting ASC");
     if ($arrArchive['maxItems'] > 0) {
         $objArticleStmt->limit($arrArchive['maxItems']);
     }
     $objArticle = $objArticleStmt->execute($arrArchive['id']);
     // Get the default URL
     $objParent = \PageModel::findByPk($arrArchive['modulePage']);
     if ($objParent == null) {
         return;
     }
     $objParent = $this->getPageDetails($objParent->id);
     $strUrl = $this->generateFrontendUrl($objParent->row(), $GLOBALS['TL_CONFIG']['useAutoItem'] ? '/%s' : '/album/%s', $objParent->language);
     // Parse items
     if ($objArticle !== null) {
         while ($objArticle->next()) {
             // Deserialize image arrays
             $objArticle->images = deserialize($objArticle->images);
             $objArticle->imageSort = deserialize($objArticle->imageSort);
             // Sort images
             $objPa2ImageSorter = new \Pa2ImageSorter($objArticle->imageSortType, $objArticle->images, $objArticle->imageSort);
             $this->arrImages = $objPa2ImageSorter->getSortedUuids();
             $objItem = new \FeedItem();
             $objItem->title = $objArticle->title;
             $objItem->link = sprintf($strLink . $strUrl, $objArticle->alias != '' && !$GLOBALS['TL_CONFIG']['disableAlias'] ? $objArticle->alias : $objArticle->id);
             $objItem->published = $objArticle->startdate;
             $objItem->author = $objArticle->authorName;
             if (is_array($objArticle->arrImages) && count($objArticle->arrImages) > 0) {
                 foreach ($objArticle->arrImages as $image) {
                     if (is_file(TL_ROOT . '/' . $image)) {
                         $objItem->addEnclosure($image);
                     }
                 }
             }
             $objItem->description = $this->replaceInsertTags($objArticle->description);
             $objFeed->addItem($objItem);
         }
     }
     // Create file
     $objRss = new \file($strFile . '.xml');
     $objRss->write($this->replaceInsertTags($objFeed->{$strType}()));
     $objRss->close();
 }
开发者ID:craffft,项目名称:contao-photoalbums2,代码行数:60,代码来源:Pa2.php


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