예제 #1
0
 protected function init()
 {
     $settings = Settings::instance();
     if (!strlen($settings->profile_id)) {
         throw new ApplicationException(trans('rainlab.googleanalytics::lang.strings.notconfigured'));
     }
     if (!$settings->gapi_key) {
         throw new ApplicationException(trans('rainlab.googleanalytics::lang.strings.keynotuploaded'));
     }
     $client = new Google_Client();
     /*
      * Set caching
      */
     $cache = new Google_Cache_File(temp_path() . '/Google_Client');
     $client->setCache($cache);
     /*
      * Set assertion credentials
      */
     $auth = json_decode($settings->gapi_key->getContents(), true);
     $client->setAuthConfig($auth);
     $client->addScope(Google_Service_Analytics::ANALYTICS_READONLY);
     if ($client->isAccessTokenExpired()) {
         $client->refreshTokenWithAssertion();
     }
     $this->client = $client;
     $this->service = new Google_Service_Analytics($client);
     $this->viewId = 'ga:' . $settings->profile_id;
 }
예제 #2
0
 /**
  * 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');
 }
 protected function init()
 {
     $settings = Settings::instance();
     if (!strlen($settings->project_name)) {
         throw new ApplicationException(Lang::get('rainlab.googleanalytics::lang.exceptions.google_api_not_configured'));
     }
     if (!$settings->gapi_key) {
         throw new ApplicationException(Lang::get('rainlab.googleanalytics::lang.exceptions.google_api_key_not_uploaded'));
     }
     $tmpDir = temp_path() . '/Google_Client';
     $this->client = new Google_Client();
     $this->client->setApplicationName($settings->project_name);
     $this->client->setClassConfig('Google_Cache_File', 'directory', $tmpDir);
     /*
      * Set assertion credentials
      */
     $this->client->setAssertionCredentials(new Google_Auth_AssertionCredentials($settings->app_email, array(Google_Service_Analytics::ANALYTICS_READONLY), $settings->gapi_key->getContents()));
     $this->client->setClientId($settings->client_id);
     $this->service = new Google_Service_Analytics($this->client);
     $this->viewId = 'ga:' . $settings->profile_id;
 }
예제 #4
0
 public function domainName()
 {
     return Settings::get('domain_name');
 }
 /**
  * Add data to DB scheme
  * @return null;
  */
 public function run()
 {
     Settings::set('name', 'Seldac');
     Settings::set('full_name', 'Seldac Servizi S.r.L.');
     Settings::set('slogan', 'The answer to the administrative needs of all companies, small and medium-sized businesses, professionals and associations.');
     Settings::set('about', implode("\n", ['provides high-level advice to companies, accompanying step by step their customers in the intricate field of taxation.', 'The service of electronic data processing accounting allows to fulfill all the formalities required by law.', 'Our customer can resolve the related tasks because the service is managed by experienced staff', 'through the use of one of the most advanced management software as ZUCCHETTI.']));
     Settings::set('address_street_name', 'via Felice Cavallotti');
     Settings::set('address_street_number', '128');
     Settings::set('address_street_int', '3');
     Settings::set('address_zip', '15067');
     Settings::set('address_city', 'Novi Ligure');
     Settings::set('address_province', 'AL');
     Settings::set('address_country', 'IT');
     Settings::set('vat', '02254830066');
     Settings::set('rui_section', 'E');
     Settings::set('rui_number', 'E000147232');
     Settings::set('rui_date', '10/04/2007');
     Settings::set('mc_address_street_name', 'via Felice Cavallotti');
     Settings::set('mc_address_street_number', '128');
     Settings::set('mc_address_street_int', '5');
     Settings::set('mc_address_zip', '15067');
     Settings::set('mc_address_city', 'Novi Ligure');
     Settings::set('mc_address_province', 'AL');
     Settings::set('mc_address_country', 'IT');
     Settings::set('mc_nin', 'CSRMRC64P02D612A');
     Settings::set('mc_vat', '05110830485');
     AddThisSettings::set('pubid', 'ra-5481b79425aef103');
     SegmentSettings::set('write_key', 'qufrprcjgq');
     $ga_settings = GoogleAnalyticsSettings::instance();
     $ga_settings->project_name = 'seldac';
     $ga_settings->client_id = '284098878834-asjihnigkqg3ikl5kiqsgked7f2j3nf4.apps.googleusercontent.com';
     $ga_settings->app_email = '*****@*****.**';
     $ga_settings->profile_id = '63908586';
     $ga_settings->tracking_id = 'UA-34732651-1';
     $ga_settings->domain_name = 'seldac';
     $ga_settings->save();
     $mail_settings = MailSettings::instance();
     $mail_settings->send_mode = 'smtp';
     $mail_settings->sender_name = 'Seldac Servizi S.r.L.';
     $mail_settings->sender_email = '*****@*****.**';
     $mail_settings->smtp_address = 'smtp.aruba.it';
     $mail_settings->smtp_port = '465';
     $mail_settings->smtp_user = '******';
     $mail_settings->smtp_password = '******';
     $mail_settings->smtp_authorization = '1';
     $mail_settings->smtp_ssl = '1';
     $mail_settings->save();
     $seo_extension_settings = SeoExtensionSettings::instance();
     $seo_extension_settings->enable_title = '1';
     $seo_extension_settings->enable_canonical_url = '1';
     $seo_extension_settings->title = '| Seldac';
     $seo_extension_settings->title_position = 'suffix';
     $seo_extension_settings->other_tags = "<meta name=\"author\" content=\"Alex Carrega (AxC - http:\\/\\/www.alexcarrega.com)\">\r\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" \\/>\r\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" \\/>\r\n<meta name=\"description\" content=\"Contact page\" \\/>\r\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">";
     $seo_extension_settings->save();
     $brand_settings = BrandSettings::instance();
     $brand_settings->app_name = 'Seldac';
     $brand_settings->app_tagline = 'Seldac Servizi S.r.L.';
     $brand_settings->primary_color_light = '#de6b10';
     $brand_settings->primary_color_dark = '#DAA520';
     $brand_settings->secondary_color_light = '#F0E68C';
     $brand_settings->secondary_color_dark = '#B22222';
     $brand_settings->save();
     $recaptcha_settings = reCAPTCHASettings::instance();
     $recaptcha_settings->public_key = '6LfF0uwSAAAAAL4L5_sQ9aDiCn8PzMd0rStSSH5N';
     $recaptcha_settings->private_key = '6LfF0uwSAAAAAOdiygwACNXT34u5NpD0ndHXn9Jn';
     $recaptcha_settings->save();
     // @p-color: #58585a;
     // @s-color: #de6b10;
     // @bg-color: #e6e7e8;
     // @i-color: #DAA520;
     // @w-color: #F0E68C;
     // @d-color: #B22222;
 }