當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Setting::isInstalled方法代碼示例

本文整理匯總了PHP中humhub\models\Setting::isInstalled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Setting::isInstalled方法的具體用法?PHP Setting::isInstalled怎麽用?PHP Setting::isInstalled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在humhub\models\Setting的用法示例。


在下文中一共展示了Setting::isInstalled方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: up

 public function up()
 {
     if (\humhub\models\Setting::isInstalled()) {
         $this->alterColumn('profile', 'zip', 'VARCHAR(10) DEFAULT NULL');
         $this->update('profile_field', array('field_type_class' => 'ProfileFieldTypeText', 'field_type_config' => '{"minLength":null,"maxLength":10,"validator":null,"default":null,"regexp":null,"regexpErrorMessage":null}'), 'internal_name="zip"');
     }
 }
開發者ID:VasileGabriel,項目名稱:humhub,代碼行數:7,代碼來源:m140907_140822_zip_field_to_text.php

示例2: up

 public function up()
 {
     if (Setting::isInstalled()) {
         $this->insert('setting', array('name' => 'enable_html5_desktop_notifications', 'value' => 0, 'module_id' => 'notification'));
     }
     $this->addColumn('notification', 'desktop_notified', 'tinyint(1) DEFAULT 0');
     $this->update('notification', array('desktop_notified' => 1));
 }
開發者ID:VasileGabriel,項目名稱:humhub,代碼行數:8,代碼來源:m150204_103433_html5_notified.php

示例3: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (\humhub\models\Setting::isInstalled()) {
         $secret = \humhub\models\Setting::Get('secret');
         if ($secret != "") {
             $this->cookieValidationKey = \humhub\models\Setting::Get('secret');
         }
     } else {
         $this->cookieValidationKey = 'installer';
     }
 }
開發者ID:SimonBaeumer,項目名稱:humhub,代碼行數:14,代碼來源:Request.php

示例4: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (\humhub\models\Setting::isInstalled()) {
         $secret = Yii::$app->settings->get('secret');
         if ($secret != "") {
             $this->cookieValidationKey = $secret;
         }
     }
     if ($this->cookieValidationKey == '') {
         $this->cookieValidationKey = 'installer';
     }
 }
開發者ID:VasileGabriel,項目名稱:humhub,代碼行數:15,代碼來源:Request.php

示例5: up

 public function up()
 {
     // Check if the installer already ran when not create new profile field
     // (Typically the installer creates initial data.)
     if (\humhub\models\Setting::isInstalled()) {
         $row = (new \yii\db\Query())->select("*")->from('profile_field_category')->where(['title' => 'General'])->one();
         $categoryId = $row['id'];
         if ($categoryId == "") {
             throw new yii\base\Exception("Could not find 'General' profile field category!");
         }
         $this->insert('profile_field', ['profile_field_category_id' => $categoryId, 'field_type_class' => 'ProfileFieldTypeSelect', 'field_type_config' => '{"options":"male=>Male\\r\\nfemale=>Female\\r\\ncustom=>Custom"}', 'internal_name' => 'gender', 'title' => 'Gender', 'sort_order' => '350', 'editable' => '1', 'visible' => '1', 'show_at_registration' => '0', 'required' => '0']);
         // Create column for profile field
         $this->addColumn('profile', 'gender', 'varchar(255) DEFAULT NULL');
     }
 }
開發者ID:SimonBaeumer,項目名稱:humhub,代碼行數:15,代碼來源:m140701_000611_profile_genderfield.php

示例6: up

 public function up()
 {
     // Check if the installer already ran when not create new profile field
     // (Typically the installer creates initial data.)
     if (\humhub\models\Setting::isInstalled()) {
         $row = (new \yii\db\Query())->select("*")->from('profile_field_category')->where(['title' => 'General'])->one();
         $categoryId = $row['id'];
         if ($categoryId == "") {
             throw new yii\base\Exception("Could not find 'General' profile field category!");
         }
         $this->insert('profile_field', ['profile_field_category_id' => $categoryId, 'field_type_class' => 'ProfileFieldTypeBirthday', 'field_type_config' => '', 'internal_name' => 'birthday', 'title' => 'Birthday', 'sort_order' => '850', 'editable' => '1', 'is_system' => '1', 'visible' => '1', 'show_at_registration' => '0', 'required' => '0']);
         // Create columns for profile field
         $this->addColumn('profile', 'birthday', 'DATETIME DEFAULT NULL');
         $this->addColumn('profile', 'birthday_hide_year', 'INT(1) DEFAULT NULL');
     }
 }
開發者ID:VasileGabriel,項目名稱:humhub,代碼行數:16,代碼來源:m140703_104527_profile_birthdayfield.php

示例7: up

 public function up()
 {
     $rows = (new \yii\db\Query())->select("*")->from('user')->all();
     foreach ($rows as $row) {
         // Ignore deleted users
         if ($row['status'] == 3) {
             continue;
         }
         $userId = $row['id'];
         $receive_email_notifications = $row['receive_email_notifications'];
         $receive_email_messaging = $row['receive_email_messaging'];
         $receive_email_activities = $row['receive_email_activities'];
         $this->insert('user_setting', array('user_id' => $userId, 'module_id' => 'core', 'name' => 'receive_email_notifications', 'value' => $receive_email_notifications));
         $this->insert('user_setting', array('user_id' => $userId, 'module_id' => 'core', 'name' => 'receive_email_messaging', 'value' => $receive_email_messaging));
         $this->insert('user_setting', array('user_id' => $userId, 'module_id' => 'core', 'name' => 'receive_email_activities', 'value' => $receive_email_activities));
     }
     $this->dropColumn('user', 'receive_email_notifications');
     $this->dropColumn('user', 'receive_email_messaging');
     $this->dropColumn('user', 'receive_email_activities');
     if (\humhub\models\Setting::isInstalled()) {
         $this->insert('setting', array('name' => 'receive_email_activities', 'value' => '1', 'name' => 'mailing'));
         $this->insert('setting', array('name' => 'receive_email_notifications', 'value' => '2', 'name' => 'mailing'));
     }
 }
開發者ID:SimonBaeumer,項目名稱:humhub,代碼行數:24,代碼來源:m140705_065525_emailing_settings.php

示例8: up

 public function up()
 {
     if (\humhub\models\Setting::isInstalled()) {
         $this->insert('setting', array('name' => 'installationId', 'value' => md5(uniqid("", true)), 'module_id' => 'admin'));
     }
 }
開發者ID:VasileGabriel,項目名稱:humhub,代碼行數:6,代碼來源:m140704_080659_installationid.php


注:本文中的humhub\models\Setting::isInstalled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。