8889841cclixcotz/mars.clix.co.tz/vendor/laravel/framework/src/Illuminate/Database/Console/DumpCommand.php000066600000005220150515612220030047 0ustar00homeconnection($database = $this->input->getOption('database')); $this->schemaState($connection)->dump( $connection, $path = $this->path($connection) ); $dispatcher->dispatch(new SchemaDumped($connection, $path)); $this->info('Database schema dumped successfully.'); if ($this->option('prune')) { (new Filesystem)->deleteDirectory( database_path('migrations'), $preserve = false ); $this->info('Migrations pruned successfully.'); } } /** * Create a schema state instance for the given connection. * * @param \Illuminate\Database\Connection $connection * @return mixed */ protected function schemaState(Connection $connection) { return $connection->getSchemaState() ->withMigrationTable($connection->getTablePrefix().Config::get('database.migrations', 'migrations')) ->handleOutputUsing(function ($type, $buffer) { $this->output->write($buffer); }); } /** * Get the path that the dump should be written to. * * @param \Illuminate\Database\Connection $connection */ protected function path(Connection $connection) { return tap($this->option('path') ?: database_path('schema/'.$connection->getName().'-schema.dump'), function ($path) { (new Filesystem)->ensureDirectoryExists(dirname($path)); }); } } home/clixcotz/fmi.clix.co.tz/vendor/nwidart/laravel-modules/src/Commands/DumpCommand.php000064400000002541150544444520025417 0ustar00info('Generating optimized autoload modules.'); if ($module = $this->argument('module')) { $this->dump($module); } else { foreach ($this->laravel['modules']->all() as $module) { $this->dump($module->getStudlyName()); } } return 0; } public function dump($module) { $module = $this->laravel['modules']->findOrFail($module); $this->line("Running for module: {$module}"); chdir($module->getPath()); passthru('composer dump -o -n -q'); } /** * Get the console command arguments. * * @return array */ protected function getArguments() { return [ ['module', InputArgument::OPTIONAL, 'Module name.'], ]; } }