/** * Create sources */ public function dump() { /* dump project map */ $this->put('report/project_map.txt', ToolKit::dump($this->project)); /* import helpers and resources */ $this->import(['gitignore' => '.gitignore']); $this->import('koda_helper.h'); $this->import('koda_helper.c', true); /* dump main module C-file */ $this->file('php_' . $this->code, $this->extH(), $this->extC()); /* dump classes */ foreach ($this->project->classes as $class) { $this->file(str_replace('\\', '/', $class->name), $this->classH($class), $this->classC($class)); } /* generate config.m4 for unix-like system, see http://www.php.net/manual/en/internals2.buildsys.configunix.php */ $this->put('config.m4', $this->m4()); /* generate config.w32 for windows, see http://www.php.net/manual/en/internals2.buildsys.configwin.php */ $this->put('config.w32', $this->w32()); }
/** * Dump project to stdout * @return string */ public function getDump() { $project = \Koda\Project::composer($this->root); $project->scan(); return ToolKit::dump($project); }