示例#1
0
文件: Core.plugin.php 项目: davbfr/cf
 public function update()
 {
     if (Cli::getOption("a")) {
         $cf_dir = "\"" . realpath(CF_DIR) . "\"";
     } else {
         $cf_dir = "ROOT_DIR . \"/" . System::relativePath(System::absPath(ROOT_DIR), System::absPath(CF_DIR)) . "\"";
     }
     Cli::pinfo(" * Create paths.php");
     Logger::Debug("CF dir is {$cf_dir}");
     Logger::Debug("ROOT dir is " . ROOT_DIR);
     $content = "<?php // DO NOT MODIFY THIS FILE, IT IS GENERATED BY setup update SCRIPT\n\n";
     $content .= "@define(\"ROOT_DIR\", \"" . ROOT_DIR . "\");\n";
     $content .= "@define(\"CF_DIR\", {$cf_dir});\n";
     file_put_contents(CONFIG_DIR . "/paths.php", $content);
 }