Skip to content

Commit

Permalink
Fixed for building on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ifsnow committed Jan 12, 2016
1 parent b18140f commit 2eaa47f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions build/_resource/Phalcon/Build/Generator/Safe.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class Generator_Safe
/**
* Generator for config.m4 or config.w32
*
* @var Generator_File_ConfigM4|Generator_File_ConfigW32
* @var array
*/
protected $config;
protected $configs = array();

/**
* Generator for Makefile.frag
Expand All @@ -62,10 +62,10 @@ public function __construct($rootDir, $outputDir)
$this->phalconH = new Generator_File_PhalconH($this->sourceDir, $outputDir);
$this->phalconC = new Generator_File_PhalconC($rootDir, $this->sourceDir, $configDir, $outputDir);

$this->configs[] = new Generator_File_ConfigM4($this->sourceDir, $outputDir);

if (preg_match('/^WIN/', PHP_OS)) {
$this->config = new Generator_File_ConfigW32($this->sourceDir, $outputDir);
} else {
$this->config = new Generator_File_ConfigM4($this->sourceDir, $outputDir);
$this->configs[] = new Generator_File_ConfigW32($this->sourceDir, $outputDir);
}
}

Expand All @@ -89,8 +89,10 @@ protected function generateFiles()
{
$includedHeaderFiles = $this->phalconH->generate();
$this->phalconC->generate($includedHeaderFiles);

$this->config->generate();

foreach($this->configs as $config) {
$config->generate();
}

copy($this->sourceDir . '/php_phalcon.h', $this->outputDir . '/php_phalcon.h');
$this->processKernelGlobals();
Expand Down

0 comments on commit 2eaa47f

Please sign in to comment.