public function test_create_path() { $path = getcwd() . DIRECTORY_SEPARATOR . microtime(); $this->assertTrue(File::create_path($path)); File::delete_directory($path); }
/** * @return int * * @throws \Exception */ public function save() { // ensure path to output file exists File::create_path(dirname($this->filepath)); // save file and set permissions $saved = file_put_contents($this->filepath, $this->get_file_contents()); if ($saved) { chmod($this->filepath, 0777); } return $saved; }