mirror of
				https://github.com/slawkens/myaac.git
				synced 2025-10-31 16:06:24 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			824 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			824 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| #!/usr/bin/env php
 | |
| <?php
 | |
| 
 | |
| require_once __DIR__ . '/common.php';
 | |
| 
 | |
| if(!IS_CLI) {
 | |
| 	echo 'This script can be run only in command line mode.';
 | |
| 	exit(1);
 | |
| }
 | |
| 
 | |
| require_once SYSTEM . 'functions.php';
 | |
| 
 | |
| define('SELF_NAME', basename(__FILE__));
 | |
| 
 | |
| use MyAAC\Plugins;
 | |
| use Symfony\Component\Console\Application;
 | |
| 
 | |
| $application = new Application('MyAAC', MYAAC_VERSION);
 | |
| 
 | |
| $commandsGlob = glob(SYSTEM . 'src/Commands/*.php');
 | |
| foreach ($commandsGlob as $item) {
 | |
| 	$name = pathinfo($item, PATHINFO_FILENAME);
 | |
| 	if ($name == 'Command') { // ignore base Command class
 | |
| 		continue;
 | |
| 	}
 | |
| 
 | |
| 	$commandPre = '\\MyAAC\Commands\\';
 | |
| 	if (!trait_exists($class = $commandPre . $name)) {
 | |
| 		$application->add(new $class);
 | |
| 	}
 | |
| }
 | |
| 
 | |
| $pluginCommands = Plugins::getCommands();
 | |
| foreach ($pluginCommands as $item) {
 | |
| 	$application->add(require $item);
 | |
| }
 | |
| 
 | |
| $application->run();
 | 
