Build an Object-oriented File System in PHP

Using a simple file storage convention and some PHP code, you can create a hierarchical file system that mimics many object-oriented concepts, facilitates reuse, and simplifies your Web development efforts. 


advertisement
he term "object-oriented" is vague and frequently misunderstood. Jonathan Rees (with more insight than the average programmer) attempted to define its meaning , but even his definition does not necessarily encompass the topic completely.


Despite the difficulties of pinning down the terminology, for the purposes of this article, you can assume an "object-oriented file system" has a specific meaning—it is a way to take advantage of traditional object-oriented concepts such as inheritance, by organizing your files and directories as if they were a class hierarchy. This may seem like an odd idea, but in practice, it's extremely useful. Adopting an object-oriented file system provides the following benefits:

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?