Skip to content
Snippets Groups Projects
Commit 47dc4c52 authored by Jared Hancock's avatar Jared Hancock
Browse files

deploy: Fix incorrectly deployed INCLUDE_DIR define

parent 44055139
No related branches found
No related tags found
No related merge requests found
...@@ -197,21 +197,22 @@ class Unpacker extends Module { ...@@ -197,21 +197,22 @@ class Unpacker extends Module {
if (isset($location)) if (isset($location))
return $location; return $location;
$bootstrap_php = $this->destination . '/bootstrap.php'; $pipes = array();
if (!is_file($bootstrap_php)) $php = proc_open('php', array(
return @$this->include_path ?: ''; 0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
$lines = preg_grep("/define\s*\(\s*'INCLUDE_DIR'/", ), $pipes);
explode("\n", file_get_contents($bootstrap_php)));
fwrite($pipes[0], "<?php
// NOTE: that this won't work for crafty folks who have a define or some include '{$this->destination}/bootstrap.php';
// variable in the value of their include path print INCLUDE_DIR;
if (!defined('ROOT_DIR')) ");
define('ROOT_DIR', rtrim($this->destination, '/').'/'); fclose($pipes[0]);
foreach ($lines as $line)
@eval($line); $INCLUDE_DIR = fread($pipes[1], 8192);
proc_close($php);
return $location = rtrim(INCLUDE_DIR, '/').'/';
return $location = rtrim($INCLUDE_DIR, '/').'/';
} }
function run($args, $options) { function run($args, $options) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment