• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP module_enable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中module_enable函数的典型用法代码示例。如果您正苦于以下问题:PHP module_enable函数的具体用法?PHP module_enable怎么用?PHP module_enable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了module_enable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Implements setUp().
  */
 function setUp($modules = array())
 {
     if (!isset($this->time)) {
         $this->time = time();
     }
     $this->timeLimit = 1000;
     parent::setUp();
     if (!module_exists('forum_access')) {
         module_enable(array('acl', 'chain_menu_access', 'forum_access'), FALSE);
     }
     $this->assertTrue(module_exists('acl'), t('Module %module enabled!', array('%module' => 'acl')), 'Setup');
     $this->assertTrue(module_exists('chain_menu_access'), t('Module %module enabled!', array('%module' => 'chain_menu_access')), 'Setup');
     $this->assertTrue(module_exists('forum_access'), t('Module %module enabled!', array('%module' => 'forum_access')), 'Setup');
     $modules = array('devel', 'devel_node_access') + $modules;
     $files = system_rebuild_module_data();
     $available_modules = array();
     foreach ($modules as $module) {
         if (!empty($files[$module]) && !module_exists($module)) {
             $available_modules[] = $module;
         }
     }
     if (!empty($available_modules)) {
         module_enable($available_modules);
     }
     parent::resetAll();
     $this->accesses = array('view', 'create', 'update', 'delete');
 }
开发者ID:alauzon,项目名称:pf,代码行数:30,代码来源:forum_access_test_base.php


示例2: testPermissions

 /**
  * Test that the links are added to the page (no JS testing).
  */
 function testPermissions()
 {
     module_enable(array('contact'));
     $this->resetAll();
     // Anonymous users should not see the menu.
     $this->drupalGet('');
     $this->assertNoElementByXPath('//div[@id="admin-menu"]', array(), t('Administration menu not found.'));
     // Create a user who
     // - can access content overview
     // - cannot access drupal.org links
     // - cannot administer Contact module
     $permissions = $this->basePermissions + array('access content overview');
     $admin_user = $this->drupalCreateUser($permissions);
     $this->drupalLogin($admin_user);
     // Check that the user can see the admin links, but not the drupal links.
     $this->assertElementByXPath('//div[@id="admin-menu"]', array(), 'Administration menu found.');
     $this->assertElementByXPath('//div[@id="admin-menu"]//a[contains(@href, :path)]', array(':path' => 'admin/content'), 'Content link found.');
     $this->assertNoElementByXPath('//div[@id="admin-menu"]//a[@href=:path]', array(':path' => 'http://drupal.org'), 'Icon » Drupal.org link not found.');
     $this->assertNoElementByXPath('//div[@id="admin-menu"]//a[contains(@href, :path)]', array(':path' => 'admin/structure/contact'), 'Structure » Contact link not found.');
     // Create a user "reversed" to the above; i.e., who
     // - cannot access content overview
     // - can access drupal.org links
     // - can administer Contact module
     $permissions = $this->basePermissions + array('display drupal links', 'administer contact forms');
     $admin_user2 = $this->drupalCreateUser($permissions);
     $this->drupalLogin($admin_user2);
     $this->assertElementByXPath('//div[@id="admin-menu"]', array(), 'Administration menu found.');
     $this->assertNoElementByXPath('//div[@id="admin-menu"]//a[contains(@href, :path)]', array(':path' => 'admin/content'), 'Content link not found.');
     $this->assertElementByXPath('//div[@id="admin-menu"]//a[@href=:path]', array(':path' => 'http://drupal.org'), 'Icon » Drupal.org link found.');
     $this->assertElementByXPath('//div[@id="admin-menu"]//a[contains(@href, :path)]', array(':path' => 'admin/structure/contact'), 'Structure » Contact link found.');
 }
开发者ID:darrylri,项目名称:protovbmwmo,代码行数:34,代码来源:AdminMenuPermissionsTest.php


示例3: setupFeature

 /** 
  * @BeforeFeature
  */
 public static function setupFeature(BeforeFeatureScope $scope)
 {
     $feature = $scope->getFeature();
     if ($feature->getTitle() == 'Dkan Harvest') {
         module_enable(array('dkan_harvest_test'));
     }
 }
开发者ID:nucivic,项目名称:dkanextension,代码行数:10,代码来源:HarvestSourceContext.php


示例4: xautoloadTestWithCacheTypes

 /**
  * @param array $cache_types
  *   The autoloader modes that are enabled, e.g.
  *   array('apc' => 'apc', 'xcache' => 'xcache')
  * @param bool $cache_lazy
  *   Whether the "lazy" mode is enabled.
  */
 protected function xautoloadTestWithCacheTypes($cache_types, $cache_lazy)
 {
     // @FIXME
     // // @FIXME
     // // The correct configuration object could not be determined. You'll need to
     // // rewrite this call manually.
     // variable_set(XAUTOLOAD_VARNAME_CACHE_TYPES, $cache_types);
     $this->pass("Set cache types: " . var_export($cache_types, TRUE));
     // @FIXME
     // // @FIXME
     // // The correct configuration object could not be determined. You'll need to
     // // rewrite this call manually.
     // variable_set(XAUTOLOAD_VARNAME_CACHE_LAZY, $cache_lazy);
     $this->pass("Set cache lazy mode: " . var_export($cache_lazy, TRUE));
     // Enable xautoload.
     module_enable(array('xautoload'), FALSE);
     // At this time the xautoload_cache_mode setting is not in effect yet,
     // so we have to clear old cached values from APC cache.
     xautoload()->cacheManager->renewCachePrefix();
     module_enable(array('xautoload_test_1', 'xautoload_test_2', 'xautoload_test_3', 'xautoload_test_4', 'xautoload_test_5'), FALSE);
     menu_rebuild();
     foreach (array('xautoload_test_1' => array('Drupal\\xautoload_test_1\\ExampleClass'), 'xautoload_test_2' => array('xautoload_test_2_ExampleClass'), 'xautoload_test_3' => array('Drupal\\xautoload_test_3\\ExampleClass')) as $module => $classes) {
         $classes_on_include = in_array($module, array('xautoload_test_2', 'xautoload_test_3'));
         $this->xautoloadModuleEnabled($module, $classes, $classes_on_include);
         $this->xautoloadModuleCheckJson($module, $cache_types, $cache_lazy, $classes);
     }
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:34,代码来源:XAutoloadWebTestCase.php


示例5: 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


示例6: hook_sanmateo_is_master_set

/**
 * implements hook_sanmateo_is_master_set
 *
 * PARAM is_master: a bool that states if this is the master site
 *
 * THis is called when ever this site is set as master or not master
 * It can be used when other items need to be udpated
 */
function hook_sanmateo_is_master_set($is_master)
{
    if ($is_master) {
        module_enable(array('openid_provider'));
    } else {
        module_disable(array('openid_provider'));
    }
}
开发者ID:anselmbradford,项目名称:OpenSanMateo,代码行数:16,代码来源:sanmateo.api.php


示例7: prepTestData

 function prepTestData()
 {
     $servers = array();
     $variables = array();
     $authentication = array();
     $authorization = array();
     $this->testFunctions = new LdapTestFunctions();
     if ($this->useFeatureData) {
         module_enable(array('ctools'), TRUE);
         module_enable(array('strongarm'), TRUE);
         module_enable(array('features'), TRUE);
         module_enable(array($this->featureName), TRUE);
         // will need to set non exportables such as bind password also
         // also need to create fake ldap server data.  use
         if (!(module_exists('ctools') && module_exists('strongarm') && module_exists('features') && module_exists('$this->featureName'))) {
             drupal_set_message(t('Features and Strongarm modules must be available to use Features as configuratio of simpletests'), 'warning');
         }
         // with test data stored in features, need to get server properties from ldap_server properties
         require_once drupal_get_path('module', $this->featureName) . '/' . $this->featureName . '.ldap_servers.inc';
         require_once drupal_get_path('module', $this->featureName) . '/fake_ldap_server_data.inc';
         $function_name = $this->featureName . '_default_ldap_servers';
         $servers = call_user_func($function_name);
         foreach ($servers as $sid => $server) {
             $this->testData['servers'][$sid]['properties'] = (array) $server;
             // convert to array
             $this->testData['servers'][$sid]['properties']['inDatabase'] = TRUE;
             $this->testData['servers'][$sid]['properties']['bindpw'] = 'goodpwd';
             $this->testData['servers'][$sid] = array_merge($this->testData['servers'][$sid], $fake_ldap_server_data[$sid]);
         }
         // make included fake sid match feature sid
         $this->testFunctions->prepTestConfiguration($this->testData, TRUE);
     } else {
         include drupal_get_path('module', 'ldap_authorization') . '/tests/' . $this->authorizationData;
         $this->testData['authorization'] = $authorization;
         include drupal_get_path('module', 'ldap_authorization') . '/tests/' . $this->authenticationData;
         $this->testData['authentication'] = $authentication;
         include drupal_get_path('module', 'ldap_authorization') . '/tests/' . $this->serversData;
         $this->testData['servers'] = $servers;
         $this->testData['variables'] = $variables;
         // if only one server, set as default in authentication and authorization
         if (count($this->testData['servers']) == 1) {
             $sids = array_keys($servers);
             $this->sid = $sids[0];
             foreach ($this->testData['authorization'] as $consumer_type => $consumer_conf) {
                 $this->testData['authorization'][$consumer_type]['consumerType'] = $consumer_type;
                 $this->testData['authorization'][$consumer_type]['sid'] = $this->sid;
             }
             $this->testData['authentication']['sids'] = array($this->sid => $this->sid);
             $this->testData['servers'][$this->sid]['sid'] = $this->sid;
         }
         $this->testFunctions->prepTestConfiguration($this->testData, FALSE);
     }
 }
开发者ID:bellcom,项目名称:syddjurs.dk,代码行数:53,代码来源:LdapAuthorizationTestCase.class.php


示例8: enableDKAN_Workflow

 /**
  * @BeforeFeature @enableDKAN_Workflow
  */
 public static function enableDKAN_Workflow(BeforeFeatureScope $scope)
 {
     if (!parent::shouldEnableModule("dkan_workflow")) {
         return;
     }
     // This order matters through drupal_flush_all_caches.
     module_enable(array('link_badges', 'menu_badges', 'views_dkan_workflow_tree', 'workbench', 'workbench_moderation', 'workbench_email'));
     // Enable 'open_data_federal_extras' module.
     module_enable(array('dkan_workflow_permissions'));
     module_enable(array('dkan_workflow'));
     features_revert(array('dkan_workflow_permissions' => array('roles_permissions')));
     drupal_flush_all_caches();
 }
开发者ID:nucivic,项目名称:dkanextension,代码行数:16,代码来源:WorkflowContext.php


示例9: hook_environment_switch

/**
 * React to an environment state change.
 *
 * Use this hook to specify changes to your site configuration depending on
 * what kind of environment the site is operating in. For example, production
 * environments should not have developer/site-builder oriented modules enabled,
 * such as administrative UI modules.
 *
 * When defining your state change actions, be careful to account for a given
 * state always consisting of the same behaviors and configuration, regardless
 * of how it returns to that state (which previous environment it was in.) Be
 * careful that you do not *disable* any modules in one environment that
 * implement a necessary instance of hook_environment_switch().
 *
 * @param $target_env
 *  The name of the environment being activated.
 * @param $current_env
 *  The name of the environment being deactivated.
 * @param $workflow
 *  The name of the environment workflow whose current state is being switched.
 *  A "NULL" workflow is the default/generic/unspecified workflow for the site.
 *
 * @return
 *  String summarizing changes made for drush user.
 */
function hook_environment_switch($target_env, $current_env, $workflow = NULL)
{
    // Declare each optional development-related module
    $devel_modules = array('devel', 'devel_generate', 'devel_node_access');
    switch ($target_env) {
        case 'production':
            module_disable($devel_modules);
            drupal_set_message('Disabled development modules');
            return;
        case 'development':
            module_enable($devel_modules);
            drupal_set_message('Enabled development modules');
            return;
    }
}
开发者ID:Juterpillar,项目名称:dartprints,代码行数:40,代码来源:environment.api.php


示例10: testUninstall

 /**
  * Test successful execution of hook_uninstall() with Mongodb disabled.
  *
  * This cannot be checked by API calls, because the missing functions will
  * still be loaded in PHP, hence the need to use the UI to trigger page
  * reloads.
  */
 public function testUninstall()
 {
     module_enable([static::DRIVER, static::MODULE]);
     $this->pass('Successfully enabled driver and watchdog.module.');
     module_disable([static::MODULE, static::DRIVER]);
     $admin = $this->drupalCreateUser(['administer modules']);
     $this->drupalLogin($admin);
     $modules = ['uninstall[mongodb_watchdog]' => 1];
     $this->drupalPost('admin/modules/uninstall', $modules, t('Uninstall'));
     $this->assertResponse(200, 'Module uninstall form succeeded');
     $this->drupalPost(NULL, [], t('Uninstall'));
     // Broken core : this should NOT be a 200, but actually is.
     // $this->assertResponse(200, 'Module uninstall confirmation succeeded');
     $this->assertText(t('The selected modules have been uninstalled.'), 'Module uninstall confirmation succeeded.');
     $this->pass('Successfully uninstalled watchdog module.');
 }
开发者ID:pjcdawkins,项目名称:drupal7mongodb,代码行数:23,代码来源:PackageManagementTest.php


示例11: enable_modules_if_needed

/**
 * Enable modules if disabled.
 *
 * @param array $modules
 *  An array of modules
 */
function enable_modules_if_needed($modules)
{
    foreach ($modules as $module) {
        // Check if modules are disabled.
        $result = db_select('system', 's')->fields('s', array('status'))->condition('name', $module, '=')->condition('status', 0, '=')->execute();
        if ($result->fetchAssoc()) {
            // Create an array of modules to enable.
            $to_enable[] = $module;
        }
    }
    if ($to_enable) {
        module_enable($to_enable);
        echo "Enabled new modules";
    } else {
        echo "No new modules to enable";
    }
}
开发者ID:sergii-tkachenko,项目名称:phoenix,代码行数:23,代码来源:enable_modules.php


示例12: xautoloadTestWithCacheTypes

 /**
  * @param array $cache_types
  *   The autoloader modes that are enabled, e.g.
  *   array('apc' => 'apc', 'xcache' => 'xcache')
  * @param bool $cache_lazy
  *   Whether the "lazy" mode is enabled.
  */
 protected function xautoloadTestWithCacheTypes($cache_types, $cache_lazy)
 {
     variable_set('xautoload_cache_types', $cache_types);
     $this->pass("Set cache types: " . var_export($cache_types, TRUE));
     variable_set('xautoload_cache_lazy', $cache_lazy);
     $this->pass("Set cache lazy mode: " . var_export($cache_lazy, TRUE));
     // Enable xautoload.
     module_enable(array('xautoload'), FALSE);
     // At this time the xautoload_cache_mode setting is not in effect yet,
     // so we have to clear old cached values from APC cache.
     xautoload()->cacheManager->renewCachePrefix();
     module_enable(array('xautoload_test_1', 'xautoload_test_2', 'xautoload_test_3'), FALSE);
     menu_rebuild();
     foreach (array('xautoload_test_1' => array('Drupal\\xautoload_test_1\\ExampleClass'), 'xautoload_test_2' => array('xautoload_test_2_ExampleClass'), 'xautoload_test_3' => array('Drupal\\xautoload_test_3\\ExampleClass')) as $module => $classes) {
         $classes_on_include = in_array($module, array('xautoload_test_2', 'xautoload_test_3'));
         $this->xautoloadModuleEnabled($module, $classes, $classes_on_include);
         $this->xautoloadModuleCheckJson($module, $cache_types, $cache_lazy, $classes);
     }
 }
开发者ID:stevebresnick,项目名称:iomedia_stp_d7_core,代码行数:26,代码来源:XAutoloadWebTestCase.php


示例13: enableModule

 /**
  * Enables given module(s) at given location by symlinking their contents
  *
  * @param string            $loc  the location the module(s) can be found
  * @param array|string|null $name the name(s) of the module(s). Defaults to basename($loc).
  *
  * @throws \InvalidArgumentException
  */
 public static function enableModule($loc, $name = null)
 {
     $loc = rtrim($loc, '/');
     if (!is_dir($loc) || !is_readable($loc)) {
         throw new \InvalidArgumentException(sprintf('Unable to read directory %s', $loc));
     }
     $base = basename($loc);
     $link = DRUPAL_ROOT . "/sites/all/modules/{$base}";
     if (file_exists($link) && readlink($link)) {
         unlink($link);
     }
     symlink($loc, $link);
     drupal_static('system_rebuild_module_data', null, true);
     $modules = (array) ($name ?: $base);
     $enabled = module_enable($modules);
     if (false === $enabled) {
         throw new \InvalidArgumentException(sprintf('Unable to enable module(s) "%s"', implode(',', $modules)));
     }
     module_invoke_all('boot');
     module_invoke_all('init');
 }
开发者ID:korstiaan,项目名称:drunit,代码行数:29,代码来源:Drunit.php


示例14: setUp

 public function setUp()
 {
     // For benchmarking.
     $this->start = time();
     // Enable any modules required for the test.
     parent::setUp('better_exposed_filters', 'date', 'date_views', 'list', 'number', 'taxonomy', 'text', 'views', 'views_ui');
     // One of these days I'll figure out why Features is breaking all my tests.
     module_enable(array('bef_test_content'));
     // User with edit views perms
     $this->admin_user = $this->drupalCreateUser();
     $role = user_role_load_by_name('administrator');
     $this->assertTrue(!empty($role->rid), 'Found the "administrator" role.');
     user_save($this->admin_user, array('roles' => array($role->rid => $role->rid)));
     $this->drupalLogin($this->admin_user);
     // Build a basic view for use in tests.
     $this->createView();
     // $this->createDisplay('Page', array('path' => array('path' => 'bef_test_page')));
     // Add field to default display
     // $this->addField('node.title');
     // Turn of Better Exposed Filters
     $this->setBefExposedForm();
 }
开发者ID:rwelle,项目名称:mukurtucms,代码行数:22,代码来源:better_exposed_filters_TestBase.php


示例15: __init

/**
 * Initialize auto-inc values on dev site.  Run this function only once, at setup.
 */
function __init()
{
    // Bring config vars into function namespace
    extract(__config());
    // Enable profile module
    drush_print("Installing profile module.");
    if (drush_drupal_major_version() < 7) {
        include_once 'includes/install.inc';
        drupal_install_modules(array('profile'));
    } else {
        module_enable(array('profile'));
    }
    // Set auto-increment values
    $tables = array('authmap', 'comments', 'files', 'node', 'node_revisions', 'profile_fields', 'role', 'term_data', 'url_alias', 'users', 'vocabulary');
    foreach ($tables as $table) {
        $value = ${$table};
        db_query("ALTER TABLE `{$table}` AUTO_INCREMENT = %d", $value);
        drush_print("Set auto-increment value for {$table} to {$value}");
    }
    unset($value);
    drush_print("Initialization done!");
}
开发者ID:srhaber,项目名称:d6migration,代码行数:25,代码来源:import.drush.php


示例16: handle

 /**
  * Implements AcsfEventHandler::handle().
  */
 public function handle()
 {
     drush_print(dt('Entered @class', array('@class' => get_class($this))));
     // Enable any modules that are currently disabled, but were once enabled, so
     // that their data cleanup hooks (e.g. hook_user_delete) and functions
     // (e.g. search_reindex) can be invoked.
     //
     // Note: These modules will all be uninstalled. Uninstalling them should
     // really take care of all the cleanup these modules should be doing. But
     // enable them here for good measure just incase there's some cleanup
     // depending on these hooks.
     require_once DRUPAL_ROOT . '/includes/install.inc';
     $modules = system_rebuild_module_data();
     $enable_for_scrub = array();
     foreach ($modules as $module) {
         // Disabled modules with schema_version > -1 have not been uninstalled.
         if (empty($module->status) && $module->schema_version > SCHEMA_UNINSTALLED) {
             $enable_for_scrub[] = $module->name;
         }
     }
     // Get a list of disabled dependencies. These will get automatically enabled
     // during module_enable(), but we want to be able to disable and uninstall
     // them explicitly later.
     foreach ($enable_for_scrub as $dependent) {
         foreach (array_keys($modules[$dependent]->requires) as $dependency) {
             // Use isset() to make sure the module is still in the filesystem before
             // trying to enable it. (Historically there have been modules in Gardens
             // which were disabled but then removed from the codebase without ever
             // uninstalling them, and we don't want to try to enable those now,
             // because it will fail.)
             if (isset($modules[$dependency]) && empty($modules[$dependency]->status)) {
                 $enable_for_scrub[] = $dependency;
             }
         }
     }
     module_enable($enable_for_scrub);
     acsf_vset('acsf_duplication_enable_for_scrub', $enable_for_scrub, 'acsf_duplication_scrub');
 }
开发者ID:robtryson,项目名称:nysits,代码行数:41,代码来源:AcsfDuplicationScrubModuleEnableHandler.php


示例17: install

 /**
  * @param $config
  *
  * @return mixed
  */
 public function install($config)
 {
     global $installDirPath;
     // create database if does not exists
     $this->createDatabaseIfNotExists($config['mysql']['server'], $config['mysql']['username'], $config['mysql']['password'], $config['mysql']['database']);
     global $installDirPath;
     // Build database
     require_once $installDirPath . 'civicrm.php';
     civicrm_main($config);
     if (!$this->errors) {
         global $installType, $installURLPath;
         $registerSiteURL = "https://civicrm.org/register-site";
         $commonOutputMessage = "<li>" . ts("Have you registered this site at CiviCRM.org? If not, please help strengthen the CiviCRM ecosystem by taking a few minutes to <a %1>fill out the site registration form</a>. The information collected will help us prioritize improvements, target our communications and build the community. If you have a technical role for this site, be sure to check Keep in Touch to receive technical updates (a low volume mailing list).", array(1 => "href='{$registerSiteURL}' target='_blank'")) . "</li>" . "<li>" . ts("We have integrated KCFinder with CKEditor and TinyMCE. This allows a user to upload images. All uploaded images are public.") . "</li>";
         $output = NULL;
         if ($installType == 'drupal' && version_compare(VERSION, '7.0-rc1') >= 0) {
             // clean output
             @ob_clean();
             $output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
             $output .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
             $output .= '<head>';
             $output .= '<title>' . ts('CiviCRM Installed') . '</title>';
             $output .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
             $output .= '<link rel="stylesheet" type="text/css" href="template.css" />';
             $output .= '</head>';
             $output .= '<body>';
             $output .= '<div style="padding: 1em;"><p class="good">' . ts('CiviCRM has been successfully installed') . '</p>';
             $output .= '<ul>';
             $drupalURL = civicrm_cms_base();
             $drupalPermissionsURL = "{$drupalURL}index.php?q=admin/people/permissions";
             $drupalURL .= "index.php?q=civicrm/admin/configtask&reset=1";
             $output .= "<li>" . ts("Drupal user permissions have been automatically set - giving anonymous and authenticated users access to public CiviCRM forms and features. We recommend that you <a %1>review these permissions</a> to ensure that they are appropriate for your requirements (<a %2>learn more...</a>)", array(1 => "target='_blank' href='{$drupalPermissionsURL}'", 2 => "target='_blank' href='http://wiki.civicrm.org/confluence/display/CRMDOC/Default+Permissions+and+Roles'")) . "</li>";
             $output .= "<li>" . ts("Use the <a %1>Configuration Checklist</a> to review and configure settings for your new site", array(1 => "target='_blank' href='{$drupalURL}'")) . "</li>";
             $output .= $commonOutputMessage;
             // automatically enable CiviCRM module once it is installed successfully.
             // so we need to Bootstrap Drupal, so that we can call drupal hooks.
             global $cmsPath, $crmPath;
             // relative / abosolute paths are not working for drupal, hence using chdir()
             chdir($cmsPath);
             // Force the re-initialisation of the config singleton on the next call
             // since so far, we had used the Config object without loading the DB.
             $c = CRM_Core_Config::singleton(FALSE);
             $c->free();
             include_once "./includes/bootstrap.inc";
             include_once "./includes/unicode.inc";
             drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
             // prevent session information from being saved.
             drupal_save_session(FALSE);
             // Force the current user to anonymous.
             $original_user = $GLOBALS['user'];
             $GLOBALS['user'] = drupal_anonymous_user();
             // explicitly setting error reporting, since we cannot handle drupal related notices
             error_reporting(1);
             // rebuild modules, so that civicrm is added
             system_rebuild_module_data();
             // now enable civicrm module.
             module_enable(array('civicrm', 'civicrmtheme'));
             // clear block, page, theme, and hook caches
             drupal_flush_all_caches();
             //add basic drupal permissions
             civicrm_install_set_drupal_perms();
             // restore the user.
             $GLOBALS['user'] = $original_user;
             drupal_save_session(TRUE);
             //change the default language to one chosen
             if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') {
                 civicrm_api3('Setting', 'create', array('domain_id' => 'current_domain', 'lcMessages' => $config['seedLanguage']));
             }
             $output .= '</ul>';
             $output .= '</div>';
             $output .= '</body>';
             $output .= '</html>';
             echo $output;
         } elseif ($installType == 'drupal' && version_compare(VERSION, '6.0') >= 0) {
             // clean output
             @ob_clean();
             $output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
             $output .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
             $output .= '<head>';
             $output .= '<title>' . ts('CiviCRM Installed') . '</title>';
             $output .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
             $output .= '<link rel="stylesheet" type="text/css" href="template.css" />';
             $output .= '</head>';
             $output .= '<body>';
             $output .= '<div style="padding: 1em;"><p class="good">' . ts("CiviCRM has been successfully installed") . '</p>';
             $output .= '<ul>';
             $drupalURL = civicrm_cms_base();
             $drupalPermissionsURL = "{$drupalURL}index.php?q=admin/user/permissions";
             $drupalURL .= "index.php?q=civicrm/admin/configtask&reset=1";
             $output .= "<li>" . ts("Drupal user permissions have been automatically set - giving anonymous and authenticated users access to public CiviCRM forms and features. We recommend that you <a %1>review these permissions</a> to ensure that they are appropriate for your requirements (<a %2>learn more...</a>)", array(1 => "target='_blank' href='{$drupalPermissionsURL}'", 2 => "target='_blank' href='http://wiki.civicrm.org/confluence/display/CRMDOC/Default+Permissions+and+Roles'")) . "</li>";
             $output .= "<li>" . ts("Use the <a %1>Configuration Checklist</a> to review and configure settings for your new site", array(1 => "target='_blank' href='{$drupalURL}'")) . "</li>";
             $output .= $commonOutputMessage;
             // explicitly setting error reporting, since we cannot handle drupal related notices
             error_reporting(1);
             // automatically enable CiviCRM module once it is installed successfully.
             // so we need to Bootstrap Drupal, so that we can call drupal hooks.
//.........这里部分代码省略.........
开发者ID:andrew-cormick-dockery,项目名称:civicrm-core,代码行数:101,代码来源:index.php


示例18: install

 function install($config)
 {
     global $installDirPath;
     // create database if does not exists
     $this->createDatabaseIfNotExists($config['mysql']['server'], $config['mysql']['username'], $config['mysql']['password'], $config['mysql']['database']);
     global $installDirPath;
     // Build database
     require_once $installDirPath . 'civicrm.php';
     civicrm_main($config);
     if (!$this->errors) {
         global $installType, $installURLPath;
         $output = NULL;
         if ($installType == 'drupal' && version_compare(VERSION, '7.0-rc1') >= 0) {
             // clean output
             @ob_clean();
             $output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
             $output .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
             $output .= '<head>';
             $output .= '<title>CiviCRM Installed</title>';
             $output .= '<link rel="stylesheet" type="text/css" href="template.css" />';
             $output .= '</head>';
             $output .= '<body>';
             $output .= '<div style="padding: 1em;"><p class="good">CiviCRM has been successfully installed</p>';
             $output .= '<ul>';
             $docLinkConfig = CRM_Utils_System::docURL2('Configuring a New Site', FALSE, 'here', NULL, NULL, "wiki");
             if (!function_exists('ts')) {
                 $docLinkConfig = "<a href=\"{$docLinkConfig}\">here</a>";
             }
             $drupalURL = civicrm_cms_base();
             $drupalPermissionsURL = "{$drupalURL}index.php?q=admin/people/permissions";
             $drupalURL .= "index.php?q=civicrm/admin/configtask&reset=1";
             $registerSiteURL = "http://civicrm.org/civicrm/profile/create?reset=1&gid=15";
             $output .= "<li>Drupal user permissions have been automatically set - giving anonymous and authenticated users access to public CiviCRM forms and features. We recommend that you <a target='_blank' href={$drupalPermissionsURL}>review these permissions</a> to ensure that they are appropriate for your requirements (<a target='_blank' href='http://wiki.civicrm.org/confluence/display/CRMDOC/Default+Permissions+and+Roles'>learn more...</a>)</li>\n                      <li>Use the <a target='_blank' href=\"{$drupalURL}\">Configuration Checklist</a> to review and configure settings for your new site</li>\n                      <li> Have you registered this site at CiviCRM.org? If not, please help strengthen the CiviCRM ecosystem by taking a few minutes to <a href='{$registerSiteURL}' target='_blank'>fill out the site registration form</a>. The information collected will help us prioritize improvements, target our communications and build the community. If you have a technical role for this site, be sure to check Keep in Touch to receive technical updates (a low volume  mailing list).</li>\n                      <li>We have integrated KCFinder with CKEditor and TinyMCE, which enables user to upload images. Note that all the images uploaded using KCFinder will be public.</li>";
             // automatically enable CiviCRM module once it is installed successfully.
             // so we need to Bootstrap Drupal, so that we can call drupal hooks.
             global $cmsPath, $crmPath;
             // relative / abosolute paths are not working for drupal, hence using chdir()
             chdir($cmsPath);
             include_once "./includes/bootstrap.inc";
             include_once "./includes/unicode.inc";
             drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
             // prevent session information from being saved.
             drupal_save_session(FALSE);
             // Force the current user to anonymous.
             $original_user = $GLOBALS['user'];
             $GLOBALS['user'] = drupal_anonymous_user();
             // explicitly setting error reporting, since we cannot handle drupal related notices
             error_reporting(1);
             // rebuild modules, so that civicrm is added
             system_rebuild_module_data();
             // now enable civicrm module.
             module_enable(array('civicrm', 'civicrmtheme'));
             // clear block and page cache, to make sure civicrm link is present in navigation block
             cache_clear_all();
             //add basic drupal permissions
             civicrm_install_set_drupal_perms();
             // restore the user.
             $GLOBALS['user'] = $original_user;
             drupal_save_session(TRUE);
             $output .= '</ul>';
             $output .= '</div>';
             $output .= '</body>';
             $output .= '</html>';
             echo $output;
         } elseif ($installType == 'drupal' && version_compare(VERSION, '6.0') >= 0) {
             // clean output
             @ob_clean();
             $output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
             $output .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
             $output .= '<head>';
             $output .= '<title>CiviCRM Installed</title>';
             $output .= '<link rel="stylesheet" type="text/css" href="template.css" />';
             $output .= '</head>';
             $output .= '<body>';
             $output .= '<div style="padding: 1em;"><p class="good">CiviCRM has been successfully installed</p>';
             $output .= '<ul>';
             $docLinkConfig = CRM_Utils_System::docURL2('Configuring a New Site', FALSE, 'here', NULL, NULL, "wiki");
             if (!function_exists('ts')) {
                 $docLinkConfig = "<a href=\"{$docLinkConfig}\">here</a>";
             }
             $drupalURL = civicrm_cms_base();
             $drupalPermissionsURL = "{$drupalURL}index.php?q=admin/user/permissions";
             $drupalURL .= "index.php?q=civicrm/admin/configtask&reset=1";
             $registerSiteURL = "http://civicrm.org/civicrm/profile/create?reset=1&gid=15";
             $output .= "<li>Drupal user permissions have been automatically set - giving anonymous and authenticated users access to public CiviCRM forms and features. We recommend that you <a target='_blank' href={$drupalPermissionsURL}>review these permissions</a> to ensure that they are appropriate for your requirements (<a target='_blank' href='http://wiki.civicrm.org/confluence/display/CRMDOC/Default+Permissions+and+Roles'>learn more...</a>)</li>\n                      <li>Use the <a target='_blank' href=\"{$drupalURL}\">Configuration Checklist</a> to review and configure settings for your new site</li>\n                      <li> Have you registered this site at CiviCRM.org? If not, please help strengthen the CiviCRM ecosystem by taking a few minutes to <a href='{$registerSiteURL}' target='_blank'>fill out the site registration form</a>. The information collected will help us prioritize improvements, target our communications and build the community. If you have a technical role for this site, be sure to check Keep in Touch to receive technical updates (a low volume  mailing list).</li>\n                      <li>We have integrated KCFinder with CKEditor and TinyMCE, which enables user to upload images. Note that all the images uploaded using KCFinder will be public.</li>";
             // explicitly setting error reporting, since we cannot handle drupal related notices
             error_reporting(1);
             // automatically enable CiviCRM module once it is installed successfully.
             // so we need to Bootstrap Drupal, so that we can call drupal hooks.
             global $cmsPath, $crmPath;
             // relative / abosolute paths are not working for drupal, hence using chdir()
             chdir($cmsPath);
             include_once "./includes/bootstrap.inc";
             drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
             // rebuild modules, so that civicrm is added
             module_rebuild_cache();
             // now enable civicrm module.
             module_enable(array('civicrm'));
             // clear block and page cache, to make sure civicrm link is present in navigation block
             cache_clear_all();
//.........这里部分代码省略.........
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:101,代码来源:index.php


示例19: setUpInstall

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP module_enabled函数代码示例发布时间:2022-05-15
下一篇:
PHP module_build_privileges函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap