protected function normalizePermissions($permissions)
	{
		// remove the type identifier
		$permissions = substr($permissions, 1);

		// map the string rights to the numeric counterparts
		$map = array(
			'-' => '0',
			'r' => '4',
			'w' => '2',
			'x' => '1'
		);
		$permissions = strtr($permissions, $map);

		// split up the permission groups
		$parts = str_split($permissions, 3);

		// convert the groups
		$mapper = function ($part)
		{
			return array_sum(str_split($part));
		};

		// get the sum of the groups
		return array_sum(array_map($mapper, $parts));
	}
protected function normalizePermissions($permissions)
	{
		// remove the type identifier
		$permissions = substr($permissions, 1);

		// map the string rights to the numeric counterparts
		$map = array(
			'-' => '0',
			'r' => '4',
			'w' => '2',
			'x' => '1'
		);
		$permissions = strtr($permissions, $map);

		// split up the permission groups
		$parts = str_split($permissions, 3);

		// convert the groups
		$mapper = function ($part)
		{
			return array_sum(str_split($part));
		};

		// get the sum of the groups
		return array_sum(array_map($mapper, $parts));
	}
protected function normalizePermissions ( $ permissions ) { // remove the type identifier $ permissions = substr ( $ permissions , 1 ) ; // map the string rights to the numeric counterparts $ map = array ( '-' => '0' , 'r' => '4' , 'w' => '2' , 'x' => '1' ) ; $ permissions = strtr ( $ permissions , $ map ) ; // split up the permission groups $ parts = str_split ( $ permissions , 3 ) ; // convert the groups $ mapper = function ( $ part ) { return array_sum ( str_split ( $ part ) ) ; } ; // get the sum of the groups return array_sum ( array_map ( $ mapper , $ parts ) ) ; }
Normalize a permissions string.

@param   string  $permissions
@return  int
Normalize a permissions string .