News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPBuilder.com:
BitMasks Emulate Unix Permissions in PHP (Quickly)
August 09, 2006 @ 16:01:53

Permissions in Unix-based systems have become one of the standard models for development all over the world. They're simple to learn and use while being extremely powerful at the same time. In this new article (as contributed by Eric Potvin) from PHPBuilder.com today, they bring this power to the realm of PHP with bitmasks.

Bitmasking is a very useful method to emulate Unix-style file permissions (read/write/execute for example). What's nice about a PHP implementation is that you can configure your own bitmasks and use them for any kind of permissions in your scripts and applications. The implementation is relatively simple as well.

They start by defining a few of the permission levels (add/delete/denied) in PHP constants before showing the bitMask() function you can use to check a user's permissions. They also include some simple pseudo-code to show how it's used. For more information, check out the complete article here.

1 comment voice your opinion now!
bitmask unix permissions tutorial define constants bitmask unix permissions tutorial define constants


blog comments powered by Disqus

Similar Posts

Evan Coury's Blog: Using Zend\Dbs TableGateway & HydratingResultSet to return rows as custom enties

Tony Lukasavage's Blog: PHP Debugging on IntelliJ IDEA 10 with Xdebug

Chris Hartjes' Blog: Smarter DB Migrations using Zend Framework and Doctrine 1.2

Alexander Netkachev's Blog: Practical PHP events: The Java way

Zend Developer Zone: The Standard PHP Library (SPL)


Community Events





Don't see your event here?
Let us know!


install symfony api list laravel tips introduction interview release deployment library framework community language zendserver podcast update opinion package series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework