src/PhpConsole/Connector.php
public function setAllowedIpMasks(array $ipMasks) {
		if($this->isActiveClient()) {
			if(isset($_SERVER['REMOTE_ADDR'])) {
				$ip = $_SERVER['REMOTE_ADDR'];
				foreach($ipMasks as $ipMask) {
					if(preg_match('~^' . str_replace(array('.', '*'), array('\.', '\w+'), $ipMask) . '$~i', $ip)) {
						return;
					}
				}
			}
			$this->disable();
		}
	}
public function setAllowedIpMasks(array $ipMasks) {
		if($this->isActiveClient()) {
			if(isset($_SERVER['REMOTE_ADDR'])) {
				$ip = $_SERVER['REMOTE_ADDR'];
				foreach($ipMasks as $ipMask) {
					if(preg_match('~^' . str_replace(array('.', '*'), array('\.', '\w+'), $ipMask) . '$~i', $ip)) {
						return;
					}
				}
			}
			$this->disable();
		}
	}
public function setAllowedIpMasks ( array $ ipMasks ) { if ( $ this -> isActiveClient ( ) ) { if ( isset ( $ _SERVER [ 'REMOTE_ADDR' ] ) ) { $ ip = $ _SERVER [ 'REMOTE_ADDR' ] ; foreach ( $ ipMasks as $ ipMask ) { if ( preg_match ( '~^' . str_replace ( array ( '.' , '*' ) , array ( '\.' , '\w+' ) , $ ipMask ) . '$~i' , $ ip ) ) { return ; } } } $ this -> disable ( ) ; } }
Set IP masks of clients that will be allowed to connect to PHP Console
@param array $ipMasks Use *(star character) for "any numbers" placeholder array('192.168.*.*', '10.2.12*.*', '127.0.0.1', '2001:0:5ef5:79fb:*:*:*:*')
Set IP masks of clients that will be allowed to connect to PHP Console