Skip to content

Commit 427a0c5

Browse files
authored
Merge pull request #10 from dennisinteractive/27188_memcache
Fixed memcache template
2 parents 803203f + 3f468ed commit 427a0c5

File tree

4 files changed

+12
-61
lines changed

4 files changed

+12
-61
lines changed

src/Command/SiteBaseCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected function _validateProfile(InputInterface $input) {
214214
$this->profile = $input->getArgument('profile');
215215
}
216216
elseif (isset($this->config['profile'])) {
217-
// Use config from sites.yml.
217+
// Use config from ~/.console/sites/{site}.yml.
218218
$this->profile = $this->config['profile'];
219219
}
220220
else {

src/Command/SiteCheckoutCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,12 @@ protected function gitClone($branch, $repo, $destination) {
276276
* @throws SiteCommandException
277277
*/
278278
protected function gitCheckout($branch, $destination) {
279-
$command = sprintf('cd %s && git fetch --all && git checkout %s',
279+
$command = sprintf(
280+
'cd %s && ' .
281+
'git fetch --all && ' .
282+
'chmod 777 web/sites/default && ' .
283+
'chmod 777 web/sites/default/settings.php && ' .
284+
'git checkout %s ',
280285
$this->shellPath($destination),
281286
$branch
282287
);

src/Command/SiteDbImportCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
226226
else {
227227
throw new SiteCommandException($shellProcess->getOutput());
228228
}
229+
229230
}
230231
}

src/Command/SiteSettingsMemcacheCommand.php

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -87,65 +87,10 @@ protected function execute(InputInterface $input, OutputInterface $output) {
8787

8888
$content = <<<EOF
8989
<?php
90-
//@TODO These memcache settings are for D7.
91-
/**
92-
* Memcache Settings.
93-
*/
94-
include_once('./includes/cache.inc');
95-
include_once('./profiles/dennis_distro/modules/contrib/memcache/memcache.inc');
96-
97-
// uncomment the line below to disable caching
98-
// \$conf['cachestatus'] = 1;
99-
100-
if ((isset(\$conf['cachestatus'])) && (\$conf['cachestatus'] > 0)) {
101-
\$conf['cache_backends'][] = 'includes/cache-install.inc';
102-
// Default to throwing away cache data
103-
\$conf['cache_default_class'] = 'DrupalFakeCache';
104-
// Rely on the DB cache for form caching - otherwise forms fail.
105-
\$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
106-
// Rely on the external cache for page caching.
107-
\$conf['cache_class_cache_page'] = 'DrupalFakeCache';
108-
}
109-
else {
110-
\$conf['cache_default_class'] = 'MemCacheDrupal';
111-
\$conf['memcache_key_prefix'] = '$memcache_prefix';
112-
\$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
113-
\$conf['cache_class_cache_update'] ='DrupalDatabaseCache';
114-
115-
\$conf['memcache_servers'] = array(
116-
'127.0.0.1:11211' => 'default',
117-
'127.0.0.1:11212' => 'menu',
118-
'127.0.0.1:11213' => 'filter',
119-
'127.0.0.1:11214' => 'form',
120-
'127.0.0.1:11215' => 'block',
121-
'127.0.0.1:11216' => 'update',
122-
'127.0.0.1:11217' => 'views',
123-
'127.0.0.1:11218' => 'viewsdata',
124-
'127.0.0.1:11219' => 'apachesolr',
125-
'127.0.0.1:11220' => 'path',
126-
'127.0.0.1:11221' => 'field',
127-
'127.0.0.1:11222' => 'rules',
128-
'127.0.0.1:11223' => 'token',
129-
'127.0.0.1:11224' => 'image',
130-
);
131-
132-
\$conf['memcache_bins'] = array(
133-
'cache' => 'default',
134-
'cache_menu' => 'menu',
135-
'cache_filter' => 'filter',
136-
'cache_form' => 'form',
137-
'cache_block' => 'block',
138-
'cache_update' => 'update',
139-
'cache_views' => 'views',
140-
'cache_views_data' => 'viewsdata',
141-
'cache_apachesolr' => 'apachesolr',
142-
'cache_path' => 'path',
143-
'cache_field' => 'field',
144-
'cache_rules' => 'rules',
145-
'cache_token' => 'token',
146-
'cache_image' => 'image',
147-
);
148-
}
90+
\$settings['memcache']['servers'] = ['127.0.0.1:11211' => 'default'];
91+
\$settings['memcache']['bins'] = ['default' => 'default'];
92+
\$settings['memcache']['key_prefix'] = '$memcache_prefix';
93+
\$settings['memcache']['stampede_protection'] = TRUE;
14994
EOF;
15095

15196
$this->filePutContents($file, $content);

0 commit comments

Comments
 (0)