mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	
		
			
	
	
		
			28 lines
		
	
	
		
			716 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			28 lines
		
	
	
		
			716 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								class Mage_Task_BuiltIn_Deployment_Rsync
							 | 
						||
| 
								 | 
							
								    extends Mage_Task_TaskAbstract
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    public function getName()
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        return 'Rsync (built-in)';
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    public function run($config)
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        $ignores = array(
							 | 
						||
| 
								 | 
							
								            '--exclude .git',
							 | 
						||
| 
								 | 
							
								            '--exclude .svn',
							 | 
						||
| 
								 | 
							
								            '--exclude .mage',
							 | 
						||
| 
								 | 
							
								            '--exclude .gitignore'
							 | 
						||
| 
								 | 
							
								        );
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        $command = 'rsync -avz '
							 | 
						||
| 
								 | 
							
								                 . implode(' ', $ignores) .' '
							 | 
						||
| 
								 | 
							
								                 . $config['deploy']['deploy-from'] . ' '
							 | 
						||
| 
								 | 
							
								                 . $config['deploy']['user'] . '@' . $config['deploy']['host'] . ':' . $config['deploy']['deploy-to'];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        $result = $this->_runLocalCommand($command);
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        return $result;
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |