Skip to content

Commit ee9a514

Browse files
authored
Fixing borken build (#77)
* fixing broken build * Add phpconfig.ini to enable php extensions Hopefully this change will fix the Travis issues. * better install extensions * Added better installation of extension * Syntax fix * Enable memcache * typo * Do not run memcache on PHP 7+
1 parent b9c9c95 commit ee9a514

File tree

7 files changed

+52
-9
lines changed

7 files changed

+52
-9
lines changed

.travis.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
language: php
2-
sudo: false
2+
sudo: required
3+
dist: trusty
34

45
services:
56
- redis-server
67
- memcached
78
- memcache
9+
- mongodb
10+
11+
addons:
12+
apt:
13+
sources:
14+
- mongodb-3.2-trusty
15+
packages:
16+
- mongodb-org-server
817

918
cache:
1019
directories:
@@ -56,6 +65,7 @@ matrix:
5665
- env: STABILITY="dev"
5766

5867
before_install:
68+
- sh ./.travis/load_php_extensions.sh
5969
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
6070
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
6171
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;

.travis/load_php_extensions.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Add php.ini settings"
4+
phpenv config-add ./.travis/php.ini
5+
6+
if [ $(phpenv version-name) = "5.6" ]; then
7+
# PHP 5.6
8+
echo "Install APC Adapter & APCu Adapter dependencies"
9+
yes '' | pecl install -f apcu-4.0.11
10+
11+
echo "Install redis"
12+
yes '' | pecl install -f redis-2.2.8
13+
14+
echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
15+
echo "memcache.enabled=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
16+
echo "memcache.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
17+
else
18+
# PHP 7.0
19+
echo "Install APCu Adapter dependencies"
20+
yes '' | pecl install -f apcu-5.1.8
21+
22+
echo "Install redis"
23+
yes '' | pecl install -f redis-3.0.0
24+
fi

.travis/php.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apc.enabled=1
2+
apc.enable_cli=1
3+
apc.use_request_time=0
4+
5+
extension = memcached.so
6+
7+

.travis/phpconfig.ini

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/Functional/BundleInitializationTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ public function testMemcacheWithWithDefaultConfiguration()
7575
if (!class_exists('Memcache')) {
7676
$this->markTestSkipped('Skipping since Memcache is not installed.');
7777
}
78+
79+
$kernel = $this->createKernel();
80+
$kernel->addConfigFile(__DIR__.'/config_memcache.yml');
81+
7882
$this->bootKernel();
7983
$container = $this->getContainer();
8084
$this->assertInstanceOf(MemcacheCachePool::class, $container->get('cache.provider.memcache'));

tests/Functional/config.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ cache_adapter:
1515
factory: 'cache.factory.chain'
1616
options:
1717
services: ['alias.my_adapter', 'cache.provider.void']
18-
memcache:
19-
factory: 'cache.factory.memcache'
2018
memcached:
2119
factory: 'cache.factory.memcached'
2220
predis:
@@ -32,8 +30,6 @@ cache_adapter:
3230
directory: 'doctrine_file'
3331
doctrine_memcached:
3432
factory: 'cache.factory.doctrine_memcached'
35-
doctrine_memcache:
36-
factory: 'cache.factory.doctrine_memcache'
3733
doctrine_predis:
3834
factory: 'cache.factory.doctrine_predis'
3935
doctrine_redis:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cache_adapter:
2+
providers:
3+
memcache:
4+
factory: 'cache.factory.memcache'
5+
doctrine_memcache:
6+
factory: 'cache.factory.doctrine_memcache'

0 commit comments

Comments
 (0)