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
pat_path_wrapper.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
- /*
- * a basic wrapper for paths
- *
- * note that keywords
- *
- *
- *
- *
- *
- *
- */
- class path_wrapper
- {
- var $delimiter_begin = '{';
- var $delimiter_end = '}';
- function create_date_wrapper_array($time)
- {
- if (0 == $time) $time = time();
- if ($time == $this->latest_date_export) return true;
- $this->latest_date_export = $time;
- $this->date_wrapper['da'] = date('a',$time); // "am" or "pm"
- $this->date_wrapper['dA'] = date('A',$time); // "AM" or "PM"
- $this->date_wrapper['dB'] = date('B',$time); // Swatch Internet time
- $this->date_wrapper['dd'] = date('d',$time); // day of the month, 2 digits with leading zeros; i.e. "01" to "31"
- $this->date_wrapper['dD'] = date('D',$time); // day of the week, textual, 3 letters; e.g. "Fri"
- $this->date_wrapper['dF'] = date('F',$time); // month, textual, long; e.g. "January"
- $this->date_wrapper['dg'] = date('g',$time); // hour, 12-hour format without leading zeros; i.e. "1" to "12"
- $this->date_wrapper['dG'] = date('G',$time); // hour, 24-hour format without leading zeros; i.e. "0" to "23"
- $this->date_wrapper['dh'] = date('h',$time); // hour, 12-hour format; i.e. "01" to "12"
- $this->date_wrapper['dH'] = date('H',$time); // hour, 24-hour format; i.e. "00" to "23"
- $this->date_wrapper['di'] = date('i',$time); // minutes; i.e. "00" to "59"
- $this->date_wrapper['dI'] = date('I',$time); // (capital i) - "1" if Daylight Savings Time, "0" otherwise.
- $this->date_wrapper['dj'] = date('j',$time); // day of the month without leading zeros; i.e. "1" to "31"
- $this->date_wrapper['dl'] = date('l',$time); // (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
- $this->date_wrapper['dL'] = date('L',$time); // boolean for whether it is a leap year; i.e. "0" or "1"
- $this->date_wrapper['dm'] = date('m',$time); // month; i.e. "01" to "12"
- $this->date_wrapper['dM'] = date('M',$time); // month, textual, 3 letters; e.g. "Jan"
- $this->date_wrapper['dn'] = date('n',$time); // month without leading zeros; i.e. "1" to "12"
- $this->date_wrapper['dO'] = date('O',$time); // Difference to Greenwich time in hours; e.g. "+0200"
- $this->date_wrapper['dr'] = date('r',$time); // RFC 822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" (added in PHP 4.0.4)
- $this->date_wrapper['ds'] = date('s',$time); // seconds; i.e. "00" to "59"
- $this->date_wrapper['dS'] = date('S',$time); // English ordinal suffix for the day of the month, 2 characters; i.e. "st", "nd", "rd" or "th"
- $this->date_wrapper['dt'] = date('t',$time); // number of days in the given month; i.e. "28" to "31"
- $this->date_wrapper['dT'] = date('T',$time); // Timezone setting of this machine; e.g. "EST" or "MDT"
- $this->date_wrapper['dU'] = date('U',$time); // seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
- $this->date_wrapper['dw'] = date('w',$time); // day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
- $this->date_wrapper['dW'] = date('W',$time); // ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)
- $this->date_wrapper['dY'] = date('Y',$time); // year, 4 digits; e.g. "1999"
- $this->date_wrapper['dy'] = date('y',$time); // year, 2 digits; e.g. "99"
- $this->date_wrapper['dz'] = date('z',$time); // day of the year; i.e. "0" to "365"
- $this->date_wrapper['dZ'] = date('Z',$time); // timezone offset in seconds (i.e. "-43200" to "43200"). The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.
- return true;
- }
- function ($path2wrap,$wrappers,$specifictime=0)
- {
- $this->create_date_wrapper_array($specifictime);
- // we merge the two arrays we need to wrap
- $_int_wrappers = array_merge($wrappers,$this->date_wrapper);
- // for each keyword in wrapper, we substitue it's value
- foreach ($wrappers as $key => $value)
- {
- $str2search = $this->delimiter_begin.$key.$this->delimiter_end;
- $path2wrap = str_replace ($str2search,$value,$path2wrap);
- }
- }
- }