File tree Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -281,13 +281,26 @@ unset COMPOSER_GITHUB_OAUTH_TOKEN
281
281
# install dependencies
282
282
composer install --no-dev --prefer-dist --optimize-autoloader --no-interaction | indent
283
283
284
+ # hack cache for all envs
285
+ status " Hacking symfony's cache"
284
286
BUILD_DIR=$1
285
287
APP_DIR=' /app'
288
+ BUILDPACK_DIRS=$( find /tmp/buildpack* -maxdepth 0 -type d)
289
+ # in the case of multipack
290
+ for pack in $BUILDPACK_DIRS ; do
291
+ if [ -f " $pack /bin/fix-metadata-paths" ]; then
292
+ buildpack=$pack
293
+ fi
294
+ done
295
+
296
+ for CACHE_ENV in dev prod; do
297
+ for metadata_file in $( find $BUILD_DIR /app/cache/$CACHE_ENV /jms_* -type f -name * .cache.php -not -name EnhancedProxy* ) ; do
298
+ php $buildpack /bin/fix-metadata-paths $BUILD_DIR $APP_DIR $metadata_file
299
+ done
300
+
301
+ find $BUILD_DIR /app/cache/$CACHE_ENV -type f -not -name * .cache.php -exec sed -i " s@$BUILD_DIR @$APP_DIR @g" {} \; | indent
302
+ done
286
303
287
- # hack cache for all envs
288
- # for CACHE_ENV in prod dev 'test'; do
289
- # rm $BUILD_DIR/app/cache/$CACHE_ENV/jms_diextra/ -rf
290
- # done
291
304
composer show --installed heroku/heroku-buildpack-php & > /dev/null && error " Your composer.json requires package 'heroku/heroku-buildpack-php'.
292
305
This package may only be used as a dev dependency (in 'require-dev')!"
293
306
Original file line number Diff line number Diff line change
1
+ <?php
2
+ $buildDir = $argv[1];
3
+ $appDir = $argv[2];
4
+ $metadataFile = $argv[3];
5
+
6
+ require $buildDir . '/vendor/autoload.php';
7
+ $instance = require $metadataFile;
8
+ if (!is_object($instance)) {
9
+ echo 'Could not instance serialized data from : ' . $metadataFile . PHP_EOL;
10
+
11
+ } else {
12
+ $fileResources = $instance->fileResources;
13
+
14
+ foreach ($fileResources as $i => $fileResource) {
15
+ $fileResources[$i] = str_replace($buildDir, $appDir, $fileResource);
16
+ }
17
+ $instance->fileResources = $fileResources;
18
+
19
+ $serialized = $instance->serialize();
20
+ file_put_contents($metadataFile, $serialized);
21
+ }
You can’t perform that action at this time.
0 commit comments