當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileHelper::createFile方法代碼示例

本文整理匯總了PHP中FileHelper::createFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileHelper::createFile方法的具體用法?PHP FileHelper::createFile怎麽用?PHP FileHelper::createFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FileHelper的用法示例。


在下文中一共展示了FileHelper::createFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

 FileHelper::foldercheck($folderusersmodulestmptmpl);
 // Create files
 $modulelines = ModuleHelper::modulefile($varObject);
 $xmllines = ModuleHelper::modulexml($varObject);
 $helperlines = ModuleHelper::helperfile($varObject);
 $defaultlines = ModuleHelper::defaultfile($varObject);
 // Set filenames
 $indexfile = 'index.html';
 $modulefile = $folderusersmodulestmp . 'mod_' . $varObject->filename . '.php';
 $xmlfile = $folderusersmodulestmp . 'mod_' . $varObject->filename . '.xml';
 $helperfile = $folderusersmodulestmp . 'helper.php';
 $defaultfile = $folderusersmodulestmptmpl . 'default.php';
 $totallinescreated[] = FileHelper::createFile($modulefile, $modulelines);
 $totallinescreated[] = FileHelper::createFile($xmlfile, $xmllines);
 $totallinescreated[] = FileHelper::createFile($helperfile, $helperlines);
 $totallinescreated[] = FileHelper::createFile($defaultfile, $defaultlines);
 // Zip Files
 $filestozip[] = $modulefile;
 $filestozip[] = $xmlfile;
 $filestozip[] = $helperfile;
 $filestozip[] = $defaultfile;
 $indexlines[] = Files::indexFile();
 // Can't go into tmp directory!
 $totallinescreated[] = FileHelper::createfile($folderusersmodules . $indexfile, $indexlines);
 $indexpaths[] = $folderusersmodulestmp . $indexfile;
 $indexpaths[] = $folderusersmodulestmptmpl . $indexfile;
 // Create index files under all paths
 foreach ($indexpaths as $indexpath) {
     $totallinescreated[] = FileHelper::createfile($indexpath, $indexlines);
     $filestozip[] = $indexpath;
 }
開發者ID:calebnance,項目名稱:black-rabbit-os,代碼行數:31,代碼來源:module-create.php

示例2: foreach

     $filestozip[] = $sqluninstallfile;
     $filestozip[] = $sqlupdatesmysqlfile;
 }
 // end - added v.0.6.0
 $filestozip[] = $helperfile;
 $filestozip[] = $languagefile;
 $filestozip[] = $languagesysfile;
 $filestozip[] = $cssfile;
 $filestozip[] = $jsfile;
 // Site files
 $totallinescreated[] = FileHelper::createFile($sitecomponentfile, $sitecomponentlines);
 $totallinescreated[] = FileHelper::createFile($sitecontrollerfile, $sitecontrollerlines);
 $totallinescreated[] = FileHelper::createFile($siterouterfile, $siterouterlines);
 $totallinescreated[] = FileHelper::createFile($sitehelperfile, $sitehelperlines);
 $totallinescreated[] = FileHelper::createFile($sitecssfile, "");
 $totallinescreated[] = FileHelper::createFile($sitejsfile, "");
 $filestozip[] = $sitecomponentfile;
 $filestozip[] = $sitecontrollerfile;
 $filestozip[] = $siterouterfile;
 $filestozip[] = $sitehelperfile;
 $filestozip[] = $sitecssfile;
 $filestozip[] = $sitejsfile;
 /**
  *	Lines created calculate
  */
 $totallinescalculated = 0;
 foreach ($totallinescreated as $totallineseach) {
     $totallinescalculated = $totallinescalculated + $totallineseach;
 }
 // 15 seconds per line - round up or down..
 $totaltimesaved = round($totallinescalculated / 4 / 60);
開發者ID:calebnance,項目名稱:black-rabbit-os,代碼行數:31,代碼來源:create.php


注:本文中的FileHelper::createFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。