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); }
public function testAbsPath() { $this->assertEquals(System::absPath("one/../two"), 'two'); $this->assertEquals(System::absPath("one/./two"), 'one/two'); }