public function status()
	{
		// Use 'porcelain' argument for consistent formatting of output
		$arguments = array('--porcelain');
		$status    = $this->call('status', $arguments);
		$response  = '';

		if (!empty($status))
		{
			$status = trim($status);
			$lines  = explode("\n", $status);

			$response = array(
				'added'     => array(),
				'modified'  => array(),
				'deleted'   => array(),
				'renamed'   => array(),
				'copied'    => array(),
				'untracked' => array(),
				'unmerged'  => array(),
				'merged'    => array()
			);
			foreach ($lines as $line)
			{
				$line  = trim($line);
				preg_match('/([A|D|M|U|R|C|?]{1,2})[ ]{1,2}([[:alnum:]_\-\.\/]*)/', $line, $parts);

				if (strlen($parts[1]) == 2 && $parts[1] != '??' && $parts[1] != 'UU')
				{
					$parts[1] = 'merged';
				}

				switch ($parts[1])
				{
					case 'A':
						$response['added'][] = $parts[2];
						break;
					case 'D':
						$response['deleted'][] = $parts[2];
						break;
					case 'M':
						$response['modified'][] = $parts[2];
						break;
					case 'R':
						$response['renamed'][] = $parts[2];
						break;
					case 'C':
						$response['copied'][] = $parts[2];
						break;
					case 'UU':
						$response['unmerged'][] = $parts[2];
						break;
					case '??':
						$response['untracked'][] = $parts[2];
						break;
					case 'merged':
						$response['merged'][] = $parts[2];
						break;
				}
			}
		}

		return $response;
	}
public function status()
	{
		// Use 'porcelain' argument for consistent formatting of output
		$arguments = array('--porcelain');
		$status    = $this->call('status', $arguments);
		$response  = '';

		if (!empty($status))
		{
			$status = trim($status);
			$lines  = explode("\n", $status);

			$response = array(
				'added'     => array(),
				'modified'  => array(),
				'deleted'   => array(),
				'renamed'   => array(),
				'copied'    => array(),
				'untracked' => array(),
				'unmerged'  => array(),
				'merged'    => array()
			);
			foreach ($lines as $line)
			{
				$line  = trim($line);
				preg_match('/([A|D|M|U|R|C|?]{1,2})[ ]{1,2}([[:alnum:]_\-\.\/]*)/', $line, $parts);

				if (strlen($parts[1]) == 2 && $parts[1] != '??' && $parts[1] != 'UU')
				{
					$parts[1] = 'merged';
				}

				switch ($parts[1])
				{
					case 'A':
						$response['added'][] = $parts[2];
						break;
					case 'D':
						$response['deleted'][] = $parts[2];
						break;
					case 'M':
						$response['modified'][] = $parts[2];
						break;
					case 'R':
						$response['renamed'][] = $parts[2];
						break;
					case 'C':
						$response['copied'][] = $parts[2];
						break;
					case 'UU':
						$response['unmerged'][] = $parts[2];
						break;
					case '??':
						$response['untracked'][] = $parts[2];
						break;
					case 'merged':
						$response['merged'][] = $parts[2];
						break;
				}
			}
		}

		return $response;
	}
public function status ( ) { // Use 'porcelain' argument for consistent formatting of output $ arguments = array ( '--porcelain' ) ; $ status = $ this -> call ( 'status' , $ arguments ) ; $ response = '' ; if ( ! empty ( $ status ) ) { $ status = trim ( $ status ) ; $ lines = explode ( "\n" , $ status ) ; $ response = array ( 'added' => array ( ) , 'modified' => array ( ) , 'deleted' => array ( ) , 'renamed' => array ( ) , 'copied' => array ( ) , 'untracked' => array ( ) , 'unmerged' => array ( ) , 'merged' => array ( ) ) ; foreach ( $ lines as $ line ) { $ line = trim ( $ line ) ; preg_match ( '/([A|D|M|U|R|C|?]{1,2})[ ]{1,2}([[:alnum:]_\-\.\/]*)/' , $ line , $ parts ) ; if ( strlen ( $ parts [ 1 ] ) == 2 && $ parts [ 1 ] != '??' && $ parts [ 1 ] != 'UU' ) { $ parts [ 1 ] = 'merged' ; } switch ( $ parts [ 1 ] ) { case 'A' : $ response [ 'added' ] [ ] = $ parts [ 2 ] ; break ; case 'D' : $ response [ 'deleted' ] [ ] = $ parts [ 2 ] ; break ; case 'M' : $ response [ 'modified' ] [ ] = $ parts [ 2 ] ; break ; case 'R' : $ response [ 'renamed' ] [ ] = $ parts [ 2 ] ; break ; case 'C' : $ response [ 'copied' ] [ ] = $ parts [ 2 ] ; break ; case 'UU' : $ response [ 'unmerged' ] [ ] = $ parts [ 2 ] ; break ; case '??' : $ response [ 'untracked' ] [ ] = $ parts [ 2 ] ; break ; case 'merged' : $ response [ 'merged' ] [ ] = $ parts [ 2 ] ; break ; } } } return $ response ; }
Get the status of the repository

@return  string
Get the status of the repository