Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
phpmyexplorer.func.php
Package: Generateur_v13.rar [view]
Upload User: feiyaoda
Upload Date: 2016-11-21
Package Size: 9556k
Code Size: 4k
Category:
WEB Mail
Development Platform:
PHP
- <?php
- /*********************************************
- *
- * functions taken from phpmyexplorer
- *
- *********************************************/
- function FormatTailleFichier($Taille,$unite)
- {
- if($Taille == 0) $format = "";
- else if($Taille <= 1024) $format = $Taille." $unite";
- else if($Taille <= (10*1024)) $format = sprintf ("%.2f k%s",($Taille/1024),$unite);
- else if($Taille <= (100*1024)) $format = sprintf ("%.1f k%s",($Taille/1024),$unite);
- else if($Taille <= (1024*1024)) $format = sprintf ("%d k%s",($Taille/1024),$unite);
- else if($Taille <= (10*1024*1024)) $format = sprintf ("%.2f M%s",($Taille/(1024*1024)),$unite);
- else if($Taille <= (100*1024*1024)) $format = sprintf ("%.1f M%s",($Taille/(1024*1024)),$unite);
- else $format = sprintf ("%d M%s",($Taille/(1024*1024)),$unite);
- return $format;
- }
- function FormatePermissions($mode)
- {
- // Determine le type
- if($mode & 0x1000) $type='p'; // FIFO pipe
- else if($mode & 0x2000) $type='c'; // Character special
- else if($mode & 0x4000) $type='d'; // Directory
- else if($mode & 0x6000) $type='b'; // Block special
- else if($mode & 0x8000) $type='-'; // Regular
- else if($mode & 0xA000) $type='l'; // Symbolic Link
- else if($mode & 0xC000) $type='s'; // Socket
- else $type='u'; // UNKNOWN
- // Determine les permissions par groupe
- $owner["read"] = ($mode & 00400) ? 'r' : '-';
- $owner["write"] = ($mode & 00200) ? 'w' : '-';
- $owner["execute"] = ($mode & 00100) ? 'x' : '-';
- $group["read"] = ($mode & 00040) ? 'r' : '-';
- $group["write"] = ($mode & 00020) ? 'w' : '-';
- $group["execute"] = ($mode & 00010) ? 'x' : '-';
- $others["read"] = ($mode & 00004) ? 'r' : '-';
- $others["write"] = ($mode & 00002) ? 'w' : '-';
- $others["execute"] = ($mode & 00001) ? 'x' : '-';
- // Adjuste pour SUID, SGID et sticky bit
- if( $mode & 0x800 ) $owner["execute"] = ($owner[execute]=='x') ? 's' : 'S';
- if( $mode & 0x400 ) $group["execute"] = ($group[execute]=='x') ? 's' : 'S';
- if( $mode & 0x200 ) $others["execute"] = ($others[execute]=='x') ? 't' : 'T';
- return "$type$owner[read]$owner[write]$owner[execute]$group[read]$group[write]$group[execute]$others[read]$others[write]$others[execute]";
- }
- function FormatePermissions_Array($mode)
- {
- // Determine le type
- if($mode & 0x1000) $type='p'; // FIFO pipe
- else if($mode & 0x2000) $type='c'; // Character special
- else if($mode & 0x4000) $type='d'; // Directory
- else if($mode & 0x6000) $type='b'; // Block special
- else if($mode & 0x8000) $type='-'; // Regular
- else if($mode & 0xA000) $type='l'; // Symbolic Link
- else if($mode & 0xC000) $type='s'; // Socket
- else $type='u'; // UNKNOWN
- $return_array['type'] = $type;
- // Determine les permissions par groupe
- $return_array['owner']["read"] = ($mode & 00400) ? true : false;
- $return_array['owner']["write"] = ($mode & 00200) ? true : false;
- $return_array['owner']["execute"] = ($mode & 00100) ? true : false;
- $return_array['group']["read"] = ($mode & 00040) ? true : false;
- $return_array['group']["write"] = ($mode & 00020) ? true : false;
- $return_array['group']["execute"] = ($mode & 00010) ? true : false;
- $return_array['others']["read"] = ($mode & 00004) ? true : false;
- $return_array['others']["write"] = ($mode & 00002) ? true : false;
- $return_array['others']["execute"] = ($mode & 00001) ? true : false;
- // Adjuste pour SUID, SGID et sticky bit
- if( $mode & 0x800 ) $return_array['SUID'] = ($return_array['owner']["execute"]=='x') ? 's' : 'S';
- if( $mode & 0x400 ) $return_array['SGID'] = ($return_array['group']["execute"]=='x') ? 's' : 'S';
- if( $mode & 0x200 ) $return_array['sticky'] = ($return_array['others']["execute"]=='x') ? 't' : 'T';
- return $return_array;
- }