Skip to content

Commit 7bf4c6e

Browse files
Dropbox phar workaround, ugly but working
1 parent a476a1c commit 7bf4c6e

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

build.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<target name="phar-prepare" depends="clean">
104104
<mkdir dir="${basedir}/build/phar"/>
105105

106-
<exec executable="${basedir}/build/phar-manifest.php" output="${basedir}/build/phar/manifest.txt"/>
106+
<exec executable="${basedir}/build/phar-manifest.php" output="${basedir}/build/phar/manifest.txt"/>
107107

108108
<copy file="${basedir}/vendor/dropbox/dropbox-sdk/License.txt" tofile="${basedir}/build/phar/dropbox/LICENSE"/>
109109
<copy todir="${basedir}/build/phar/dropbox">
@@ -155,6 +155,8 @@
155155
</fileset>
156156
</copy>
157157

158+
<exec executable="${basedir}/build/phar-patch.php"/>
159+
158160
</target>
159161

160162

build/phar-patch.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
$patches = array(
5+
array(
6+
'path' => __DIR__ . '/phar/dropbox/Curl.php',
7+
'search' => array('$this->set(CURLOPT_CAINFO', '$this->set(CURLOPT_CAPATH'),
8+
'replace' => array('//$this->set(CURLOPT_CAINFO', '//$this->set(CURLOPT_CAPATH'),
9+
),
10+
);
11+
12+
foreach ( $patches as $file ) {
13+
echo 'patching file: ' . $file['path'] . "...";
14+
file_put_contents(
15+
$file['path'],
16+
str_replace(
17+
$file['search'],
18+
$file['replace'],
19+
file_get_contents($file['path'])
20+
)
21+
);
22+
echo ' done' . PHP_EOL;
23+
};

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
"sebastian/version": "~1.0",
3535
"swiftmailer/swiftmailer": "5.3.*"
3636
},
37-
"require-dev": {
38-
"squizlabs/php_codesniffer": "1.*"
39-
},
4037
"bin": [
4138
"phpbu"
4239
],

0 commit comments

Comments
 (0)