mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Tweaks on Compiler.
This commit is contained in:
		
							parent
							
								
									ee0bc27bc7
								
							
						
					
					
						commit
						4f60b89e31
					
				@ -28,11 +28,14 @@ class CompileCommand extends AbstractCommand
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public function run ()
 | 
					    public function run ()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Console::output('Compiling <dark_gray>Magallanes</dark_gray>... ', 1, 0);
 | 
					    	if (ini_get('phar.readonly')) {
 | 
				
			||||||
 | 
						    	Console::output('The <purple>php.ini</purple> variable <light_red>phar.readonly</light_red> must be enabled.', 1, 2);
 | 
				
			||||||
 | 
					    		return;
 | 
				
			||||||
 | 
					    	}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $compiler = new Compiler;
 | 
					        $compiler = new Compiler;
 | 
				
			||||||
        $compiler->compile();
 | 
					        $compiler->compile();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Console::output('Mage compiled successfully');
 | 
					        Console::output('<light_purple>mage.phar</light_purple> compiled <light_green>successfully</light_green>', 0, 2);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -46,10 +46,14 @@ class Compiler
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $binary = file(__DIR__.'/../bin/mage');
 | 
				
			||||||
 | 
					        unset($binary[0]);
 | 
				
			||||||
 | 
					        $binary = implode(PHP_EOL, $binary);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $phar->addFromString('mage', str_replace(
 | 
					        $phar->addFromString('mage', str_replace(
 | 
				
			||||||
            '$baseDir = dirname(dirname(__FILE__));',
 | 
					            '$baseDir = dirname(dirname(__FILE__));',
 | 
				
			||||||
            '$baseDir = __DIR__;',
 | 
					            '$baseDir = __DIR__;',
 | 
				
			||||||
            file_get_contents(__DIR__.'/../bin/mage')
 | 
					    		$binary
 | 
				
			||||||
        ));
 | 
					        ));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $phar->setStub("#!/usr/bin/env php\n<?php Phar::mapPhar('mage.phar'); require 'phar://mage.phar/mage'; __HALT_COMPILER();");
 | 
					        $phar->setStub("#!/usr/bin/env php\n<?php Phar::mapPhar('mage.phar'); require 'phar://mage.phar/mage'; __HALT_COMPILER();");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user