(sorry for my English)
http://pecl.php.net/get/dio seems broken at the moment
to get dio extension follow these steps (steps 1.a and 1.b are equivalent):
1.a get source files using cvs (you may need cvsnt or similar):
(in shell run)
cvs -d :pserver:cvsread@cvs.php.net:/repository login
Password: phpfi
cvs -d :pserver:cvsread@cvs.php.net:/repository co pecl/dio
cd pecl/dio/
-- or --
1.b manually download all files at http://cvs.php.net/cvs.php/pecl/dio clicking on the revision number link
move to the destination directory
2. (in shell run)
phpize (if the system is missing the 'phpize' command see http://php.mirrors.ilisys.com.au/manual/en/install.pecl.phpize.php)
./configure --enable-dio --with-php-config=/path/to/php-config (usually /usr/local/php/bin/php-config or /usr/bin/php-config)
make
make install (you need root/admin privilegies)
Direct IO Functions
Introduktion
PHP supports the direct io functions as described in the Posix Standard (Section 6) for performing I/O functions at a lower level than the C-Language stream I/O functions (fopen(), fread(),..). The use of the DIO functions should be considered only when direct control of a device is needed. In all other cases, the standard filesystem functions are more than adequate.
Note: This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.1.0.
This extension is only available on Windows Platforms as of PHP 5.0.0
Krav
Inga externa bibliotek behövs för att bygga det tillägg.
Installation
To get these functions to work, you have to configure PHP with --enable-dio.
Fördefinerade konstanter
Konstanterna nedan defineras av den här utbyggnaden, och kommer bara vara tillgängliga då utbyggnaden kompilerats med PHP eller laddats dynamiskt.
- c (integer)
- F_DUPFD (integer)
- F_GETFD (integer)
- F_GETFL (integer)
- F_GETLK (integer)
- F_GETOWN (integer)
- F_RDLCK (integer)
- F_SETFL (integer)
- F_SETLK (integer)
- F_SETLKW (integer)
- F_SETOWN (integer)
- F_UNLCK (integer)
- F_WRLCK (integer)
- O_APPEND (integer)
- O_ASYNC (integer)
- O_CREAT (integer)
- O_EXCL (integer)
- O_NDELAY (integer)
- O_NOCTTY (integer)
- O_NONBLOCK (integer)
- O_RDONLY (integer)
- O_RDWR (integer)
- O_SYNC (integer)
- O_TRUNC (integer)
- O_WRONLY (integer)
- S_IRGRP (integer)
- S_IROTH (integer)
- S_IRUSR (integer)
- S_IRWXG (integer)
- S_IRWXO (integer)
- S_IRWXU (integer)
- S_IWGRP (integer)
- S_IWOTH (integer)
- S_IWUSR (integer)
- S_IXGRP (integer)
- S_IXOTH (integer)
- S_IXUSR (integer)
Konfiguration under drift
Den här utbyggnaden definerar inte några konfigurationsdirektiv i php.ini.
Resurstyper
One resource type is defined by this extension: a file descriptor returned by dio_open().
Table of Contents
- dio_close — Closes the file descriptor given by fd
- dio_fcntl — Performs a c library fcntl on fd
- dio_open — Opens a new filename with specified permissions of flags and creation permissions of mode
- dio_read — Reads bytes from a file descriptor
- dio_seek — Seeks to pos on fd from whence
- dio_stat — Gets stat information about the file descriptor fd
- dio_tcsetattr — Sets terminal attributes and baud rate for a serial port
- dio_truncate — Truncates file descriptor fd to offset bytes
- dio_write — Writes data to fd with optional truncation at length
Direct IO
25-Feb-2008 07:15
07-Dec-2007 04:36
You can manually build the dio extension for your version of PHP, or install an older version of PHP that still bundled dio. It's not that hard to build it yourself, just a bit of a process, and it helps if you're on linux, and have a build environment... which I would assume you have if you are doing some kind of development that requires direct device I/O... Just get the dio source from the cvs repo, compile it, and then add the extension to your php configuration...
03-Nov-2007 06:41
to use mandatory locking on a linux system, the filesystem has to be well prepared.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/hda1 / ext3 errors=remount-ro,mand 0 1
/dev/hda2 none swap sw 0 0
proc /proc proc defaults 0 0
/dev/fd0 /floppy auto user,noauto 0 0
/dev/cdrom /cdrom iso9660 ro,user,noauto 0 0
For example here the ext3 partition has been prepared for mandatory locking. Otherwise no dio_function will work on the system.
25-Sep-2007 01:13
IMPORTANT:
--enable-dio is NOT recognized as an option. After reporting a bug, i got following answer:
It is not bundled anymore. See http://pecl.php.net/dio to fetch the CVS version (being unmaintained, there is no release in pecl). Not a bug > bogus.
