src/FS/File/INI/Editor.php
public function renameSection( $oldSection, $newSection )
	{
		if( !$this->usesSections() )
			throw new RuntimeException( 'Sections are disabled' );
		$content	= FS_File_Reader::load( $this->fileName );
		$content	= preg_replace( "/(.*)(\[".$oldSection."\])(.*)/si", "$1[".$newSection."]$3", $content );
		$result		= FS_File_Writer::save( $this->fileName, $content );
		$this->added	= array();
		$this->deleted	= array();
		$this->renamed	= array();
		$this->read();
		return is_int( $result );
	}
public function renameSection( $oldSection, $newSection )
	{
		if( !$this->usesSections() )
			throw new RuntimeException( 'Sections are disabled' );
		$content	= FS_File_Reader::load( $this->fileName );
		$content	= preg_replace( "/(.*)(\[".$oldSection."\])(.*)/si", "$1[".$newSection."]$3", $content );
		$result		= FS_File_Writer::save( $this->fileName, $content );
		$this->added	= array();
		$this->deleted	= array();
		$this->renamed	= array();
		$this->read();
		return is_int( $result );
	}
public function renameSection ( $ oldSection , $ newSection ) { if ( ! $ this -> usesSections ( ) ) throw new RuntimeException ( 'Sections are disabled' ) ; $ content = FS_File_Reader :: load ( $ this -> fileName ) ; $ content = preg_replace ( "/(.*)(\[" . $ oldSection . "\])(.*)/si" , "$1[" . $ newSection . "]$3" , $ content ) ; $ result = FS_File_Writer :: save ( $ this -> fileName , $ content ) ; $ this -> added = array ( ) ; $ this -> deleted = array ( ) ; $ this -> renamed = array ( ) ; $ this -> read ( ) ; return is_int ( $ result ) ; }
Renames as Section.
@access		public
@param		string		$oldSection		Key of Section to rename
@param		string		$newSection		New Key of Section
@return		bool
Renames as Section .