/** * Get chuck upload path. * * @return string */ public function getChunkPath() { $path = config('plupload.chunk_path'); if (!$this->storage->isDirectory($path)) { $this->storage->makeDirectory($path, 0777, true); } return $path; }
/** * Get chuck upload path * * @return string */ public function getChunkPath() { $path = public_path('uploads/'); if (!$this->storage->isDirectory($path)) { $this->storage->makeDirectory($path, 0777, true); } return $path; }
/** * Execute the console command. * * @return mixed */ public function fire() { $databaseConfig = array(); $environment = $this->ask('What is your current environment? [Default=local] : ', 'local'); $databaseConfig['databaseHost'] = $this->ask('Enter your database host [Default=localhost] : ', 'localhost'); $databaseConfig['databaseName'] = $this->ask('Enter your database name [Default=homestead] : ', 'homestead'); $databaseConfig['databaseUsername'] = $this->ask('Enter your database username [Default=homestead] : ', 'homestead'); $databaseConfig['databasePassword'] = $this->secret('Enter your database password [Default=secret] : ') ?: 'secret'; $databaseConfig['databasePortNumber'] = $this->ask('Enter your database port number [Default=5432] : ', '5432'); $file = new \Illuminate\Filesystem\Filesystem(); $contents = <<<ENV <?php define("LARAVEL_ENV", '{$environment}'); ENV; $file->put(base_path() . '/bootstrap/env.php', $contents); $databaseConfig['environment'] = $environment; $config = View::make('command.runtime-conf', $databaseConfig); if (!$file->isDirectory(base_path() . '/app/config/propel/')) { $file->makeDirectory(base_path() . '/app/config/propel'); } $file->put(base_path() . '/app/config/propel/runtime-conf.xml', $config); $file->put(base_path() . '/app/config/propel/buildtime-conf.xml', $config); exec('vendor/bin/propel config:convert-xml --output-dir="app/config/propel" --input-dir="app/config/propel"'); $dbContent = <<<ENV <?php return array( 'default' => 'pgsql', 'connections' => array( 'pgsql' => array( 'driver' => 'pgsql', 'host' => '{$databaseConfig['databaseHost']}', 'database' => '{$databaseConfig['databaseName']}', 'username' => '{$databaseConfig['databaseUsername']}', 'password' => '{$databaseConfig['databasePassword']}', 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', ), ), ); ENV; if (!$file->isDirectory(base_path() . '/app/config/' . $environment)) { $file->makeDirectory(base_path() . '/app/config/' . $environment); } $file->put(base_path() . '/app/config/' . $environment . '/database.php', $dbContent); $this->info('You are done.'); }