本文整理汇总了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.');
}
示例2: setUp
protected function setUp()
{
parent::setUp();
module_load_install('system');
$schema = system_schema();
db_create_table('key_value_expire', $schema['key_value_expire']);
}
示例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');
}
示例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();
}
示例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'));
}
示例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;
}
示例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']);
}
}
}
}
示例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');
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
}
示例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'));
}
示例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();
}
示例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');
}
}
}
}