rfc:namespaces-for-internal-classes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rfc:namespaces-for-internal-classes [2008/06/17 18:48]
lstrojny Adding new names
rfc:namespaces-for-internal-classes [2017/09/22 13:28]
Line 1: Line 1:
-====== Request for Comments: How to write RFCs ====== 
-  * Version: 1.0 
-  * Date: 2008-03-06 
-  * Author: Lars Strojny <lstrojny@php.net> 
-  * Status: Work in progress 
-  * First Published at: none 
- 
-===== Introduction ===== 
- 
-This RFC discusses the transition to real namespaces for internal classes in e.g. ext/spl. 
- 
-==== Why should we use namespaces for internal classes? ==== 
- 
-Currently internal classes are inconsistently named. Just take a look at SPL: 
-  * RecursiveIterator 
-  * RecursiveIteratorIterator 
-  * RecursiveRegexIterator 
-  * RegexIterator 
-  * RuntimeException 
-  * SeekableIterator 
-  * SimpleXMLIterator 
-  * SplFileInfo 
-  * SplFileObject 
-  * SplObjectStorage 
-  * SplObserver 
- 
-Some of the classes in ext/spl are prefixed with "Spl", some are not. To avoid naming collisions and as a structural element, namespaces were introduced in PHP 5.3. This gives us a chance to move all the Spl-classes in appropriate namespaces. Take a look at the following transitions: 
- 
-  * RecursiveIterator: Spl::Iterator::Recursive 
-  * RecursiveIteratorIterator: Spl::Iterator::Recursive::Iterator 
-  * RecursiveRegexIterator: Spl::Iterator::Recursive::RegexIterator 
-  * RegexIterator: Spl::Iterator::Regex 
-  * RuntimeException: Spl::Exception::Runtime 
-  * SimpleXMLIterator: Spl::Iterator::SimpleXML 
-  * SplObserver: Spl::Observer::Observer 
-  * SplSubject: Spl::Observer::Subject 
-  * SplFileInfo: Spl::File::Info 
-  * SplFileObject: Spl::File::Object 
-  * SeekableIterator: Spl::Iterator::Seekable 
- 
-===== List of renamed classes ===== 
-^ Current name        ^ New name ^ 
-| AppendIterator      | Spl::Iterator::Append | 
-| ArrayIterator      | Spl::Iterator::Array | 
-| ArrayObject      | Spl::Array::Object | 
-| SplDoublyLinkedList      |Spl::List::DoublyLinked | 
-| SplQueue      | Spl::List::Queue | 
-| SplStack      | Spl::List::Stack | 
-| SplHeap      | Spl::List::Heap | 
-| SplMinHeap      | Spl::List::MinHeap | 
-| SplMaxHeap      | Spl::List::MaxHeap | 
-| SplPriorityQueue      | Spl::List::PriorityQueue | 
-| SplFastArray      | Spl::Array::Fast | 
-| BadFunctionCallException      | Spl::Exception::BadFunctionCall | 
-| BadMethodCallException      | Spl::Exception::BadMethodCall | 
-| CachingIterator      | Spl::Iterator::Caching | 
-| Countable      | Spl::Countable | 
-| DirectoryIterator      | Spl::Iterator::Directory | 
-| DomainException      | Spl::Exception::Domain | 
-| EmptyIterator      | Spl::Iterator::Empty | 
-| FilesystemIterator      | Spl::Iterator::Filesystem | 
-| FilterIterator      | Spl::Iterator::Filter | 
-| GlobIterator      | Spl::Iterator::Filter | 
-| InfiniteIterator      | Spl::Iterator::Infinite | 
-| InvalidArgumentException      | Spl::Exception::InvalidArgument | 
-| IteratorIterator      | Spl::Iterator::Iterator | 
-| LengthException      | Spl::Exception::Length | 
-| LimitIterator      | Spl::Iterator::Limit | 
-| LogicException      | Spl::Exception::Logic | 
-| NoRewindIterator      | Spl::Iterator::NoRewind | 
-| OuterIterator      | Spl::Iterator::Outer | 
-| OutOfBoundsException      | Spl::Exception::OutOfBounds | 
-| OutOfRangeException      | Spl::Exception::OutOfRange | 
-| OverflowException      | Spl::Exception::Overflow | 
-| ParentIterator      | Spl::iterator::Parent | 
-| RangeException      | Spl::Exception::Range | 
-| RecursiveArrayIterator      | Spl::Iterator::Recursive::Array? | 
-| RecursiveCachingIterator      | Spl::iterator::Recursive::Caching? | 
-| RecursiveDirectoryIterator      | Spl::Iterator::Recursive::Directory | 
-| RecursiveFilterIterator      | Spl::Iterator::Recursive::Filter | 
-| RecursiveIterator      | Spl::Iterator::Recursive::Recursive? | 
-| RecursiveIteratorIterator      | Spl::Iterator::Recursive::Iterator? | 
-| RecursiveRegexIterator      | Spl::Iterator::Recursive::Regex | 
-| RegexIterator      | Spl::Iterator::Regex | 
-| RuntimeException      | Spl::Exception::Runtime | 
-| SeekableIterator      | ? | 
-| SimpleXMLIterator      | ? | 
-| SplFileInfo      | ? | 
-| SplFileObject      | ? | 
-| SplObjectStorage      | ? | 
-| SplObserver      | ? | 
-| SplSubject      | ? | 
-| SplTempFileObject      | ? | 
-| UnderflowException      | ? | 
-| UnexpectedValueException      | ? | 
  
rfc/namespaces-for-internal-classes.txt · Last modified: 2017/09/22 13:28 (external edit)