src/FS/File/INI/Editor.php
public function renameProperty( $key, $new, $section = NULL )
	{
		if( $this->usesSections() )
		{
			if( !$this->hasProperty( $key, $section ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing in section "'.$section.'"' );
			$this->properties[$section][$new]	= $this->properties[$section][$key];
			if( isset( $this->disabled[$section][$key] ) )
				$this->disabled [$section][$new]		= $this->disabled[$section][$key];
			if( isset( $this->comments[$section][$key] ) )
				$this->comments [$section][$new]	= $this->comments[$section][$key];
			$this->renamed[$section][$key] = $new;
			return is_int( $this->write() );
		}
		else
		{
			if( !$this->hasProperty( $key ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing' );
			$this->properties[$new]	= $this->properties[$key];
			if( isset( $this->disabled[$key] ) )
				$this->disabled[$new]		= $this->disabled[$key];
			if( isset( $this->comments[$key] ) )
				$this->comments[$new]	= $this->comments[$key];
			$this->renamed[$key]	= $new;
			return is_int( $this->write() );
		}
	}
public function renameProperty( $key, $new, $section = NULL )
	{
		if( $this->usesSections() )
		{
			if( !$this->hasProperty( $key, $section ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing in section "'.$section.'"' );
			$this->properties[$section][$new]	= $this->properties[$section][$key];
			if( isset( $this->disabled[$section][$key] ) )
				$this->disabled [$section][$new]		= $this->disabled[$section][$key];
			if( isset( $this->comments[$section][$key] ) )
				$this->comments [$section][$new]	= $this->comments[$section][$key];
			$this->renamed[$section][$key] = $new;
			return is_int( $this->write() );
		}
		else
		{
			if( !$this->hasProperty( $key ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing' );
			$this->properties[$new]	= $this->properties[$key];
			if( isset( $this->disabled[$key] ) )
				$this->disabled[$new]		= $this->disabled[$key];
			if( isset( $this->comments[$key] ) )
				$this->comments[$new]	= $this->comments[$key];
			$this->renamed[$key]	= $new;
			return is_int( $this->write() );
		}
	}
public function renameProperty ( $ key , $ new , $ section = NULL ) { if ( $ this -> usesSections ( ) ) { if ( ! $ this -> hasProperty ( $ key , $ section ) ) throw new InvalidArgumentException ( 'Key "' . $ key . '" is not existing in section "' . $ section . '"' ) ; $ this -> properties [ $ section ] [ $ new ] = $ this -> properties [ $ section ] [ $ key ] ; if ( isset ( $ this -> disabled [ $ section ] [ $ key ] ) ) $ this -> disabled [ $ section ] [ $ new ] = $ this -> disabled [ $ section ] [ $ key ] ; if ( isset ( $ this -> comments [ $ section ] [ $ key ] ) ) $ this -> comments [ $ section ] [ $ new ] = $ this -> comments [ $ section ] [ $ key ] ; $ this -> renamed [ $ section ] [ $ key ] = $ new ; return is_int ( $ this -> write ( ) ) ; } else { if ( ! $ this -> hasProperty ( $ key ) ) throw new InvalidArgumentException ( 'Key "' . $ key . '" is not existing' ) ; $ this -> properties [ $ new ] = $ this -> properties [ $ key ] ; if ( isset ( $ this -> disabled [ $ key ] ) ) $ this -> disabled [ $ new ] = $ this -> disabled [ $ key ] ; if ( isset ( $ this -> comments [ $ key ] ) ) $ this -> comments [ $ new ] = $ this -> comments [ $ key ] ; $ this -> renamed [ $ key ] = $ new ; return is_int ( $ this -> write ( ) ) ; } }
Renames a Property Key.
@access		public
@param		string		$key			Key of Property to rename
@param		string		$new			New Key of Property
@param		string		$section		Section of Property
@return		bool
Renames a Property Key .