File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ private function stripWhitespace($source)
168
168
169
169
private function getStub ()
170
170
{
171
- return <<<'EOF'
171
+ $ stub = <<<'EOF'
172
172
#!/usr/bin/env php
173
173
<?php
174
174
/*
@@ -183,6 +183,16 @@ private function getStub()
183
183
184
184
Phar::mapPhar('composer.phar');
185
185
186
+ EOF;
187
+
188
+ // add warning once the phar is older than 30 days
189
+ if (preg_match ('{^[a-f0-9]+$} ' , $ this ->version )) {
190
+ $ stub .= 'if (time() > ' .(time ()+30 *86400 ).') { ' .
191
+ "\n echo 'This dev build of composer is outdated, please run \"'. \$argv[0].' self-update \" to get the latest.'.PHP_EOL; " .
192
+ "\n} \n" ;
193
+ }
194
+
195
+ return $ stub .= <<<'EOF'
186
196
require 'phar://composer.phar/bin/composer';
187
197
188
198
__HALT_COMPILER();
You can’t perform that action at this time.
0 commit comments