/** * Execute the console command. * @return void */ public function fire() { $this->info('Initializing npm, bower and some boilerplates'); // copiar templates $path_source = plugins_path('genius/elixir/assets/template/'); $path_destination = base_path('/'); $vars = ['{{theme}}' => Theme::getActiveTheme()->getDirName(), '{{project}}' => str_slug(BrandSettings::get('app_name'))]; $fileSystem = new Filesystem(); foreach ($fileSystem->allFiles($path_source) as $file) { if (!$fileSystem->isDirectory($path_destination . $file->getRelativePath())) { $fileSystem->makeDirectory($path_destination . $file->getRelativePath(), 0777, true); } $fileSystem->put($path_destination . $file->getRelativePathname(), str_replace(array_keys($vars), array_values($vars), $fileSystem->get($path_source . $file->getRelativePathname()))); } $this->info('... initial setup is ok!'); $this->info('Installing npm... this can take several minutes!'); // instalar NPM system("cd '{$path_destination}' && npm install"); $this->info('... node components is ok!'); $this->info('Installing bower... this will no longer take as!'); // instalar NPM system("cd '{$path_destination}' && bower install"); $this->info('... bower components is ok!'); $this->info('Now... edit the /gulpfile.js as you wish and edit your assets at/ resources directory... that\'s is!'); }
/** * Execute the console command. * @return void */ public function fire() { $base_path = base_path(''); $this->info('Dependencies installing begins here! (plugin:install)'); // DEPENDENCIES foreach (['RainLab.Translate', 'Flynsarmy.IdeHelper', 'BnB.ScaffoldTranslation', 'October.Drivers', 'RainLab.GoogleAnalytics', 'Genius.StorageClear'] as $required) { $this->info('Installing: ' . $required); Artisan::call("plugin:install", ['name' => $required]); } $this->info('Dependencies installed!'); // THEME $this->info('Installing: oc-genius-theme'); system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-theme themes/genius"); Theme::setActiveTheme('genius'); // ELIXIR $this->info('Installing: oc-genius-elixir'); system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-elixir plugins/genius/elixir"); // FORMS $this->info('Installing: oc-genius-forms'); system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-forms plugins/genius/forms"); // BACKUP $this->info('Installing: oc-genius-backup'); system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-backup plugins/genius/backup"); // GOOGLE ANALYTICS $this->info('Initial setup: AnalytcsSettings'); if (!AnalytcsSettings::get('project_name')) { AnalytcsSettings::create(['project_name' => 'API Project', 'client_id' => '979078159189-8afk8nn2las4vk1krbv8t946qfk540up.apps.googleusercontent.com', 'app_email' => '*****@*****.**', 'profile_id' => '112409305', 'tracking_id' => 'UA-29856398-24', 'domain_name' => 'retrans.srv.br'])->gapi_key()->add(File::create(['data' => plugins_path('genius/base/assets/genius-analytics.p12')])); } // EMAIL $this->info('Initial setup: MailSettings'); if (!MailSettings::get('mandrill_secret')) { MailSettings::create(['send_mode' => 'mandrill', 'sender_name' => 'Genius Soluções Web', 'sender_email' => '*****@*****.**', 'mandrill_secret' => 't27R2C15NPnZ8tzBrIIFTA']); } // BRAND $this->info('Initial setup: BrandSettings'); if (!BrandSettings::get('app_init')) { BrandSettings::create(['app_name' => 'Genius Soluções Web', 'app_tagline' => 'powered by Genius', "primary_color_light" => "#e67e22", "primary_color_dark" => "#d35400", "secondary_color_light" => "#34495e", "secondary_color_dark" => "#2b3e50", "custom_css" => "", 'app_init' => true])->logo()->add(File::create(['data' => plugins_path('genius/base/assets/genius-logo.png')])); } // USUARIO BASE $this->info('Initial setup: User'); $user = User::find(1); if (!$user->last_name) { $user->update(['first_name' => 'Genius', 'last_name' => 'Soluções Web', 'login' => 'genius', 'email' => '*****@*****.**', 'password' => 'genius', 'password_confirmation' => 'genius']); $user->avatar()->add(File::create(['data' => plugins_path('genius/base/assets/genius-avatar.jpg')])); } $this->info('Genius.Base is ready to rock!'); $this->info(''); $this->info('For Laravel Elixir setup run: php artisan elixir:init'); }
public function onCheckout() { if (!$this->stockCheck()) { return $this->redirectBackWithRemovedError(); } $content = Cart::content()->toArray(); $total = Cart::total(); $this->formatPrices($content, $total); Mail::sendTo(post('email'), 'feegleweb.octoshoplite::mail.orderconfirm', ['admin' => false, 'name' => post('first_name'), 'site' => BrandSettings::get('app_name'), 'items' => $content, 'total' => $total]); Mail::sendTo($this->recipientEmail, 'feegleweb.octoshoplite::mail.orderconfirm_admin', ['admin' => true, 'name' => $this->recipientName, 'address' => implode('<br>', [post('first_name') . ' ' . post('last_name'), post('address'), post('town'), post('county'), post('postcode')]), 'site' => BrandSettings::get('app_name'), 'items' => $content, 'total' => $total]); return Redirect::to('/'); }