29 lines
		
	
	
		
			641 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			641 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace kernel\console\controllers;
 | |
| 
 | |
| use app\helpers\Debug;
 | |
| use kernel\console\ConsoleController;
 | |
| use ZipArchive;
 | |
| 
 | |
| class AdminTheme extends ConsoleController
 | |
| {
 | |
| 
 | |
|     public function actionInstallTheme()
 | |
|     {
 | |
|         if (!isset($this->argv['path'])) {
 | |
|             throw new \Exception('Missing admin theme path "--path" specified');
 | |
|         }
 | |
| 
 | |
|         $zip = new ZipArchive;
 | |
|         $res = $zip->open(ROOT_DIR . $this->argv['path']);
 | |
|         if ($res === TRUE) {
 | |
|             $zip->extractTo(RESOURCES_DIR . '/tmp/ad/');
 | |
|             $zip->close();
 | |
|             echo 'woot!';
 | |
|         } else {
 | |
|             echo 'doh!';
 | |
|         }
 | |
|     }
 | |
| 
 | |
| } |