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


PHP module_load_install函數代碼示例

本文整理匯總了PHP中module_load_install函數的典型用法代碼示例。如果您正苦於以下問題:PHP module_load_install函數的具體用法?PHP module_load_install怎麽用?PHP module_load_install使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: testEnable

 /**
  * Test successful execution of hook_requirements() during install/enable.
  *
  * Function module_enable() does not check requirements, unlike normal
  * enabling, so we need to invoke the hook manually to simulate it.
  */
 public function testEnable()
 {
     module_load_install(static::MODULE);
     module_invoke(static::MODULE, 'requirements', 'install');
     module_enable([static::MODULE], FALSE);
     $this->pass('Successfully enabled mongodb.module.');
 }
開發者ID:pjcdawkins,項目名稱:drupal7mongodb,代碼行數:13,代碼來源:PackageManagementTest.php

示例2: setUp

 protected function setUp()
 {
     parent::setUp();
     module_load_install('system');
     $schema = system_schema();
     db_create_table('key_value_expire', $schema['key_value_expire']);
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:7,代碼來源:GarbageCollectionTest.php

示例3: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $config = $this->config('system.theme');
     $config->set('default', 'bartik');
     $config->set('admin', 'seven');
     $config->save();
     foreach (static::$modules as $module) {
         $function = $module . '_schema';
         module_load_install($module);
         if (function_exists($function)) {
             $schema = $function();
             $this->installSchema($module, array_keys($schema));
         }
     }
     $this->installEntitySchema('aggregator_feed');
     $this->installEntitySchema('aggregator_item');
     $this->installEntitySchema('block_content');
     $this->installEntitySchema('comment');
     $this->installEntitySchema('file');
     $this->installEntitySchema('node');
     $this->installEntitySchema('menu_link_content');
     $this->installEntitySchema('taxonomy_term');
     $this->installEntitySchema('user');
     $this->installConfig(['block_content', 'comment', 'file', 'node', 'simpletest']);
     // Install one of D8's test themes.
     \Drupal::service('theme_handler')->install(array('test_theme'));
     // Create a new user which needs to have UID 1, because that is expected by
     // the assertions from
     // \Drupal\migrate_drupal\Tests\d6\MigrateNodeRevisionTest.
     User::create(['uid' => 1, 'name' => $this->randomMachineName(), 'status' => 1])->enforceIsNew(TRUE)->save();
     $this->installMigrations('Drupal 6');
 }
開發者ID:scratch,項目名稱:gai,代碼行數:36,代碼來源:MigrateDrupal6Test.php

示例4: setUp

 function setUp()
 {
     parent::setUp();
     // Run the install hook.
     // @TODO: figure out why this is necessary.
     module_load_install('domain_source');
     domain_source_install();
 }
開發者ID:dropdog,項目名稱:play,代碼行數:8,代碼來源:DomainSourceEntityReferenceTest.php

示例5: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create the test field.
     module_load_install('entity_test');
     entity_test_install();
     // Install required default configuration for filter module.
     $this->installConfig(array('system', 'filter'));
 }
開發者ID:jeyram,項目名稱:camp-gdl,代碼行數:12,代碼來源:EntityValidationTest.php

示例6: tableDefinition

 /**
  * Returns the table definition for the URL alias fixtures.
  *
  * @return array
  *   Table definitions.
  */
 public function tableDefinition()
 {
     $tables = array();
     module_load_install('system');
     $schema = system_schema();
     $tables['url_alias'] = $schema['url_alias'];
     $tables['key_value'] = $schema['key_value'];
     return $tables;
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:15,代碼來源:UrlAliasFixtures.php

示例7: moduleRequirement

 public function moduleRequirement($module)
 {
     foreach ($module as $module_name) {
         module_load_install($module_name);
         if ($requirements = \Drupal::moduleHandler()->invoke($module_name, 'requirements', array('install'))) {
             foreach ($requirements as $requirement) {
                 throw new \Exception($module_name . ' can not be installed: ' . $requirement['description']);
             }
         }
     }
 }
開發者ID:ddrozdik,項目名稱:DrupalConsole,代碼行數:11,代碼來源:ModuleTrait.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     module_load_install('system');
     $schema = system_schema();
     db_create_table('key_value', $schema['key_value']);
     $this->container->register('database', 'Drupal\\Core\\Database\\Connection')->setFactoryClass('Drupal\\Core\\Database\\Database')->setFactoryMethod('getConnection')->addArgument('default');
     $this->container->register('keyvalue.database', 'Drupal\\Core\\KeyValueStore\\KeyValueDatabaseFactory')->addArgument(new Reference('serialization.phpserialize'))->addArgument(new Reference('database'));
     $this->container->register('serialization.phpserialize', 'Drupal\\Component\\Serialization\\PhpSerialize');
     $this->settingsSet('keyvalue_default', 'keyvalue.database');
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:11,代碼來源:DatabaseStorageTest.php

示例9: setUp

 protected function setUp()
 {
     parent::setUp();
     // Install field configuration.
     $this->installConfig(array('field'));
     // The users table is needed for creating dummy user accounts.
     $this->installEntitySchema('user');
     // Register entity_test text field.
     module_load_install('entity_test');
     entity_test_install();
 }
開發者ID:alnutile,項目名稱:drunatra,代碼行數:11,代碼來源:FieldAccessTest.php

示例10: setUp

 function setUp()
 {
     parent::setUp();
     // Run the install hook.
     // @TODO: figure out why this is necessary.
     module_load_install('domain_access');
     domain_access_install();
     // Set the access handler.
     $this->accessHandler = \Drupal::entityManager()->getAccessControlHandler('node');
     // Clear permissions for authenticated users.
     $this->config('user.role.' . DRUPAL_AUTHENTICATED_RID)->set('permissions', array())->save();
 }
開發者ID:dropdog,項目名稱:play,代碼行數:12,代碼來源:DomainAccessGrantsTest.php

示例11: tableDefinition

 /**
  * Returns the table definition for the URL alias fixtures.
  *
  * @return array
  *   Table definitions.
  */
 public function tableDefinition()
 {
     $tables = array();
     // Prime the drupal_get_filename() cache with the location of the system
     // module as its location is known and shouldn't change.
     // @todo Remove as part of https://www.drupal.org/node/2186491
     drupal_get_filename('module', 'system', 'core/modules/system/system.info.yml');
     module_load_install('system');
     $schema = system_schema();
     $tables['url_alias'] = AliasStorage::schemaDefinition();
     $tables['key_value'] = $schema['key_value'];
     return $tables;
 }
開發者ID:sojo,項目名稱:d8_friendsofsilence,代碼行數:19,代碼來源:UrlAliasFixtures.php

示例12: setUp

 protected function setUp()
 {
     parent::setUp();
     // Install system tables to test the key/value storage without installing a
     // full Drupal environment.
     module_load_install('system');
     $schema = system_schema();
     db_create_table('semaphore', $schema['semaphore']);
     db_create_table('key_value_expire', $schema['key_value_expire']);
     // Create several objects for testing.
     for ($i = 0; $i <= 3; $i++) {
         $this->objects[$i] = $this->randomObject();
     }
 }
開發者ID:alnutile,項目名稱:drunatra,代碼行數:14,代碼來源:TempStoreDatabaseTest.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     foreach (entity_test_entity_types() as $entity_type_id) {
         // The entity_test schema is installed by the parent.
         if ($entity_type_id != 'entity_test') {
             $this->installEntitySchema($entity_type_id);
         }
     }
     // Create the test field.
     module_load_install('entity_test');
     entity_test_install();
     // Install required default configuration for filter module.
     $this->installConfig(array('system', 'filter'));
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:15,代碼來源:EntityFieldTest.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     // Clear permissions for authenticated users.
     $this->config('user.role.' . RoleInterface::AUTHENTICATED_ID)->set('permissions', array())->save();
     // Create Basic page node type.
     if ($this->profile != 'standard') {
         $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page', 'display_submitted' => FALSE));
     }
     $this->accessHandler = \Drupal::entityManager()->getAccessControlHandler('node');
     $this->manager = \Drupal::service('domain_access.manager');
     // Create 5 domains.
     $this->domainCreateTestDomains(5);
     // Run the install hook.
     // @TODO: figure out why this is necessary.
     module_load_install('domain_access');
     domain_access_install();
 }
開發者ID:dropdog,項目名稱:play,代碼行數:18,代碼來源:DomainAccessPermissionsTest.php

示例15: onRequest

 /**
  * Implements hook_init().
  */
 function onRequest()
 {
     // On all Mollom administration pages, check the module configuration and
     // display the corresponding requirements error, if invalid.
     $url = Url::fromRoute('<current>');
     $current_path = $url->toString();
     if (empty($_POST) && strpos($current_path, 'admin/config/content/mollom') === 0 && \Drupal::currentUser()->hasPermission('administer mollom')) {
         // Re-check the status on the settings form only.
         $status = \Drupal\mollom\Utility\MollomUtilities::getAPIKeyStatus($current_path == 'admin/config/content/mollom/settings');
         if ($status !== TRUE) {
             // Fetch and display requirements error message, without re-checking.
             module_load_install('mollom');
             $requirements = mollom_requirements('runtime', FALSE);
             if (isset($requirements['mollom']['description'])) {
                 drupal_set_message($requirements['mollom']['description'], 'error');
             }
         }
     }
 }
開發者ID:ABaldwinHunter,項目名稱:durhamatletico-cms,代碼行數:22,代碼來源:Subscriber.php


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