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


PHP File::putFileContents方法代码示例

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


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

示例1: saveRules

 private static function saveRules($siteId, array $arUrlRewrite)
 {
     $site = SiteTable::getRow(array("filter" => array("LID" => $siteId)));
     $docRoot = $site["DOC_ROOT"];
     if (!empty($docRoot)) {
         $docRoot = IO\Path::normalize($docRoot);
     } else {
         $docRoot = Application::getDocumentRoot();
     }
     $data = var_export($arUrlRewrite, true);
     IO\File::putFileContents($docRoot . "/urlrewrite.php", "<" . "?php\n\$arUrlRewrite=" . $data . ";\n");
     Application::resetAccelerator();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:urlrewriter.php

示例2: clearLogFile

 public function clearLogFile()
 {
     $logDir = $this->getLogFileDir();
     if (!Main\IO\Directory::isDirectoryExists($logDir)) {
         Main\IO\Directory::createDirectory($logDir);
     }
     $logFile = $this->getLogFilePath();
     Main\IO\File::putFileContents($logFile, '');
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:process.php

示例3: bindTemplate

 /**
  * Binds (and creates if it's necessary) template to the application folder
  *
  * @param $templateId - symbolic code of the template
  * @param $folder - the application folder
  * @param bool $createNew - flag of the necessity of creating a new template
  */
 public static function bindTemplate($templateId, $folder, $createNew)
 {
     $arFields = array("TEMPLATE" => array());
     if ($createNew) {
         CopyDirFiles(Application::getDocumentRoot() . "/bitrix/modules/mobileapp/templates/default_app/", Application::getDocumentRoot() . "/bitrix/templates/" . $templateId, True, True);
         File::putFileContents(Application::getDocumentRoot() . "/bitrix/templates/" . $templateId . "/description.php", str_replace(array("#mobile_template_name#"), array($templateId), File::getFileContents(Application::getDocumentRoot() . "/bitrix/templates/" . $templateId . "/description.php")));
         $arFields["TEMPLATE"][] = array("SORT" => 1, "CONDITION" => "CSite::InDir('/" . $folder . "/')", "TEMPLATE" => $templateId);
     }
     $default_site_id = \CSite::GetDefSite();
     if ($default_site_id) {
         $dbTemplates = \CSite::GetTemplateList($default_site_id);
         $arFields["LID"] = $default_site_id;
         $isTemplateFound = false;
         while ($template = $dbTemplates->Fetch()) {
             $arFields["TEMPLATE"][] = array("TEMPLATE" => $template['TEMPLATE'], "SORT" => $template['SORT'], "CONDITION" => $template['CONDITION']);
             if ($template["TEMPLATE"] == $templateId && !$createNew && !$isTemplateFound) {
                 $isTemplateFound = true;
                 $arFields["TEMPLATE"][] = array("SORT" => 1, "CONDITION" => "CSite::InDir('/" . $folder . "/')", "TEMPLATE" => $templateId);
             }
         }
         $obSite = new \CSite();
         $obSite->Update($default_site_id, $arFields);
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:manager.php

示例4: update

 /**
  * @param $templateName
  * @param $html
  * @return bool|int
  */
 public static function update($templateName, $html)
 {
     $result = false;
     $fullPathOfFile = \Bitrix\Main\Loader::getLocal(static::LOCAL_DIR_TMPL . bx_basename($templateName) . '.php');
     if ($fullPathOfFile) {
         $result = File::putFileContents($fullPathOfFile, $html);
     }
     return $result;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:14,代码来源:template.php

示例5: configureLicenseKey

 /**
  * Sets license key Bitrix CMS.
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @param string $licenseKey
  */
 protected function configureLicenseKey(InputInterface $input, OutputInterface $output, $licenseKey)
 {
     if (!is_string($licenseKey)) {
         throw new \InvalidArgumentException('Config "licenseKey" must be string type.');
     }
     $licenseFileContent = "<" . "? \$" . "LICENSE_KEY = \"" . EscapePHPString($licenseKey) . "\"; ?" . ">";
     File::putFileContents(Application::getDocumentRoot() . BX_ROOT . '/license_key.php', $licenseFileContent);
 }
开发者ID:notamedia,项目名称:console-jedi,代码行数:15,代码来源:InitCommand.php

示例6: writeFileLog

 /**
  * Writes query text and part of backtrace into log file.
  *
  * @param string $sql Query to be dumped.
  * @param float $executionTime Query time.
  * @param string $additional Additional info string to be added to header.
  * @param integer $traceSkip How many backtrace frames to skip in output.
  *
  * @return void
  * @see \Bitrix\Main\Diag\SqlTracker->startFileLog
  * @see \Bitrix\Main\Diag\SqlTracker->stopFileLog
  */
 public function writeFileLog($sql, $executionTime = 0.0, $additional = "", $traceSkip = 2)
 {
     if ($this->logFilePath) {
         $header = "TIME: " . round($executionTime, 6) . " SESSION: " . session_id() . " " . $additional . "\n";
         $headerLength = strlen($header);
         $body = $this->formatSql($sql);
         $trace = $this->formatTrace(\Bitrix\Main\Diag\Helper::getBackTrace($this->depthBackTrace, null, $traceSkip));
         $footer = str_repeat("-", $headerLength);
         $message = "\n" . $header . "\n" . $body . "\n\n" . $trace . "\n" . $footer . "\n";
         \Bitrix\Main\IO\File::putFileContents($this->logFilePath, $message, \Bitrix\Main\IO\File::APPEND);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:24,代码来源:sqltracker.php


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