Merge commit 'anubis/master'
Before Width: | Height: | Size: 43 B |
Before Width: | Height: | Size: 91 B |
Before Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 53 B |
Before Width: | Height: | Size: 97 B |
Before Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 47 B |
Before Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 379 B |
Before Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 43 B |
Before Width: | Height: | Size: 47 B |
Before Width: | Height: | Size: 106 B |
Before Width: | Height: | Size: 45 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 52 B |
Before Width: | Height: | Size: 600 B |
@ -1,172 +0,0 @@
|
||||
//******************************************************************************
|
||||
// ------ Apycom.com Tree-menu Data --------------------------------------------
|
||||
//******************************************************************************
|
||||
var tblankImage = "img/blank.gif";
|
||||
var tfontStyle = "normal 8pt Tahoma";
|
||||
var tfontColor = ["#000000","#000088"];
|
||||
var tfontDecoration = ["none","underline"];
|
||||
|
||||
var titemBackColor = ["#CCCCCC","#CCCCCC"];
|
||||
var titemAlign = "left";
|
||||
var titemBackImage = ["",""];
|
||||
var titemCursor = "default";
|
||||
var titemHeight = 20;
|
||||
|
||||
var tmenuBackImage = "";
|
||||
var tmenuBackColor = "";
|
||||
var tmenuBorderColor = "#FFFFFF";
|
||||
var tmenuBorderStyle = "dotted";
|
||||
var tmenuBorderWidth = 1;
|
||||
var tmenuWidth = "";
|
||||
var tmenuHeight = "";
|
||||
|
||||
var titemTarget = "_blank";
|
||||
var ticonWidth = 16;
|
||||
var ticonHeight = 16;
|
||||
var ticonAlign = "left";
|
||||
|
||||
var texpandBtn =["img/expandbtn2.gif","img/expandbtn2.gif","img/collapsebtn2.gif"];
|
||||
var texpandBtnW = 9;
|
||||
var texpandBtnH = 9;
|
||||
var texpandBtnAlign = "left";
|
||||
|
||||
var tpoints = 1;
|
||||
var tpointsImage = "img/vpoint.gif";
|
||||
var tpointsVImage = "img/hpoint.gif";
|
||||
var tpointsCImage = "img/cpoint.gif";
|
||||
|
||||
var tmoveable = 0;
|
||||
var tmoveImage = "img/movepic.gif";
|
||||
var tabsolute = 0;
|
||||
var tleft = 20;
|
||||
var ttop = 120;
|
||||
|
||||
var tfloatable = 0;
|
||||
var tfloatIterations = 6;
|
||||
|
||||
// XP-Style Parameters
|
||||
var tXPStyle = 0;
|
||||
var tXPIterations = 0; // expand/collapse speed
|
||||
var tXPTitleTopBackColor = "";
|
||||
var tXPTitleBackColor = "";
|
||||
var tXPTitleLeft = "";
|
||||
var tXPExpandBtn = [];
|
||||
var tXPBtnHeight = 0;
|
||||
var tXPTitleBackImg = "";
|
||||
|
||||
var tstyles =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
var tmenuItems =
|
||||
[
|
||||
["Item 1", "testlink.htm", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|||SubItem 1","", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 5", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 6", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 1", "testlink.htm", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|||SubItem 1","", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 5", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["|SubItem 4", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 1", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 2", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["||SubItem 3", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
["Item 6", "", "img/icons/folder1.gif","img/icons/folder1.gif","img/icons/folder2.gif"],
|
||||
];
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
.TreeMenuTitle {color: #888888; font: 18px Arial; font-weight: 600}
|
||||
|
||||
.XPBlueTopBack {background-color: #6375D6}
|
||||
.XPBlueMainBack {background-color: #6375D6; background-image: url(img/xpback.gif); background-repeat: no-repeat}
|
||||
.XPBlueMenuBack {background-color: #7AA1E6; color: #FFFFFF; font: 10px Arial; font-weight: bold;}
|
||||
.XPBlueHorLine {background-color: #C5DFFF}
|
||||
.XPBlueExTitle {color: #D6DFF5; font: 16px Arial; font-weight: bold;}
|
||||
.XPBlueText {color: #FFFFFF; font: 11px Verdana; background-image: url();}
|
||||
.XPBlueTitle {color: #D6DFF5; font: 20px Arial; font-weight: bold; background-image: url();}
|
||||
|
||||
.Text {color: #222222; font: 11px Verdana; background-image: url();}
|
||||
.MainBack {background-color: #FFFFFF; color: #222222; font: 10px Arial; font-weight: bold}
|
||||
.MenuBack {background-color: #CCCCCC; color: #FFFFFF; font: 10px Arial; font-weight: bold}
|
||||
.TopBack {background-color: #FFFFFF}
|
||||
.ExTitle {color: #999999; font: 16px Arial; font-weight: bold}
|
||||
|
||||
.ParamTitle {color: #222222; font: 16px Arial; font-weight: bold}
|
||||
.ParamBack {background-color: #FFFFFF; font: 11px Verdana; font: 11px Verdana;}
|
||||
.ParamTbl {color: #333333; font: 11px Verdana; font: 11px Verdana;}
|
||||
.ParamTblTitle {background-color: #CEE9F2; color: #444444; font: 11px Verdana; font-weight: bold;}
|
||||
.ParamTblCell {background-color: #ECF7F9; font: 11px Verdana; color: #222222;}
|
||||
|
||||
|
||||
.StyleNameW {color: #FFFFFF; font: 11px MS Sans Serif; font-weight: bold}
|
||||
.StyleNameB {color: #000000; font: 11px MS Sans Serif; font-weight: bold}
|
||||
|
||||
A.White:link {font: 11px Verdana; color: #B5EDFF; text-decoration: none;}
|
||||
A.White:hover {font: 11px Verdana; color: #FFFFFF; text-decoration: underline;}
|
||||
A.White:visited {font: 11px Verdana; color: #D3CCFF; text-decoration: none;}
|
||||
A.White:visited:hover {font: 11px Verdana; color: #FFFFFF; text-decoration: underline;}
|
||||
|
||||
A.Dark:link {font: 11px Verdana; color: #3333DD; text-decoration: none;}
|
||||
A.Dark:hover {font: 11px Verdana; color: #5555FF; text-decoration: underline;}
|
||||
A.Dark:visited {font: 11px Verdana; color: #5555CC; text-decoration: none;}
|
||||
A.Dark:visited:hover {font: 11px Verdana; color: #5555FF; text-decoration: underline;}
|
||||
|
||||
A.Black:link {font: 11px Verdana; color: #FFFFFF; text-decoration: none;}
|
||||
A.Black:hover {font: 11px Verdana; color: #FFFFFF; text-decoration: underline;}
|
||||
A.Black:visited {font: 11px Verdana; color: #F3F3F3; text-decoration: none;}
|
||||
A.Black:visited:hover {font: 11px Verdana; color: #FFFFFF; text-decoration: underline;}
|
||||
|
||||
A.MenuLink:link {font: 10px Arial; color: #FFFFFF; text-decoration: none; font-weight: bold;}
|
||||
A.MenuLink:hover {font: 10px Arial; color: #FFFFFF; text-decoration: none; font-weight: bold;}
|
||||
A.MenuLink:visited {font: 10px Arial; color: #FFFFFF; text-decoration: none; font-weight: bold;}
|
||||
|
||||
.MenuTable {border-width: 0;}
|
||||
.MenuItem {border-width: 1; background-color: #628FE2; border-style: solid; border-color: #A0C0FF; color: #FFFFFF}
|
||||
.MenuItemOver {border-width: 1; background-color: #285BA5; border-style: solid; border-color: #FFFFFF; color: #000000; cursor: hand}
|
||||
|
||||
|
@ -1,106 +0,0 @@
|
||||
//******************************************************************************
|
||||
// ------ Apycom.com Tree-menu Data --------------------------------------------
|
||||
//******************************************************************************
|
||||
var tlevelDX = 10;
|
||||
|
||||
var tblankImage = "img/blank.gif";
|
||||
var tfontStyle = "normal 8pt Tahoma";
|
||||
var tfontColor = ["#3F3D3D","#7E7C7C"];
|
||||
var tfontDecoration = ["none","underline"];
|
||||
|
||||
var titemBackColor = ["#F0F1F5","#F0F1F5"];
|
||||
var titemAlign = "left";
|
||||
var titemBackImage = ["",""];
|
||||
var titemCursor = "hand";
|
||||
var titemHeight = 22;
|
||||
|
||||
var tmenuBackImage = "";
|
||||
var tmenuBackColor = "";
|
||||
var tmenuBorderColor = "#FFFFFF";
|
||||
var tmenuBorderStyle = "solid";
|
||||
var tmenuBorderWidth = 0;
|
||||
var tmenuWidth = 230;
|
||||
var tmenuHeight = 500;
|
||||
|
||||
var titemTarget = "_blank";
|
||||
var ticonWidth = 16;
|
||||
var ticonHeight = 16;
|
||||
var ticonAlign = "center";
|
||||
|
||||
var texpanded = 1;
|
||||
var texpandBtn =["img/expandbtn2.gif","img/expandbtn2.gif","img/collapsebtn2.gif"];
|
||||
var texpandBtnW = 9;
|
||||
var texpandBtnH = 9;
|
||||
var texpandBtnAlign = "left"
|
||||
|
||||
var tpoints = 0;
|
||||
var tpointsImage = "";
|
||||
var tpointsVImage = "";
|
||||
var tpointsCImage = "";
|
||||
|
||||
var tmoveable = 1;
|
||||
var tmoveImage = "img/movepic.gif";
|
||||
var tmoveImageHeight = 12;
|
||||
var tabsolute = 1;
|
||||
var tleft = 20;
|
||||
var ttop = 120;
|
||||
|
||||
var tfloatable = 0;
|
||||
var tfloatIterations = 6;
|
||||
|
||||
// XP-Style Parameters
|
||||
var tXPStyle = 1;
|
||||
var tXPIterations = 5; // expand/collapse speed
|
||||
var tXPTitleTopBackColor = "";
|
||||
var tXPTitleBackColor = "#57C34A";
|
||||
var tXPTitleLeft = "img/xptitleleft_green.gif";
|
||||
var tXPExpandBtn = ["img/xpexpand1_green.gif","img/xpexpand1_green.gif","img/xpcollapse1_green.gif","img/xpcollapse1_green.gif"];
|
||||
var tXPBtnHeight = 25;
|
||||
var tXPTitleBackImg = "img/xptitle_green.gif";
|
||||
|
||||
var tstyles =
|
||||
[
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#FFFFFF,#D2FCD5",
|
||||
"tfontDecoration=none,none"],
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#3F3D3D,#659669",
|
||||
"tfontDecoration=none,none"],
|
||||
["tfontDecoration=none,none"],
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#444444,#5555FF"],
|
||||
];
|
||||
|
||||
var tXPStyles =
|
||||
[
|
||||
["tXPTitleBackColor=#DEF3DB",
|
||||
"tXPExpandBtn=img/xpexpand2_green.gif,img/xpexpand2_green.gif,img/xpcollapse2_green.gif,img/xpcollapse2_green.gif", "tXPTitleBackImg=img/xptitle2_green.gif"]
|
||||
];
|
||||
|
||||
var tmenuItems =
|
||||
[
|
||||
["1st submenu", "", "img/xpicon_green.gif","","", "Main Page",,"0"],
|
||||
["|This menu has 7 items.<br> 3rd and 6th are hidden.", "", "img/icons/info.gif"],
|
||||
["|Item 1", "testlink.htm", "img/icons/support.gif"],
|
||||
["|Item 2", "testlink.htm", "img/icons/support.gif"],
|
||||
["#|Item 3", "testlink.htm", "img/icons/support.gif"],
|
||||
["|Item 4", "testlink.htm", "img/icons/support.gif"],
|
||||
["|Item 5", "testlink.htm", "img/icons/support.gif"],
|
||||
["#|Item 6", "testlink.htm", "img/icons/support.gif"],
|
||||
["|Item 7", "testlink.htm", "img/icons/support.gif"],
|
||||
|
||||
["#2nd submenu", "", "", "","","",,"1","0"],
|
||||
["|This is the second submenu.<br>Also you can hide even a submenu title like here."],
|
||||
|
||||
["3rd submenu", "", "img/xpicon_green.gif","","", "Main Page",,"0"],
|
||||
["|This submenu has 3 levels.<br>But 3rd level items are hidden.", "", "img/icons/info.gif"],
|
||||
["|1st level item", "testlink.htm", "img/icons/support.gif"],
|
||||
["||2nd level item", "testlink.htm", "img/icons/support.gif"],
|
||||
["#||| 3rd level item 1", "testlink.htm", "img/icons/support.gif"],
|
||||
["#||| 3rd level item 2", "testlink.htm", "img/icons/support.gif"],
|
||||
["|1st level item", "testlink.htm", "img/icons/support.gif"],
|
||||
["||2nd level item", "testlink.htm", "img/icons/support.gif"],
|
||||
["#||| 3rd level item 1", "testlink.htm", "img/icons/support.gif"],
|
||||
["#||| 3rd level item 2", "testlink.htm", "img/icons/support.gif"],
|
||||
["#||| 3rd level item 3", "testlink.htm", "img/icons/support.gif"],
|
||||
["#||| 3rd level item 4", "testlink.htm", "img/icons/support.gif"],
|
||||
];
|
||||
|
||||
apy_tmenuInit();
|
@ -1,104 +0,0 @@
|
||||
var tabsolute = 1;
|
||||
var tLeft = 10;
|
||||
var tTop = 10;
|
||||
|
||||
//******************************************************************************
|
||||
// ------ Apycom.com Tree-menu Data --------------------------------------------
|
||||
//******************************************************************************
|
||||
var tblankImage = "includes/aptree/img/blank.gif";
|
||||
var tmenuWidth = 230;
|
||||
var tmenuHeight = 400;
|
||||
|
||||
var tabsolute = 1;
|
||||
var tleft = 20;
|
||||
var ttop = 120;
|
||||
|
||||
var tfloatable = 1;
|
||||
var tfloatIterations = 6;
|
||||
var tmoveable = 0;
|
||||
var tmoveImage = "includes/aptree/img/movepic.gif";
|
||||
var tmoveImageHeight = 12;
|
||||
|
||||
var tfontStyle = "normal 8pt Tahoma";
|
||||
var tfontColor = ["#215DC6","#428EFF"];
|
||||
var tfontDecoration = ["none","underline"];
|
||||
|
||||
var titemBackColor = ["#D6DFF7","#D6DFF7"];
|
||||
var titemAlign = "left";
|
||||
var titemBackImage = ["",""];
|
||||
var titemCursor = "hand";
|
||||
var titemHeight = 22;
|
||||
|
||||
var titemTarget = "_blank";
|
||||
var ticonWidth = 16;
|
||||
var ticonHeight = 16;
|
||||
var ticonAlign = "left";
|
||||
|
||||
var tmenuBackImage = "";
|
||||
var tmenuBackColor = "";
|
||||
var tmenuBorderColor = "#FFFFFF";
|
||||
var tmenuBorderStyle = "solid";
|
||||
var tmenuBorderWidth = 0;
|
||||
|
||||
var texpandBtn =["includes/aptree/img/expandbtn2.gif","includes/aptree/img/expandbtn2.gif","includes/aptree/img/collapsebtn2.gif"];
|
||||
var texpandBtnW = 9;
|
||||
var texpandBtnH = 9;
|
||||
var texpandBtnAlign = "left"
|
||||
|
||||
var texpanded = 1;
|
||||
|
||||
var tpoints = 0;
|
||||
var tpointsImage = "";
|
||||
var tpointsVImage = "";
|
||||
var tpointsCImage = "";
|
||||
|
||||
// XP-Style Parameters
|
||||
var tXPStyle = 1;
|
||||
var tXPIterations = 5; // expand/collapse speed
|
||||
var tXPTitleTopBackColor = "";
|
||||
var tXPTitleBackColor = "#265BCC";
|
||||
var tXPTitleLeft = "img/xptitleleft.gif";
|
||||
var tXPExpandBtn = ["img/xpexpand1.gif","img/xpexpand2.gif","img/xpcollapse1.gif","img/xpcollapse2.gif"];
|
||||
var tXPBtnHeight = 25;
|
||||
var tXPTitleBackImg = "img/xptitle.gif";
|
||||
|
||||
var tstyles =
|
||||
[
|
||||
["tfontStyle=bold 8pt Tahoma","titemBackColor=#265BCC,#265BCC","tfontColor=#FFFFFF,#428EFF", "tfontDecoration=none,none"],
|
||||
["tfontStyle=bold 8pt Tahoma","titemBackColor=#265BCC,#265BCC","tfontColor=#215DC6,#428EFF", "tfontDecoration=none,none"],
|
||||
["tfontDecoration=none,none"],
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#444444,#5555FF"],
|
||||
];
|
||||
|
||||
var tXPStyles =
|
||||
[
|
||||
["tXPTitleBackColor=#D0DAF8", "tXPExpandBtn=img/xpexpand3.gif,img/xpexpand4.gif,img/xpcollapse3.gif,img/xpcollapse4.gif", "tXPTitleBackImg=img/xptitle2.gif"]
|
||||
];
|
||||
|
||||
var tmenuItems =
|
||||
[
|
||||
["XP-style Title with Icon", "", "img/xpicon1.gif","","", "Main Page",,"0"],
|
||||
["|Information", "testlink.htm", "img/icons/info.gif", "", "", "Information","_blank"],
|
||||
["|Support", "", "img/icons/support.gif", "", "", "Support",, "2"],
|
||||
["||Contacts", "mailto:support@apycom.com", "img/icons/contacts.gif", "", "", "Contacts"],
|
||||
["||E-mail", "mailto:support@apycom.com", "img/icons/email.gif", "", "", "E-mail"],
|
||||
|
||||
["|Help", "", "img/icons/help1.gif", "img/icons/help1.gif", "img/icons/help2.gif", "Help",,"2"],
|
||||
["||Glossary", "testlink.htm", "img/icons/paper.gif", "", "", "Glossary"],
|
||||
["||Index", "testlink.htm", "img/icons/paper.gif", "", "", "Index"],
|
||||
["||<nobr><input value='search' size=10 style='font-size:10'> <input type='button' value='Search' style='font-size:10'></nobr>",
|
||||
"", "img/icons/search.gif", "", "", "Search",,"2"],
|
||||
|
||||
["||<nobr>Contents: <select style='font-size:10'><option>Item 1</option><option>Item 2</option><option>Item 3</option></select></nobr>",
|
||||
"", "img/icons/list.gif", "", "", "Contents",,"2"],
|
||||
|
||||
["XP-style Title without Icon", "", "", "","","Download software",,"1","0"],
|
||||
["|Item without icon", "testlink.htm", ,,, "Item 1 Hint"],
|
||||
["|Item with individual style", "", ,,, "Item 2 Hint",,"3"],
|
||||
["||SubItem 1", "testlink.htm", "img/icons/help1.gif", "","", "SubItem 1 Hint"],
|
||||
["||SubItem 2", "testlink.htm", "img/icons/help1.gif", "","", "SubItem 1 Hint"],
|
||||
["|||SubItem 2_1", "testlink.htm", ,,, "SubItem 1_2 Hint"],
|
||||
|
||||
];
|
||||
|
||||
apy_tmenuInit();
|
@ -1,98 +0,0 @@
|
||||
//******************************************************************************
|
||||
// ------ Apycom.com Tree-menu Data --------------------------------------------
|
||||
//******************************************************************************
|
||||
var tblankImage = "img/blank.gif";
|
||||
var tfontStyle = "normal 8pt Tahoma";
|
||||
var tfontColor = ["#3F3D3D","#7E7C7C"];
|
||||
var tfontDecoration = ["none","underline"];
|
||||
|
||||
var titemBackColor = ["#F6F6EC","#F6F6EC"];
|
||||
var titemAlign = "left";
|
||||
var titemBackImage = ["",""];
|
||||
var titemCursor = "hand";
|
||||
var titemHeight = 22;
|
||||
|
||||
var tmenuBackImage = "";
|
||||
var tmenuBackColor = "";
|
||||
var tmenuBorderColor = "#FFFFFF";
|
||||
var tmenuBorderStyle = "solid";
|
||||
var tmenuBorderWidth = 0;
|
||||
var tmenuWidth = 230;
|
||||
var tmenuHeight = 400;
|
||||
|
||||
var titemTarget = "_blank";
|
||||
var ticonWidth = 16;
|
||||
var ticonHeight = 16;
|
||||
var ticonAlign = "left";
|
||||
|
||||
var texpandBtn =["img/expandbtn2.gif","img/expandbtn2.gif","img/collapsebtn2.gif"];
|
||||
var texpandBtnW = 9;
|
||||
var texpandBtnH = 9;
|
||||
var texpandBtnAlign = "left"
|
||||
|
||||
var texpanded = 0;
|
||||
|
||||
var tpoints = 0;
|
||||
var tpointsImage = "";
|
||||
var tpointsVImage = "";
|
||||
var tpointsCImage = "";
|
||||
|
||||
var tabsolute = 1;
|
||||
var tmoveable = 0;
|
||||
var tmoveImage = "img/movepic.gif";
|
||||
var tleft = 20;
|
||||
var ttop = 120;
|
||||
|
||||
var tfloatable = 1;
|
||||
var tfloatIterations = 6;
|
||||
|
||||
// XP-Style Parameters
|
||||
var tXPStyle = 1;
|
||||
var tXPIterations = 10; // expand/collapse speed
|
||||
var tXPTitleTopBackColor = "";
|
||||
var tXPTitleBackColor = "#94A664";
|
||||
var tXPTitleLeft = "img/xptitleleft_o.gif";
|
||||
var tXPExpandBtn = ["img/xpexpand1_o.gif","img/xpexpand2_o.gif","img/xpcollapse1_o.gif","img/xpcollapse2_o.gif"];
|
||||
var tXPBtnHeight = 23;
|
||||
var tXPTitleBackImg = "img/xptitle_o.gif";
|
||||
|
||||
var tstyles =
|
||||
[
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#FFFFFF,#E0E7B8",
|
||||
"tfontDecoration=none,none"],
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#56662D,#72921D",
|
||||
"tfontDecoration=none,none"],
|
||||
["tfontDecoration=none,none"],
|
||||
["tfontStyle=bold 8pt Tahoma","tfontColor=#444444,#5555FF"],
|
||||
];
|
||||
|
||||
var tXPStyles =
|
||||
[
|
||||
["tXPTitleBackColor=#E2E9BC",
|
||||
"tXPExpandBtn=img/xpexpand3_o.gif,img/xpexpand4_o.gif,img/xpcollapse3_o.gif,img/xpcollapse4_o.gif", "tXPTitleBackImg=img/xptitle2_o.gif"]
|
||||
];
|
||||
|
||||
var tmenuItems =
|
||||
[
|
||||
["+XP-style Title with Icon", "", "img/xpicon1_o.gif", "", "", "Main Page",,"0"],
|
||||
["|Information", "testlink.htm", "img/icons/info.gif", "", "", "Information","_blank"],
|
||||
["|Support", "", "img/icons/support.gif", "", "", "Support",, "2"],
|
||||
["||Contacts", "mailto:support@apycom.com", "img/icons/contacts.gif", "", "", "Contacts"],
|
||||
["||E-mail", "mailto:support@apycom.com", "img/icons/email.gif", "", "", "E-mail"],
|
||||
|
||||
["|Help", "", "img/icons/help1.gif", "img/icons/help1.gif", "img/icons/help2.gif", "Help",,"2"],
|
||||
["||Glossary", "testlink.htm", "img/icons/paper.gif", "", "", "Glossary"],
|
||||
["||Index", "testlink.htm", "img/icons/paper.gif", "", "", "Index"],
|
||||
["||<nobr><input value='search' size=10 style='font-size:10'> <input type='button' value='Search' style='font-size:10'></nobr>", "", "img/icons/search.gif", "", "", "Search",,"2"],
|
||||
|
||||
["||<nobr>Contents: <select style='font-size:10'><option>Item 1</option><option>Item 2</option><option>Item 3</option></select></nobr>", "", "img/icons/list.gif", "", "", "Contents",,"2"],
|
||||
|
||||
["+XP-style Title without Icon", "", "", "", "", "Download software",,"1","0"],
|
||||
["|Item without icon", "testlink.htm", "", "", "", "Item 1 Hint"],
|
||||
["|Item with individual style", "", "", "", "", "Item 2 Hint",,"3"],
|
||||
["||SubItem 1", "testlink.htm", "img/icons/help1.gif", "", "", "SubItem 1 Hint"],
|
||||
["||SubItem 2", "testlink.htm", "img/icons/help1.gif", "", "", "SubItem 1 Hint"],
|
||||
["|||SubItem 2_1", "testlink.htm", "", "", "", "SubItem 1_2 Hint"],
|
||||
|
||||
];
|
||||
|
@ -1,133 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Compat.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Provides missing functionality in the form of constants and functions
|
||||
* for older versions of PHP
|
||||
*
|
||||
* Optionally, you may simply include the file.
|
||||
* e.g. require_once 'PHP/Compat/Function/scandir.php';
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @version $Revision: 1.1 $
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @static
|
||||
*/
|
||||
class PHP_Compat
|
||||
{
|
||||
/**
|
||||
* Load a function, or array of functions
|
||||
*
|
||||
* @param string|array $function The function or functions to load
|
||||
* @return bool|array TRUE if loaded, FALSE if not
|
||||
*/
|
||||
function loadFunction($function)
|
||||
{
|
||||
// Recursiveness
|
||||
if (is_array($function)) {
|
||||
$res = array();
|
||||
foreach ($function as $singlefunc) {
|
||||
$res[$singlefunc] = PHP_Compat::loadFunction($singlefunc);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// Load function
|
||||
if (!function_exists($function)) {
|
||||
$file = sprintf('PHP/Compat/Function/%s.php', $function);
|
||||
if ((@include_once $file) !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load a constant, or array of constants
|
||||
*
|
||||
* @param string|array $constant The constant or constants to load
|
||||
* @return bool|array TRUE if loaded, FALSE if not
|
||||
*/
|
||||
function loadConstant($constant)
|
||||
{
|
||||
// Recursiveness
|
||||
if (is_array($constant)) {
|
||||
$res = array();
|
||||
foreach ($constant as $singleconst) {
|
||||
$res[$singleconst] = PHP_Compat::loadConstant($singleconst);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// Load constant
|
||||
$file = sprintf('PHP/Compat/Constant/%s.php', $constant);
|
||||
if ((@include_once $file) !== false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load components for a PHP version
|
||||
*
|
||||
* @param string $version PHP Version to load
|
||||
* @return array An associative array of component names loaded
|
||||
*/
|
||||
function loadVersion($version = null)
|
||||
{
|
||||
// Include list of components
|
||||
require 'PHP/Compat/Components.php';
|
||||
|
||||
// Include version_compare to work with older versions
|
||||
PHP_Compat::loadFunction('version_compare');
|
||||
|
||||
// Init
|
||||
$phpversion = phpversion();
|
||||
$methods = array(
|
||||
'function' => 'loadFunction',
|
||||
'constant' => 'loadConstant');
|
||||
$res = array();
|
||||
|
||||
// Iterate each component
|
||||
foreach ($components as $type => $slice) {
|
||||
foreach ($slice as $component => $compversion) {
|
||||
if (($version === null &&
|
||||
1 === version_compare($compversion, $phpversion)) || // C > PHP
|
||||
(0 === version_compare($compversion, $version) || // C = S
|
||||
1 === version_compare($compversion, $phpversion))) { // C > PHP
|
||||
|
||||
$res[$type][$component] =
|
||||
call_user_func(array('PHP_Compat', $methods[$type]), $component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,71 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Components.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
// Functions
|
||||
$components['function']['array_combine'] = '5.0.0';
|
||||
$components['function']['array_diff_assoc'] = '4.3.0';
|
||||
$components['function']['array_diff_key'] = '5.0.2';
|
||||
$components['function']['array_diff_ukey'] = '5.0.2';
|
||||
$components['function']['array_intersect_assoc'] = '5.0.0';
|
||||
$components['function']['array_intersect_key'] = '5.0.2';
|
||||
$components['function']['array_intersect_uassoc'] = '5.0.0';
|
||||
$components['function']['array_intersect_ukey'] = '5.0.2';
|
||||
$components['function']['array_udiff'] = '5.0.0';
|
||||
$components['function']['array_udiff_assoc'] = '5.0.0';
|
||||
$components['function']['array_udiff_uassoc'] = '5.0.0';
|
||||
$components['function']['array_uintersect'] = '5.0.0';
|
||||
$components['function']['array_uintersect_assoc'] = '5.0.0';
|
||||
$components['function']['array_uintersect_uassoc'] = '5.0.0';
|
||||
$components['function']['array_walk_recursive'] = '5.0.0';
|
||||
$components['function']['clone'] = '5.0.0';
|
||||
$components['function']['convert_uudecode'] = '5.0.0';
|
||||
$components['function']['convert_uuencode'] = '5.0.0';
|
||||
$components['function']['debug_print_backtrace'] = '5.0.0';
|
||||
$components['function']['file_get_contents'] = '4.3.0';
|
||||
$components['function']['file_put_contents'] = '5.0.0';
|
||||
$components['function']['fprintf'] = '5.0.0';
|
||||
$components['function']['get_headers'] = '5.0.0';
|
||||
$components['function']['get_include_path'] = '4.3.0';
|
||||
$components['function']['html_entity_decode'] = '4.3.0';
|
||||
$components['function']['http_build_query'] = '5.0.0';
|
||||
$components['function']['image_type_to_mime_type'] = '4.3.0';
|
||||
$components['function']['ob_get_clean'] = '4.3.0';
|
||||
$components['function']['ob_get_flush'] = '4.3.0';
|
||||
$components['function']['php_strip_whitespace'] = '5.0.0';
|
||||
$components['function']['restore_include_path'] = '4.3.0';
|
||||
$components['function']['scandir'] = '5.0.0';
|
||||
$components['function']['set_include_path'] = '4.3.0';
|
||||
$components['function']['str_ireplace'] = '5.0.0';
|
||||
$components['function']['str_shuffle'] = '4.3.0';
|
||||
$components['function']['str_split'] = '5.0.0';
|
||||
$components['function']['str_word_count'] = '4.3.0';
|
||||
$components['function']['stripos'] = '5.0.0';
|
||||
$components['function']['strpbrk'] = '5.0.0';
|
||||
$components['function']['strripos'] = '5.0.0';
|
||||
$components['function']['substr_compare'] = '5.0.0';
|
||||
|
||||
// Constants
|
||||
$components['constant']['E_STRICT'] = '5.0.0';
|
||||
$components['constant']['FILE'] = '4.3.0';
|
||||
$components['constant']['PHP_EOL'] = '5.0.1';
|
||||
$components['constant']['STD'] = '4.3.0';
|
||||
$components['constant']['T'] = '5.0.0';
|
||||
$components['constant']['UPLOAD_ERR'] = '4.3.0';
|
||||
?>
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: E_STRICT.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace constant E_STRICT
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/ref.errorfunc
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
*/
|
||||
if (!defined('E_STRICT')) {
|
||||
define('E_STRICT', 2048);
|
||||
}
|
||||
|
||||
?>
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: FILE.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace filesystem constants
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/ref.filesystem
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
*/
|
||||
if (!defined('FILE_USE_INCLUDE_PATH')) {
|
||||
define('FILE_USE_INCLUDE_PATH', 1);
|
||||
}
|
||||
|
||||
if (!defined('FILE_IGNORE_NEW_LINES')) {
|
||||
define('FILE_IGNORE_NEW_LINES', 2);
|
||||
}
|
||||
|
||||
if (!defined('FILE_SKIP_EMPTY_LINES')) {
|
||||
define('FILE_SKIP_EMPTY_LINES', 4);
|
||||
}
|
||||
|
||||
if (!defined('FILE_APPEND')) {
|
||||
define('FILE_APPEND', 8);
|
||||
}
|
||||
|
||||
if (!defined('FILE_NO_DEFAULT_CONTEXT')) {
|
||||
define('FILE_NO_DEFAULT_CONTEXT', 16);
|
||||
}
|
||||
|
||||
?>
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: PHP_EOL.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace PHP_EOL constant
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/reserved.constants.core
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.2
|
||||
*/
|
||||
if (!defined('PHP_EOL')) {
|
||||
switch (strtoupper(substr(PHP_OS, 0, 3))) {
|
||||
// Windows
|
||||
case 'WIN':
|
||||
define('PHP_EOL', "\r\n");
|
||||
break;
|
||||
|
||||
// Mac
|
||||
case 'DAR':
|
||||
define('PHP_EOL', "\r");
|
||||
break;
|
||||
|
||||
// Unix
|
||||
default:
|
||||
define('PHP_EOL', "\n");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: STD.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace commandline constants
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/features.commandline
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
*/
|
||||
if (!defined('STDIN')) {
|
||||
define('STDIN', fopen('php://stdin', 'r'));
|
||||
}
|
||||
|
||||
if (!defined('STDOUT')) {
|
||||
define('STDOUT', fopen('php://stdout', 'w'));
|
||||
}
|
||||
|
||||
if (!defined('STDERR')) {
|
||||
define('STDERR', fopen('php://stderr', 'w'));
|
||||
}
|
||||
|
||||
?>
|
@ -1,72 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: T.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace tokenizer constants
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/ref.tokenizer
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
*/
|
||||
if (!defined('T_ML_COMMENT')) {
|
||||
define('T_ML_COMMENT', T_COMMENT);
|
||||
}
|
||||
if (!defined('T_DOC_COMMENT')) {
|
||||
define('T_DOC_COMMENT', T_ML_COMMENT);
|
||||
}
|
||||
|
||||
if (!defined('T_OLD_FUNCTION')) {
|
||||
define('T_OLD_FUNCTION', -1);
|
||||
}
|
||||
if (!defined('T_ABSTRACT')) {
|
||||
define('T_ABSTRACT', -1);
|
||||
}
|
||||
if (!defined('T_CATCH')) {
|
||||
define('T_CATCH', -1);
|
||||
}
|
||||
if (!defined('T_FINAL')) {
|
||||
define('T_FINAL', -1);
|
||||
}
|
||||
if (!defined('T_INSTANCEOF')) {
|
||||
define('T_INSTANCEOF', -1);
|
||||
}
|
||||
if (!defined('T_PRIVATE')) {
|
||||
define('T_PRIVATE', -1);
|
||||
}
|
||||
if (!defined('T_PROTECTED')) {
|
||||
define('T_PROTECTED', -1);
|
||||
}
|
||||
if (!defined('T_PUBLIC')) {
|
||||
define('T_PUBLIC', -1);
|
||||
}
|
||||
if (!defined('T_THROW')) {
|
||||
define('T_THROW', -1);
|
||||
}
|
||||
if (!defined('T_TRY')) {
|
||||
define('T_TRY', -1);
|
||||
}
|
||||
if (!defined('T_CLONE')) {
|
||||
define('T_CLONE', -1);
|
||||
}
|
||||
|
||||
?>
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: UPLOAD_ERR.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace upload error constants
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/features.file-upload.errors
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
*/
|
||||
if (!defined('UPLOAD_ERR_OK')) {
|
||||
define('UPLOAD_ERR_OK', 0);
|
||||
}
|
||||
|
||||
if (!defined('UPLOAD_ERR_INI_SIZE')) {
|
||||
define('UPLOAD_ERR_INI_SIZE', 1);
|
||||
}
|
||||
|
||||
if (!defined('UPLOAD_ERR_FORM_SIZE')) {
|
||||
define('UPLOAD_ERR_FORM_SIZE', 2);
|
||||
}
|
||||
|
||||
if (!defined('UPLOAD_ERR_PARTIAL')) {
|
||||
define('UPLOAD_ERR_PARTIAL', 3);
|
||||
}
|
||||
|
||||
if (!defined('UPLOAD_ERR_NO_FILE')) {
|
||||
define('UPLOAD_ERR_NO_FILE', 4);
|
||||
}
|
||||
|
||||
?>
|
@ -1,71 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_combine.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_combine()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_combine
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('array_combine')) {
|
||||
function array_combine($keys, $values)
|
||||
{
|
||||
if (!is_array($keys)) {
|
||||
user_error('array_combine() expects parameter 1 to be array, ' .
|
||||
gettype($keys) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_array($values)) {
|
||||
user_error('array_combine() expects parameter 2 to be array, ' .
|
||||
gettype($values) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
$key_count = count($keys);
|
||||
$value_count = count($values);
|
||||
if ($key_count !== $value_count) {
|
||||
user_error('array_combine() Both parameters should have equal number of elements', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($key_count === 0 || $value_count === 0) {
|
||||
user_error('array_combine() Both parameters should have number of elements at least 0', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$keys = array_values($keys);
|
||||
$values = array_values($values);
|
||||
|
||||
$combined = array();
|
||||
for ($i = 0; $i < $key_count; $i++) {
|
||||
$combined[$keys[$i]] = $values[$i];
|
||||
}
|
||||
|
||||
return $combined;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,75 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_diff_assoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_diff_assoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_diff_assoc
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('array_diff_assoc')) {
|
||||
function array_diff_assoc()
|
||||
{
|
||||
// Check we have enough arguments
|
||||
$args = func_get_args();
|
||||
$count = count($args);
|
||||
if (count($args) < 2) {
|
||||
user_error('Wrong parameter count for array_diff_assoc()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_diff_assoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the comparison array
|
||||
$array_comp = array_shift($args);
|
||||
--$count;
|
||||
|
||||
// Traverse values of the first array
|
||||
foreach ($array_comp as $key => $value) {
|
||||
// Loop through the other arrays
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
// Loop through this arrays key/value pairs and compare
|
||||
foreach ($args[$i] as $comp_key => $comp_value) {
|
||||
if ((string)$key === (string)$comp_key &&
|
||||
(string)$value === (string)$comp_value)
|
||||
{
|
||||
|
||||
unset($array_comp[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $array_comp;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,66 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_diff_key.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_diff_key()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_diff_key
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.2
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('array_diff_key')) {
|
||||
function array_diff_key()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 2) {
|
||||
user_error('Wrong parameter count for array_diff_key()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_diff_key() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $args[0];
|
||||
foreach ($args[0] as $key1 => $value1) {
|
||||
for ($i = 1; $i !== $array_count; $i++) {
|
||||
foreach ($args[$i] as $key2 => $value2) {
|
||||
if ((string) $key1 === (string) $key2) {
|
||||
unset($result[$key2]);
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,83 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_diff_uassoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_diff_uassoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_diff_uassoc
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.0
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_diff_uassoc')) {
|
||||
function array_diff_uassoc()
|
||||
{
|
||||
// Sanity check
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_diff_uassoc()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0] . '::' . $compare_func[1];
|
||||
}
|
||||
user_error('array_diff_uassoc() Not a valid callback ' .
|
||||
$compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_diff_uassoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$result = array();
|
||||
foreach ($args[0] as $k => $v) {
|
||||
for ($i = 1; $i < $array_count; $i++) {
|
||||
foreach ($args[$i] as $kk => $vv) {
|
||||
if ($v == $vv) {
|
||||
$compare = call_user_func_array($compare_func, array($k, $kk));
|
||||
if ($compare == 0) {
|
||||
continue 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result[$k] = $v;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_diff_ukey.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_diff_ukey()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_diff_ukey
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.2
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_diff_ukey')) {
|
||||
function array_diff_ukey()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_diff_ukey()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0].'::'.$compare_func[1];
|
||||
}
|
||||
user_error('array_diff_ukey() Not a valid callback ' .
|
||||
$compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_diff_ukey() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$result = $args[0];
|
||||
foreach ($args[0] as $key1 => $value1) {
|
||||
for ($i = 1; $i !== $array_count; $i++) {
|
||||
foreach ($args[$i] as $key2 => $value2) {
|
||||
if (!(call_user_func($compare_func, (string) $key1, (string) $key2))) {
|
||||
unset($result[$key1]);
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,69 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_intersect_assoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_intersect_assoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_intersect_assoc
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('array_intersect_assoc')) {
|
||||
function array_intersect_assoc()
|
||||
{
|
||||
// Sanity check
|
||||
$args = func_get_args();
|
||||
if (count($args) < 2) {
|
||||
user_error('wrong parameter count for array_intersect_assoc()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_intersect_assoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$intersect = array();
|
||||
foreach ($args[0] as $key => $value) {
|
||||
$intersect[$key] = $value;
|
||||
|
||||
for ($i = 1; $i < $array_count; $i++) {
|
||||
if (!isset($args[$i][$key]) || $args[$i][$key] != $value) {
|
||||
unset($intersect[$key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $intersect;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,67 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_intersect_key.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_intersect_key()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_intersect_key
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.2
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('array_intersect_key')) {
|
||||
function array_intersect_key()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 2) {
|
||||
user_error('Wrong parameter count for array_intersect_key()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_intersect_key() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$result = array();
|
||||
foreach ($args[0] as $key1 => $value1) {
|
||||
for ($i = 1; $i !== $array_count; $i++) {
|
||||
foreach ($args[$i] as $key2 => $value2) {
|
||||
if ((string) $key1 === (string) $key2) {
|
||||
$result[$key1] = $value1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,90 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_intersect_uassoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_intersect_assoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_intersect_uassoc
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_intersect_uassoc')) {
|
||||
function array_intersect_uassoc()
|
||||
{
|
||||
// Sanity check
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_intersect_ukey()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0] . '::' . $compare_func[1];
|
||||
}
|
||||
user_error('array_intersect_uassoc() Not a valid callback ' .
|
||||
$compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_intersect_uassoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$result = array();
|
||||
foreach ($args[0] as $k => $v) {
|
||||
for ($i = 0; $i < $array_count; $i++) {
|
||||
$match = false;
|
||||
foreach ($args[$i] as $kk => $vv) {
|
||||
$compare = call_user_func_array($compare_func, array($k, $kk));
|
||||
if ($compare === 0 && $v == $vv) {
|
||||
$match = true;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
if ($match === false) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
if ($match === true) {
|
||||
$result[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_intersect_ukey.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_intersect_ukey()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_intersect_ukey
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.2
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_intersect_ukey')) {
|
||||
function array_intersect_ukey()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_intersect_ukey()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0].'::'.$compare_func[1];
|
||||
}
|
||||
user_error('array_diff_ukey() Not a valid callback ' .
|
||||
$compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i !== $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_intersect_ukey() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$result = array();
|
||||
foreach ($args[0] as $key1 => $value1) {
|
||||
for ($i = 1; $i !== $array_count; $i++) {
|
||||
foreach ($args[$i] as $key2 => $value2) {
|
||||
if (!(call_user_func($compare_func, (string) $key1, (string) $key2))) {
|
||||
$result[$key1] = $value1;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,83 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_udiff.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_udiff()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_udiff
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_udiff')) {
|
||||
function array_udiff()
|
||||
{
|
||||
$args = func_get_args();
|
||||
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_udiff()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0] . '::' . $compare_func[1];
|
||||
}
|
||||
user_error('array_udiff() Not a valid callback ' .
|
||||
$compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$cnt = count($args);
|
||||
for ($i = 0; $i < $cnt; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_udiff() Argument #' .
|
||||
($i + 1). ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$diff = array ();
|
||||
// Traverse values of the first array
|
||||
foreach ($args[0] as $key => $value) {
|
||||
// Check all arrays
|
||||
for ($i = 1; $i < $cnt; $i++) {
|
||||
foreach ($args[$i] as $cmp_value) {
|
||||
$result = call_user_func($compare_func, $value, $cmp_value);
|
||||
if ($result === 0) {
|
||||
continue 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
$diff[$key] = $value;
|
||||
}
|
||||
return $diff;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_udiff_assoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_udiff_assoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @link http://php.net/function.array-udiff-assoc
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_udiff_assoc')) {
|
||||
function array_udiff_assoc()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_udiff_assoc()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0] . '::' . $compare_func[1];
|
||||
}
|
||||
user_error('array_udiff_assoc() Not a valid callback ' .
|
||||
$compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$count = count($args);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_udiff_assoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$diff = array ();
|
||||
// Traverse values of the first array
|
||||
foreach ($args[0] as $key => $value) {
|
||||
// Check all arrays
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
if (!array_key_exists($key, $args[$i])) {
|
||||
continue;
|
||||
}
|
||||
$result = call_user_func($compare_func, $value, $args[$i][$key]);
|
||||
if ($result === 0) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$diff[$key] = $value;
|
||||
}
|
||||
|
||||
return $diff;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_udiff_uassoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_udiff_uassoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_udiff_uassoc
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_udiff_uassoc')) {
|
||||
function array_udiff_uassoc()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('Wrong parameter count for array_udiff_uassoc()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$compare_func = array_pop($args);
|
||||
if (!is_callable($compare_func)) {
|
||||
if (is_array($compare_func)) {
|
||||
$compare_func = $compare_func[0] . '::' . $compare_func[1];
|
||||
}
|
||||
user_error('array_udiff_uassoc() Not a valid callback ' . $compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$count = count($args);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_udiff_uassoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Traverse values of the first array
|
||||
$diff = array ();
|
||||
foreach ($args[0] as $key => $value) {
|
||||
// Check all arrays
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
if (!array_key_exists($key, $args[$i])) {
|
||||
continue;
|
||||
}
|
||||
$result = call_user_func($compare_func, $value, $args[$i][$key]);
|
||||
if ($result === 0) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$diff[$key] = $value;
|
||||
}
|
||||
|
||||
return $diff;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Tom Buskens <ortega@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_uintersect.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_uintersect()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_uintersect
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_uintersect')) {
|
||||
function array_uintersect()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('wrong parameter count for array_uintersect()',
|
||||
E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$user_func = array_pop($args);
|
||||
if (!is_callable($user_func)) {
|
||||
if (is_array($user_func)) {
|
||||
$user_func = $user_func[0] . '::' . $user_func[1];
|
||||
}
|
||||
user_error('array_uintersect() Not a valid callback ' .
|
||||
$user_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i < $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_uintersect() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$output = array();
|
||||
foreach ($args[0] as $key => $item) {
|
||||
for ($i = 1; $i !== $array_count; $i++) {
|
||||
$array = $args[$i];
|
||||
foreach($array as $key0 => $item0) {
|
||||
if (!call_user_func($user_func, $item, $item0)) {
|
||||
$output[$key] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,81 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Tom Buskens <ortega@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_uintersect_assoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_uintersect_assoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_uintersect_assoc
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_uintersect_assoc')) {
|
||||
function array_uintersect_assoc()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 3) {
|
||||
user_error('wrong parameter count for array_uintersect_assoc()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get compare function
|
||||
$user_func = array_pop($args);
|
||||
if (!is_callable($user_func)) {
|
||||
if (is_array($user_func)) {
|
||||
$user_func = $user_func[0] . '::' . $user_func[1];
|
||||
}
|
||||
user_error('array_uintersect_assoc() Not a valid callback ' .
|
||||
$user_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$array_count = count($args);
|
||||
for ($i = 0; $i < $array_count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_uintersect_assoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Compare entries
|
||||
$output = array();
|
||||
foreach ($args[0] as $key => $item) {
|
||||
for ($i = 1; $i !== $array_count; $i++) {
|
||||
if (array_key_exists($key, $args[$i])) {
|
||||
$compare = call_user_func($user_func, $item, $args[$i][$key]);
|
||||
if ($compare === 0) {
|
||||
$output[$key] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_uintersect_uassoc.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_uintersect_uassoc()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_uintersect_uassoc
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_uintersect_uassoc')) {
|
||||
function array_uintersect_uassoc()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (count($args) < 4) {
|
||||
user_error('Wrong parameter count for array_uintersect_uassoc()',
|
||||
E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get key_compare_func
|
||||
$key_compare_func = array_pop($args);
|
||||
if (!is_callable($key_compare_func)) {
|
||||
if (is_array($key_compare_func)) {
|
||||
$key_compare_func = $key_compare_func[0] . '::' . $key_compare_func[1];
|
||||
}
|
||||
user_error('array_uintersect_uassoc() Not a valid callback ' .
|
||||
$key_compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get data_compare_func
|
||||
$data_compare_func = array_pop($args);
|
||||
if (!is_callable($data_compare_func)) {
|
||||
if (is_array($data_compare_func)) {
|
||||
$data_compare_func = $data_compare_func[0] . '::' . $data_compare_func[1];
|
||||
}
|
||||
user_error('array_uintersect_uassoc() Not a valid callback '
|
||||
. $data_compare_func, E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check arrays
|
||||
$count = count($args);
|
||||
for ($i = 0; $i !== $count; $i++) {
|
||||
if (!is_array($args[$i])) {
|
||||
user_error('array_uintersect_uassoc() Argument #' .
|
||||
($i + 1) . ' is not an array', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Traverse values of the first array
|
||||
$intersect = array ();
|
||||
foreach ($args[0] as $key => $value) {
|
||||
// Check against each array
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
// Traverse each element in current array
|
||||
foreach ($args[$i] as $ckey => $cvalue) {
|
||||
// Compare key and value
|
||||
if (call_user_func($key_compare_func, $key, $ckey) === 0 &&
|
||||
call_user_func($data_compare_func, $value, $cvalue) === 0)
|
||||
{
|
||||
|
||||
$intersect[$key] = $value;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $intersect;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Tom Buskens <ortega@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: array_walk_recursive.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace array_walk_recursive()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.array_walk_recursive
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.6 (is_callable)
|
||||
*/
|
||||
if (!function_exists('array_walk_recursive')) {
|
||||
function array_walk_recursive(&$input, $funcname)
|
||||
{
|
||||
if (!is_callable($funcname)) {
|
||||
if (is_array($funcname)) {
|
||||
$funcname = $funcname[0] . '::' . $funcname[1];
|
||||
}
|
||||
user_error('array_walk_recursive() Not a valid callback ' . $user_func,
|
||||
E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_array($input)) {
|
||||
user_error('array_walk_recursive() The argument should be an array',
|
||||
E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
$args = func_get_args();
|
||||
|
||||
foreach ($input as $key => $item) {
|
||||
if (is_array($item)) {
|
||||
array_walk_recursive($item, $funcname, $args);
|
||||
$input[$key] = $item;
|
||||
} else {
|
||||
$args[0] = &$item;
|
||||
$args[1] = &$key;
|
||||
call_user_func_array($funcname, $args);
|
||||
$input[$key] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: clone.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace clone()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/language.oop5.cloning
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (version_compare(phpversion(), '5.0') === -1) {
|
||||
// Needs to be wrapped in eval as clone is a keyword in PHP5
|
||||
eval('
|
||||
function clone($object)
|
||||
{
|
||||
// Sanity check
|
||||
if (!is_object($object)) {
|
||||
user_error(\'clone() __clone method called on non-object\', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Use serialize/unserialize trick to deep copy the object
|
||||
$object = unserialize(serialize($object));
|
||||
|
||||
// If there is a __clone method call it on the "new" class
|
||||
if (method_exists($object, \'__clone\')) {
|
||||
$object->__clone();
|
||||
}
|
||||
|
||||
return $object;
|
||||
}
|
||||
');
|
||||
}
|
||||
|
||||
?>
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Michael Wallner <mike@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: convert_uudecode.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace convert_uudecode()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.convert_uudecode
|
||||
* @author Michael Wallner <mike@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('convert_uudecode')) {
|
||||
function convert_uudecode($string)
|
||||
{
|
||||
// Sanity check
|
||||
if (!is_scalar($string)) {
|
||||
user_error('convert_uuencode() expects parameter 1 to be string, ' .
|
||||
gettype($string) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strlen($string) < 8) {
|
||||
user_error('convert_uuencode() The given parameter is not a valid uuencoded string', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$decoded = '';
|
||||
foreach (explode("\n", $string) as $line) {
|
||||
|
||||
$c = count($bytes = unpack('c*', substr(trim($line), 1)));
|
||||
|
||||
while ($c % 4) {
|
||||
$bytes[++$c] = 0;
|
||||
}
|
||||
|
||||
foreach (array_chunk($bytes, 4) as $b) {
|
||||
$b0 = $b[0] == 0x60 ? 0 : $b[0] - 0x20;
|
||||
$b1 = $b[1] == 0x60 ? 0 : $b[1] - 0x20;
|
||||
$b2 = $b[2] == 0x60 ? 0 : $b[2] - 0x20;
|
||||
$b3 = $b[3] == 0x60 ? 0 : $b[3] - 0x20;
|
||||
|
||||
$b0 <<= 2;
|
||||
$b0 |= ($b1 >> 4) & 0x03;
|
||||
$b1 <<= 4;
|
||||
$b1 |= ($b2 >> 2) & 0x0F;
|
||||
$b2 <<= 6;
|
||||
$b2 |= $b3 & 0x3F;
|
||||
|
||||
$decoded .= pack('c*', $b0, $b1, $b2);
|
||||
}
|
||||
}
|
||||
|
||||
return rtrim($decoded, "\0");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Michael Wallner <mike@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: convert_uuencode.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace convert_uuencode()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.convert_uuencode
|
||||
* @author Michael Wallner <mike@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('convert_uuencode')) {
|
||||
function convert_uuencode($string)
|
||||
{
|
||||
// Sanity check
|
||||
if (!is_scalar($string)) {
|
||||
user_error('convert_uuencode() expects parameter 1 to be string, ' .
|
||||
gettype($string) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$u = 0;
|
||||
$encoded = '';
|
||||
|
||||
while ($c = count($bytes = unpack('c*', substr($string, $u, 45)))) {
|
||||
$u += 45;
|
||||
$encoded .= pack('c', $c + 0x20);
|
||||
|
||||
while ($c % 3) {
|
||||
$bytes[++$c] = 0;
|
||||
}
|
||||
|
||||
foreach (array_chunk($bytes, 3) as $b) {
|
||||
$b0 = ($b[0] & 0xFC) >> 2;
|
||||
$b1 = (($b[0] & 0x03) << 4) + (($b[1] & 0xF0) >> 4);
|
||||
$b2 = (($b[1] & 0x0F) << 2) + (($b[2] & 0xC0) >> 6);
|
||||
$b3 = $b[2] & 0x3F;
|
||||
|
||||
$b0 = $b0 ? $b0 + 0x20 : 0x60;
|
||||
$b1 = $b1 ? $b1 + 0x20 : 0x60;
|
||||
$b2 = $b2 ? $b2 + 0x20 : 0x60;
|
||||
$b3 = $b3 ? $b3 + 0x20 : 0x60;
|
||||
|
||||
$encoded .= pack('c*', $b0, $b1, $b2, $b3);
|
||||
}
|
||||
|
||||
$encoded .= "\n";
|
||||
}
|
||||
|
||||
// Add termination characters
|
||||
$encoded .= "\x60\n";
|
||||
|
||||
return $encoded;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,67 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Laurent Laville <pear@laurent-laville.org> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: debug_print_backtrace.php,v 1.1 2005/07/23 05:56:02 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace debug_print_backtrace()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.debug_print_backtrace
|
||||
* @author Laurent Laville <pear@laurent-laville.org>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0
|
||||
*/
|
||||
if (!function_exists('debug_print_backtrace2')) {
|
||||
function debug_print_backtrace2()
|
||||
{
|
||||
// Get backtrace
|
||||
$backtrace = debug_backtrace();
|
||||
|
||||
// Unset call to debug_print_backtrace
|
||||
array_shift($backtrace);
|
||||
|
||||
// Iterate backtrace
|
||||
$calls = array();
|
||||
foreach ($backtrace as $i => $call) {
|
||||
$location = $call['file'] . ':' . $call['line'];
|
||||
$function = (isset($call['class'])) ?
|
||||
$call['class'] . '.' . $call['function'] :
|
||||
$call['function'];
|
||||
|
||||
$params = '';
|
||||
if (isset($call['args'])) {
|
||||
$params = implode(', ', $call['args']);
|
||||
}
|
||||
|
||||
$calls[] = sprintf('#%d %s(%s) called at [%s]',
|
||||
$i,
|
||||
$function,
|
||||
$params,
|
||||
$location);
|
||||
}
|
||||
|
||||
echo implode("\n", $calls);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: file_get_contents.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace file_get_contents()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.file_get_contents
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @internal resource_context is not supported
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('file_get_contents')) {
|
||||
function file_get_contents($filename, $incpath = false, $resource_context = null)
|
||||
{
|
||||
if (false === $fh = fopen($filename, 'rb', $incpath)) {
|
||||
user_error('file_get_contents() failed to open stream: No such file or directory',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
if ($fsize = @filesize($filename)) {
|
||||
$data = fread($fh, $fsize);
|
||||
} else {
|
||||
$data = '';
|
||||
while (!feof($fh)) {
|
||||
$data .= fread($fh, 8192);
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,104 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: file_put_contents.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
if (!defined('FILE_USE_INCLUDE_PATH')) {
|
||||
define('FILE_USE_INCLUDE_PATH', 1);
|
||||
}
|
||||
|
||||
if (!defined('FILE_APPEND')) {
|
||||
define('FILE_APPEND', 8);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace file_put_contents()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.file_put_contents
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @internal resource_context is not supported
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('file_put_contents')) {
|
||||
function file_put_contents($filename, $content, $flags = null, $resource_context = null)
|
||||
{
|
||||
// If $content is an array, convert it to a string
|
||||
if (is_array($content)) {
|
||||
$content = implode('', $content);
|
||||
}
|
||||
|
||||
// If we don't have a string, throw an error
|
||||
if (!is_scalar($content)) {
|
||||
user_error('file_put_contents() The 2nd parameter should be either a string or an array',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the length of date to write
|
||||
$length = strlen($content);
|
||||
|
||||
// Check what mode we are using
|
||||
$mode = ($flags & FILE_APPEND) ?
|
||||
$mode = 'a' :
|
||||
$mode = 'w';
|
||||
|
||||
// Check if we're using the include path
|
||||
$use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ?
|
||||
true :
|
||||
false;
|
||||
|
||||
// Open the file for writing
|
||||
if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) {
|
||||
user_error('file_put_contents() failed to open stream: Permission denied',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Write to the file
|
||||
$bytes = 0;
|
||||
if (($bytes = @fwrite($fh, $content)) === false) {
|
||||
$errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s',
|
||||
$length,
|
||||
$filename);
|
||||
user_error($errormsg, E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Close the handle
|
||||
@fclose($fh);
|
||||
|
||||
// Check all the data was written
|
||||
if ($bytes != $length) {
|
||||
$errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.',
|
||||
$bytes,
|
||||
$length);
|
||||
user_error($errormsg, E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return length
|
||||
return $bytes;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,54 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: fprintf.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace fprintf()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.fprintf
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('fprintf')) {
|
||||
function fprintf() {
|
||||
$args = func_get_args();
|
||||
|
||||
if (count($args) < 2) {
|
||||
user_error('Wrong parameter count for fprintf()', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
$resource_handle = array_shift($args);
|
||||
$format = array_shift($args);
|
||||
|
||||
if (!is_resource($resource_handle)) {
|
||||
user_error('fprintf() supplied argument is not a valid stream resource',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
return fwrite($resource_handle, vsprintf($format, $args));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,77 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: get_headers.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace get_headers()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.get_headers
|
||||
* @author Aeontech <aeontech@gmail.com>
|
||||
* @author Cpurruc <cpurruc@fh-landshut.de>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5.0.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('get_headers')) {
|
||||
function get_headers($url, $format = 0)
|
||||
{
|
||||
// Init
|
||||
$urlinfo = parse_url($url);
|
||||
$port = isset($urlinfo['port']) ? $urlinfo['port'] : 80;
|
||||
|
||||
// Connect
|
||||
$fp = fsockopen($urlinfo['host'], $port, $errno, $errstr, 30);
|
||||
if ($fp === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send request
|
||||
$head = 'HEAD ' . $urlinfo['path'] .
|
||||
(isset($urlinfo['query']) ? '?' . $urlinfo['query'] : '') .
|
||||
' HTTP/1.0' . "\r\n" .
|
||||
'Host: ' . $urlinfo['host'] . "\r\n\r\n";
|
||||
fputs($fp, $head);
|
||||
|
||||
// Read
|
||||
while (!feof($fp)) {
|
||||
if ($header = trim(fgets($fp, 1024))) {
|
||||
list($key) = explode(':', $header);
|
||||
|
||||
if ($format === 1) {
|
||||
// First element is the HTTP header type, such as HTTP 200 OK
|
||||
// It doesn't have a separate name, so check for it
|
||||
if ($key == $header) {
|
||||
$headers[] = $header;
|
||||
} else {
|
||||
$headers[$key] = substr($header, strlen($key)+2);
|
||||
}
|
||||
} else {
|
||||
$headers[] = $header;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: get_include_path.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace get_include_path()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.get_include_path
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0
|
||||
*/
|
||||
if (!function_exists('get_include_path')) {
|
||||
function get_include_path()
|
||||
{
|
||||
return ini_get('include_path');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,72 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: David Irvine <dave@codexweb.co.za> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: html_entity_decode.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
if (!defined('ENT_NOQUOTES')) {
|
||||
define('ENT_NOQUOTES', 0);
|
||||
}
|
||||
|
||||
if (!defined('ENT_COMPAT')) {
|
||||
define('ENT_COMPAT', 2);
|
||||
}
|
||||
|
||||
if (!defined('ENT_QUOTES')) {
|
||||
define('ENT_QUOTES', 3);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace html_entity_decode()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.html_entity_decode
|
||||
* @author David Irvine <dave@codexweb.co.za>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @internal Setting the charset will not do anything
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('html_entity_decode')) {
|
||||
function html_entity_decode($string, $quote_style = ENT_COMPAT, $charset = null)
|
||||
{
|
||||
if (!is_int($quote_style)) {
|
||||
user_error('html_entity_decode() expects parameter 2 to be long, ' .
|
||||
gettype($quote_style) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
|
||||
$trans_tbl = array_flip($trans_tbl);
|
||||
|
||||
// Add single quote to translation table;
|
||||
$trans_tbl['''] = '\'';
|
||||
|
||||
// Not translating double quotes
|
||||
if ($quote_style & ENT_NOQUOTES) {
|
||||
// Remove double quote from translation table
|
||||
unset($trans_tbl['"']);
|
||||
}
|
||||
|
||||
return strtr($string, $trans_tbl);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,99 +0,0 @@
|
||||
<?PHP
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: http_build_query.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace function http_build_query()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.http-build-query
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('http_build_query')) {
|
||||
function http_build_query($formdata, $numeric_prefix = null)
|
||||
{
|
||||
// If $formdata is an object, convert it to an array
|
||||
if (is_object($formdata)) {
|
||||
$formdata = get_object_vars($formdata);
|
||||
}
|
||||
|
||||
// Check we have an array to work with
|
||||
if (!is_array($formdata)) {
|
||||
user_error('http_build_query() Parameter 1 expected to be Array or Object. Incorrect value given.',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the array is empty, return null
|
||||
if (empty($formdata)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Argument seperator
|
||||
$separator = ini_get('arg_separator.output');
|
||||
|
||||
// Start building the query
|
||||
$tmp = array ();
|
||||
foreach ($formdata as $key => $val) {
|
||||
if (is_integer($key) && $numeric_prefix != null) {
|
||||
$key = $numeric_prefix . $key;
|
||||
}
|
||||
|
||||
if (is_scalar($val)) {
|
||||
array_push($tmp, urlencode($key).'='.urlencode($val));
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the value is an array, recursively parse it
|
||||
if (is_array($val)) {
|
||||
array_push($tmp, __http_build_query($val, urlencode($key)));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return implode($separator, $tmp);
|
||||
}
|
||||
|
||||
// Helper function
|
||||
function __http_build_query ($array, $name)
|
||||
{
|
||||
$tmp = array ();
|
||||
foreach ($array as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
array_push($tmp, __http_build_query($value, sprintf('%s[%s]', $name, $key)));
|
||||
} elseif (is_scalar($value)) {
|
||||
array_push($tmp, sprintf('%s[%s]=%s', $name, urlencode($key), urlencode($value)));
|
||||
} elseif (is_object($value)) {
|
||||
array_push($tmp, __http_build_query(get_object_vars($value), sprintf('%s[%s]', $name, $key)));
|
||||
}
|
||||
}
|
||||
|
||||
// Argument seperator
|
||||
$separator = ini_get('arg_separator.output');
|
||||
|
||||
return implode($separator, $tmp);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,147 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: image_type_to_mime_type.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
if (!defined('IMAGETYPE_GIF')) {
|
||||
define('IMAGETYPE_GIF', 1);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_JPEG')) {
|
||||
define('IMAGETYPE_JPEG', 2);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_PNG')) {
|
||||
define('IMAGETYPE_PNG', 3);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_SWF')) {
|
||||
define('IMAGETYPE_SWF', 4);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_PSD')) {
|
||||
define('IMAGETYPE_PSD', 5);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_BMP')) {
|
||||
define('IMAGETYPE_BMP', 6);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_TIFF_II')) {
|
||||
define('IMAGETYPE_TIFF_II', 7);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_TIFF_MM')) {
|
||||
define('IMAGETYPE_TIFF_MM', 8);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_JPC')) {
|
||||
define('IMAGETYPE_JPC', 9);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_JP2')) {
|
||||
define('IMAGETYPE_JP2', 10);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_JPX')) {
|
||||
define('IMAGETYPE_JPX', 11);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_JB2')) {
|
||||
define('IMAGETYPE_JB2', 12);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_SWC')) {
|
||||
define('IMAGETYPE_SWC', 13);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_IFF')) {
|
||||
define('IMAGETYPE_IFF', 14);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_WBMP')) {
|
||||
define('IMAGETYPE_WBMP', 15);
|
||||
}
|
||||
|
||||
if (!defined('IMAGETYPE_XBM')) {
|
||||
define('IMAGETYPE_XBM', 16);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace image_type_to_mime_type()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.image_type_to_mime_type
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('image_type_to_mime_type')) {
|
||||
function image_type_to_mime_type($imagetype)
|
||||
{
|
||||
switch ($imagetype):
|
||||
case IMAGETYPE_GIF:
|
||||
return 'image/gif';
|
||||
break;
|
||||
case IMAGETYPE_JPEG:
|
||||
return 'image/jpeg';
|
||||
break;
|
||||
case IMAGETYPE_PNG:
|
||||
return 'image/png';
|
||||
break;
|
||||
case IMAGETYPE_SWF:
|
||||
case IMAGETYPE_SWC:
|
||||
return 'application/x-shockwave-flash';
|
||||
break;
|
||||
case IMAGETYPE_PSD:
|
||||
return 'image/psd';
|
||||
break;
|
||||
case IMAGETYPE_BMP:
|
||||
return 'image/bmp';
|
||||
break;
|
||||
case IMAGETYPE_TIFF_MM:
|
||||
case IMAGETYPE_TIFF_II:
|
||||
return 'image/tiff';
|
||||
break;
|
||||
case IMAGETYPE_JP2:
|
||||
return 'image/jp2';
|
||||
break;
|
||||
case IMAGETYPE_IFF:
|
||||
return 'image/iff';
|
||||
break;
|
||||
case IMAGETYPE_WBMP:
|
||||
return 'image/vnd.wap.wbmp';
|
||||
break;
|
||||
case IMAGETYPE_XBM:
|
||||
return 'image/xbm';
|
||||
break;
|
||||
case IMAGETYPE_JPX:
|
||||
case IMAGETYPE_JB2:
|
||||
case IMAGETYPE_JPC:
|
||||
default:
|
||||
return 'application/octet-stream';
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: ob_get_clean.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace ob_get_clean()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.ob_get_clean
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @author Thiemo Mättig (http://maettig.com/)
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('ob_get_clean')) {
|
||||
function ob_get_clean()
|
||||
{
|
||||
$contents = ob_get_contents();
|
||||
|
||||
if ($contents !== false) {
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: ob_get_flush.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace ob_get_flush()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.ob_get_flush
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @author Thiemo Mättig (http://maettig.com/)
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('ob_get_flush')) {
|
||||
function ob_get_flush()
|
||||
{
|
||||
$contents = ob_get_contents();
|
||||
|
||||
if ($contents !== false) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,86 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: php_strip_whitespace.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace php_strip_whitespace()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.php_strip_whitespace
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error) + Tokenizer extension
|
||||
*/
|
||||
if (!function_exists('php_strip_whitespace')) {
|
||||
function php_strip_whitespace($file)
|
||||
{
|
||||
// Sanity check
|
||||
if (!is_scalar($file)) {
|
||||
user_error('php_strip_whitespace() expects parameter 1 to be string, ' .
|
||||
gettype($file) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Load file / tokens
|
||||
$source = implode('', file($file));
|
||||
$tokens = token_get_all($source);
|
||||
|
||||
// Init
|
||||
$source = '';
|
||||
$was_ws = false;
|
||||
|
||||
// Process
|
||||
foreach ($tokens as $token) {
|
||||
if (is_string($token)) {
|
||||
// Single character tokens
|
||||
$source .= $token;
|
||||
} else {
|
||||
list($id, $text) = $token;
|
||||
|
||||
switch ($id) {
|
||||
// Skip all comments
|
||||
case T_COMMENT:
|
||||
case T_ML_COMMENT:
|
||||
case T_DOC_COMMENT:
|
||||
break;
|
||||
|
||||
// Remove whitespace
|
||||
case T_WHITESPACE:
|
||||
// We don't want more than one whitespace in a row replaced
|
||||
if ($was_ws !== true) {
|
||||
$source .= ' ';
|
||||
}
|
||||
$was_ws = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$was_ws = false;
|
||||
$source .= $text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $source;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: restore_include_path.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace restore_include_path()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.restore_include_path
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
*/
|
||||
if (!function_exists('restore_include_path')) {
|
||||
function restore_include_path()
|
||||
{
|
||||
return ini_restore('include_path');
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,69 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: scandir.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace scandir()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.scandir
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('scandir')) {
|
||||
function scandir($directory, $sorting_order = 0)
|
||||
{
|
||||
if (!is_string($directory)) {
|
||||
user_error('scandir() expects parameter 1 to be string, ' .
|
||||
gettype($directory) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_int($sorting_order) && !is_bool($sorting_order)) {
|
||||
user_error('scandir() expects parameter 2 to be long, ' .
|
||||
gettype($sorting_order) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_dir($directory) || (false === $fh = @opendir($directory))) {
|
||||
user_error('scandir() failed to open dir: Invalid argument', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$files = array ();
|
||||
while (false !== ($filename = readdir($fh))) {
|
||||
$files[] = $filename;
|
||||
}
|
||||
|
||||
closedir($fh);
|
||||
|
||||
if ($sorting_order == 1) {
|
||||
rsort($files);
|
||||
} else {
|
||||
sort($files);
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: set_include_path.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace set_include_path()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.set_include_path
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
*/
|
||||
if (!function_exists('set_include_path')) {
|
||||
function set_include_path($new_include_path)
|
||||
{
|
||||
return ini_set('include_path', $new_include_path);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,113 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: str_ireplace.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace str_ireplace()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.str_ireplace
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
* @note count not by returned by reference, to enable
|
||||
* change '$count = null' to '&$count'
|
||||
*/
|
||||
if (!function_exists('str_ireplace')) {
|
||||
function str_ireplace($search, $replace, $subject, $count = null)
|
||||
{
|
||||
// Sanity check
|
||||
if (is_string($search) && is_array($replace)) {
|
||||
user_error('Array to string conversion', E_USER_NOTICE);
|
||||
$replace = (string) $replace;
|
||||
}
|
||||
|
||||
// If search isn't an array, make it one
|
||||
if (!is_array($search)) {
|
||||
$search = array ($search);
|
||||
}
|
||||
$search = array_values($search);
|
||||
|
||||
// If replace isn't an array, make it one, and pad it to the length of search
|
||||
if (!is_array($replace)) {
|
||||
$replace_string = $replace;
|
||||
|
||||
$replace = array ();
|
||||
for ($i = 0, $c = count($search); $i < $c; $i++) {
|
||||
$replace[$i] = $replace_string;
|
||||
}
|
||||
}
|
||||
$replace = array_values($replace);
|
||||
|
||||
// Check the replace array is padded to the correct length
|
||||
$length_replace = count($replace);
|
||||
$length_search = count($search);
|
||||
if ($length_replace < $length_search) {
|
||||
for ($i = $length_replace; $i < $length_search; $i++) {
|
||||
$replace[$i] = '';
|
||||
}
|
||||
}
|
||||
|
||||
// If subject is not an array, make it one
|
||||
$was_array = false;
|
||||
if (!is_array($subject)) {
|
||||
$was_array = true;
|
||||
$subject = array ($subject);
|
||||
}
|
||||
|
||||
// Loop through each subject
|
||||
$count = 0;
|
||||
foreach ($subject as $subject_key => $subject_value) {
|
||||
// Loop through each search
|
||||
foreach ($search as $search_key => $search_value) {
|
||||
// Split the array into segments, in between each part is our search
|
||||
$segments = explode(strtolower($search_value), strtolower($subject_value));
|
||||
|
||||
// The number of replacements done is the number of segments minus the first
|
||||
$count += count($segments) - 1;
|
||||
$pos = 0;
|
||||
|
||||
// Loop through each segment
|
||||
foreach ($segments as $segment_key => $segment_value) {
|
||||
// Replace the lowercase segments with the upper case versions
|
||||
$segments[$segment_key] = substr($subject_value, $pos, strlen($segment_value));
|
||||
// Increase the position relative to the initial string
|
||||
$pos += strlen($segment_value) + strlen($search_value);
|
||||
}
|
||||
|
||||
// Put our original string back together
|
||||
$subject_value = implode($replace[$search_key], $segments);
|
||||
}
|
||||
|
||||
$result[$subject_key] = $subject_value;
|
||||
}
|
||||
|
||||
// Check if subject was initially a string and return it as a string
|
||||
if ($was_array === true) {
|
||||
return $result[0];
|
||||
}
|
||||
|
||||
// Otherwise, just return the array
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,53 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: str_shuffle.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace str_shuffle()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.str_shuffle
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('str_shuffle')) {
|
||||
function str_shuffle($str)
|
||||
{
|
||||
$newstr = '';
|
||||
$strlen = strlen($str);
|
||||
$str = (string) $str;
|
||||
|
||||
// Seed
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
$seed = (float) $sec + ((float) $usec * 100000);
|
||||
mt_srand($seed);
|
||||
|
||||
// Shuffle
|
||||
for ($i = 0; $strlen > $i; $i++) {
|
||||
$newstr .= $str[mt_rand(0, $strlen - 1)];
|
||||
}
|
||||
|
||||
return $newstr;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: str_split.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace str_split()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.str_split
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('str_split')) {
|
||||
function str_split($string, $split_length = 1)
|
||||
{
|
||||
if (!is_scalar($split_length)) {
|
||||
user_error('str_split() expects parameter 2 to be long, ' .
|
||||
gettype($split_length) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$split_length = (int) $split_length;
|
||||
if ($split_length < 1) {
|
||||
user_error('str_split() The length of each segment must be greater than zero', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
preg_match_all('/.{1,' . $split_length . '}/s', $string, $matches);
|
||||
return $matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: str_word_count.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace str_word_count()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.str_word_count
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 4.3.0
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('str_word_count')) {
|
||||
function str_word_count($string, $format = null)
|
||||
{
|
||||
if ($format !== 1 && $format !== 2 && $format !== null) {
|
||||
user_error('str_word_count() The specified format parameter, "' . $format . '" is invalid',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$word_string = preg_replace('/[0-9]+/', '', $string);
|
||||
$word_array = preg_split('/[^A-Za-z0-9_\']+/', $word_string, -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
switch ($format) {
|
||||
case null:
|
||||
$result = count($word_array);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$result = $word_array;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$lastmatch = 0;
|
||||
$word_assoc = array();
|
||||
foreach ($word_array as $word) {
|
||||
$word_assoc[$lastmatch = strpos($string, $word, $lastmatch)] = $word;
|
||||
$lastmatch += strlen($word);
|
||||
}
|
||||
$result = $word_assoc;
|
||||
break;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: stripos.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace stripos()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.stripos
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('stripos')) {
|
||||
function stripos($haystack, $needle, $offset = null)
|
||||
{
|
||||
if (!is_scalar($haystack)) {
|
||||
user_error('stripos() expects parameter 1 to be string, ' .
|
||||
gettype($haystack) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_scalar($needle)) {
|
||||
user_error('stripos() needle is not a string or an integer.', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_int($offset) && !is_bool($offset) && !is_null($offset)) {
|
||||
user_error('stripos() expects parameter 3 to be long, ' .
|
||||
gettype($offset) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Manipulate the string if there is an offset
|
||||
$fix = 0;
|
||||
if (!is_null($offset)) {
|
||||
if ($offset > 0) {
|
||||
$haystack = substr($haystack, $offset, strlen($haystack) - $offset);
|
||||
$fix = $offset;
|
||||
}
|
||||
}
|
||||
|
||||
$segments = explode(strtolower($needle), strtolower($haystack), 2);
|
||||
|
||||
// Check there was a match
|
||||
if (count($segments) == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$position = strlen($segments[0]) + $fix;
|
||||
return $position;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,63 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stephan Schmidt <schst@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: strpbrk.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace strpbrk()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.strpbrk
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('strpbrk')) {
|
||||
function strpbrk($haystack, $char_list)
|
||||
{
|
||||
if (!is_scalar($haystack)) {
|
||||
user_error('strpbrk() expects parameter 1 to be string, ' .
|
||||
gettype($haystack) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_scalar($char_list)) {
|
||||
user_error('strpbrk() expects parameter 2 to be scalar, ' .
|
||||
gettype($needle) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$haystack = (string) $haystack;
|
||||
$char_list = (string) $char_list;
|
||||
|
||||
$len = strlen($haystack);
|
||||
for ($i = 0; $i < $len; $i++) {
|
||||
$char = substr($haystack, $i, 1);
|
||||
if (strpos($char_list, $char) === false) {
|
||||
continue;
|
||||
}
|
||||
return substr($haystack, $i);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Aidan Lister <aidan@php.net> |
|
||||
// | Stephan Schmidt <schst@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: strripos.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace strripos()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.strripos
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @author Stephan Schmidt <schst@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('strripos')) {
|
||||
function strripos($haystack, $needle, $offset = null)
|
||||
{
|
||||
if (!is_scalar($haystack)) {
|
||||
user_error('strripos() expects parameter 1 to be scalar, ' .
|
||||
gettype($haystack) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_scalar($needle)) {
|
||||
user_error('strripos() expects parameter 2 to be scalar, ' .
|
||||
gettype($needle) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_int($offset) && !is_bool($offset) && !is_null($offset)) {
|
||||
user_error('strripos() expects parameter 3 to be long, ' .
|
||||
gettype($offset) . ' given', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Manipulate the string if there is an offset
|
||||
$fix = 0;
|
||||
if (!is_null($offset)) {
|
||||
// If the offset is larger than the haystack, return
|
||||
if (abs($offset) >= strlen($haystack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check whether offset is negative or positive
|
||||
if ($offset > 0) {
|
||||
$haystack = substr($haystack, $offset, strlen($haystack) - $offset);
|
||||
// We need to add this to the position of the needle
|
||||
$fix = $offset;
|
||||
} else {
|
||||
$haystack = substr($haystack, 0, strlen($haystack) + $offset);
|
||||
}
|
||||
}
|
||||
|
||||
$segments = explode(strtolower($needle), strtolower($haystack));
|
||||
|
||||
$last_seg = count($segments) - 1;
|
||||
$position = strlen($haystack) + $fix - strlen($segments[$last_seg]) - strlen($needle);
|
||||
|
||||
return $position;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Tom Buskens <ortega@php.net> |
|
||||
// | Aidan Lister <aidan@php.net> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: substr_compare.php,v 1.1 2005/07/23 05:56:03 Tony Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Replace substr_compare()
|
||||
*
|
||||
* @category PHP
|
||||
* @package PHP_Compat
|
||||
* @link http://php.net/function.substr_compare
|
||||
* @author Tom Buskens <ortega@php.net>
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @version $Revision: 1.1 $
|
||||
* @since PHP 5
|
||||
* @require PHP 4.0.0 (user_error)
|
||||
*/
|
||||
if (!function_exists('substr_compare')) {
|
||||
function substr_compare($main_str, $str, $offset, $length = null, $case_insensitive = false)
|
||||
{
|
||||
if (!is_string($main_str)) {
|
||||
user_error('substr_compare() expects parameter 1 to be string, ' .
|
||||
gettype($main_str) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_string($str)) {
|
||||
user_error('substr_compare() expects parameter 2 to be string, ' .
|
||||
gettype($str) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_int($offset)) {
|
||||
user_error('substr_compare() expects parameter 3 to be long, ' .
|
||||
gettype($offset) . ' given', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_null($length)) {
|
||||
$length = strlen($main_str) - $offset;
|
||||
} elseif ($offset >= strlen($main_str)) {
|
||||
user_error('substr_compare() The start position cannot exceed initial string length',
|
||||
E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
$main_str = substr($main_str, $offset, $length);
|
||||
$str = substr($str, 0, strlen($main_str));
|
||||
|
||||
if ($case_insensitive === false) {
|
||||
return strcmp($main_str, $str);
|
||||
} else {
|
||||
return strcasecmp($main_str, $str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,182 +1,182 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2003 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 2.02 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/2_02.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Stefan Neufeind <pear.neufeind@speedpartner.de> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Color.php,v 1.3 2005/09/14 17:25:46 nosey Exp $
|
||||
|
||||
/**
|
||||
* Class for color-handling
|
||||
*
|
||||
* @author Stefan Neufeind <pear.neufeind@speedpartner.de>
|
||||
* @package Image_Canvas
|
||||
* @category images
|
||||
* @license The PHP License, version 2.02
|
||||
*/
|
||||
|
||||
/**
|
||||
* Color class to be extended; from package PEAR::Image_Color
|
||||
*/
|
||||
require_once 'Image/Color.php';
|
||||
|
||||
/**
|
||||
* Class for color-handling
|
||||
*
|
||||
* This is used to extend the functionality of the current PEAR::Image_Color v0.4.
|
||||
* I hope to be allowed to incorporate some of the improvements in a new Image_Color release.
|
||||
*
|
||||
* @author Stefan Neufeind <pear.neufeind@speedpartner.de>
|
||||
* @package Image_Canvas
|
||||
* @access public
|
||||
*/
|
||||
class Image_Canvas_Color extends Image_Color
|
||||
{
|
||||
/**
|
||||
* Allocates a color in the given image.
|
||||
*
|
||||
* Userdefined color specifications get translated into
|
||||
* an array of rgb values.
|
||||
*
|
||||
* @param resource GD-resource
|
||||
* @param mixed any color representation supported by color2RGB()
|
||||
* @return resource Image color handle
|
||||
* @see color2RGB()
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function allocateColor(&$img, $color)
|
||||
{
|
||||
$color = Image_Canvas_Color::color2RGB($color);
|
||||
|
||||
if (($color[3] == 255) || (!function_exists("imagecolorallocatealpha"))) {
|
||||
return imagecolorallocate($img, $color[0], $color[1], $color[2]);
|
||||
} else {
|
||||
return imagecolorallocatealpha($img, $color[0], $color[1], $color[2], 127-round(($color[3]*127)/255));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert any color-representation into an array of 4 ints (RGBA).
|
||||
*
|
||||
* Userdefined color specifications get translated into
|
||||
* an array of rgb values.
|
||||
*
|
||||
* @param mixed any color representation supported by Image_Canvas_Color::color2RGB()
|
||||
* @return array Array of 4 ints (RGBA-representation)
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function color2RGB($color)
|
||||
{
|
||||
if (is_array($color)) {
|
||||
if (!is_numeric($color[0])) {
|
||||
return null; // error
|
||||
}
|
||||
if (count($color) == 3) { // assume RGB-color
|
||||
|
||||
// 255 = alpha-value; full opaque
|
||||
return array((int) $color[0],
|
||||
(int) $color[1],
|
||||
(int) $color[2],
|
||||
255);
|
||||
}
|
||||
if (count($color) == 4) { // assume RGBA-color
|
||||
|
||||
// 255 = alpha-value; full opaque
|
||||
return array((int) $color[0],
|
||||
(int) $color[1],
|
||||
(int) $color[2],
|
||||
(int) $color[3]);
|
||||
}
|
||||
return null; // error
|
||||
} elseif (is_string($color)) {
|
||||
$alphaPos = strpos($color, '@');
|
||||
if ($alphaPos === false) {
|
||||
$alpha = 255;
|
||||
} else {
|
||||
$alphaFloat = (float) substr($color, $alphaPos+1);
|
||||
// restrict to range 0..1
|
||||
$alphaFloat = max(min($alphaFloat, 1), 0);
|
||||
$alpha = (int) round((float) 255 * $alphaFloat);
|
||||
$color = substr($color, 0, $alphaPos);
|
||||
}
|
||||
if ($color[0] == '#') { // hex-color given, e.g. #FFB4B4
|
||||
$tempColor = parent::hex2rgb($color);
|
||||
return array((int) $tempColor[0],
|
||||
(int) $tempColor[1],
|
||||
(int) $tempColor[2],
|
||||
$alpha);
|
||||
}
|
||||
if (strpos($color,'%') !== false) {
|
||||
$tempColor = parent::percentageColor2RGB($color);
|
||||
return array((int) $tempColor[0],
|
||||
(int) $tempColor[1],
|
||||
(int) $tempColor[2],
|
||||
$alpha);
|
||||
} else {
|
||||
$tempColor = parent::namedColor2RGB($color);
|
||||
return array((int) $tempColor[0],
|
||||
(int) $tempColor[1],
|
||||
(int) $tempColor[2],
|
||||
$alpha);
|
||||
}
|
||||
} else {
|
||||
return null; // error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getRange
|
||||
* Given a degree, you can get the range of colors between one color and
|
||||
* another color.
|
||||
*
|
||||
* @access public
|
||||
* @param string How much each 'step' between the colors we should take.
|
||||
* @return array Returns an array of all the colors, one element for each color.
|
||||
*/
|
||||
function getRange ($degrees)
|
||||
{
|
||||
$tempColors = parent::getRange($degrees);
|
||||
|
||||
// now add alpha-channel information
|
||||
$steps = count($tempColors);
|
||||
for($counter=0;$counter<$steps;$counter++) {
|
||||
$tempColors[$counter] = parent::hex2rgb($tempColors[$counter]);
|
||||
unset($tempColors[$counter]['hex']);
|
||||
$tempColors[$counter][3] = (int) round(
|
||||
(((float) $this->color1[3]*($steps-$counter))+
|
||||
((float) $this->color2[3]*($counter))
|
||||
) / $steps
|
||||
);
|
||||
}
|
||||
|
||||
return $tempColors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to correctly set the colors.
|
||||
*
|
||||
* @param mixed color 1
|
||||
* @param mixed color 2
|
||||
* @access private
|
||||
*/
|
||||
function _setColors ( $col1, $col2 )
|
||||
{
|
||||
$this->color1 = Image_Canvas_Color::color2RGB($col1);
|
||||
$this->color2 = Image_Canvas_Color::color2RGB($col2);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 4 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2003 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 2.02 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available at through the world-wide-web at |
|
||||
// | http://www.php.net/license/2_02.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Author: Stefan Neufeind <pear.neufeind@speedpartner.de> |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: Color.php,v 1.3 2005/09/14 17:25:46 nosey Exp $
|
||||
|
||||
/**
|
||||
* Class for color-handling
|
||||
*
|
||||
* @author Stefan Neufeind <pear.neufeind@speedpartner.de>
|
||||
* @package Image_Canvas
|
||||
* @category images
|
||||
* @license The PHP License, version 2.02
|
||||
*/
|
||||
|
||||
/**
|
||||
* Color class to be extended; from package PEAR::Image_Color
|
||||
*/
|
||||
require_once 'Image/Color.php';
|
||||
|
||||
/**
|
||||
* Class for color-handling
|
||||
*
|
||||
* This is used to extend the functionality of the current PEAR::Image_Color v0.4.
|
||||
* I hope to be allowed to incorporate some of the improvements in a new Image_Color release.
|
||||
*
|
||||
* @author Stefan Neufeind <pear.neufeind@speedpartner.de>
|
||||
* @package Image_Canvas
|
||||
* @access public
|
||||
*/
|
||||
class Image_Canvas_Color extends Image_Color
|
||||
{
|
||||
/**
|
||||
* Allocates a color in the given image.
|
||||
*
|
||||
* Userdefined color specifications get translated into
|
||||
* an array of rgb values.
|
||||
*
|
||||
* @param resource GD-resource
|
||||
* @param mixed any color representation supported by color2RGB()
|
||||
* @return resource Image color handle
|
||||
* @see color2RGB()
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function allocateColor(&$img, $color)
|
||||
{
|
||||
$color = Image_Canvas_Color::color2RGB($color);
|
||||
|
||||
if (($color[3] == 255) || (!function_exists("imagecolorallocatealpha"))) {
|
||||
return imagecolorallocate($img, $color[0], $color[1], $color[2]);
|
||||
} else {
|
||||
return imagecolorallocatealpha($img, $color[0], $color[1], $color[2], 127-round(($color[3]*127)/255));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert any color-representation into an array of 4 ints (RGBA).
|
||||
*
|
||||
* Userdefined color specifications get translated into
|
||||
* an array of rgb values.
|
||||
*
|
||||
* @param mixed any color representation supported by Image_Canvas_Color::color2RGB()
|
||||
* @return array Array of 4 ints (RGBA-representation)
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function color2RGB($color)
|
||||
{
|
||||
if (is_array($color)) {
|
||||
if (!is_numeric($color[0])) {
|
||||
return null; // error
|
||||
}
|
||||
if (count($color) == 3) { // assume RGB-color
|
||||
|
||||
// 255 = alpha-value; full opaque
|
||||
return array((int) $color[0],
|
||||
(int) $color[1],
|
||||
(int) $color[2],
|
||||
255);
|
||||
}
|
||||
if (count($color) == 4) { // assume RGBA-color
|
||||
|
||||
// 255 = alpha-value; full opaque
|
||||
return array((int) $color[0],
|
||||
(int) $color[1],
|
||||
(int) $color[2],
|
||||
(int) $color[3]);
|
||||
}
|
||||
return null; // error
|
||||
} elseif (is_string($color)) {
|
||||
$alphaPos = strpos($color, '@');
|
||||
if ($alphaPos === false) {
|
||||
$alpha = 255;
|
||||
} else {
|
||||
$alphaFloat = (float) substr($color, $alphaPos+1);
|
||||
// restrict to range 0..1
|
||||
$alphaFloat = max(min($alphaFloat, 1), 0);
|
||||
$alpha = (int) round((float) 255 * $alphaFloat);
|
||||
$color = substr($color, 0, $alphaPos);
|
||||
}
|
||||
if ($color[0] == '#') { // hex-color given, e.g. #FFB4B4
|
||||
$tempColor = parent::hex2rgb($color);
|
||||
return array((int) $tempColor[0],
|
||||
(int) $tempColor[1],
|
||||
(int) $tempColor[2],
|
||||
$alpha);
|
||||
}
|
||||
if (strpos($color,'%') !== false) {
|
||||
$tempColor = parent::percentageColor2RGB($color);
|
||||
return array((int) $tempColor[0],
|
||||
(int) $tempColor[1],
|
||||
(int) $tempColor[2],
|
||||
$alpha);
|
||||
} else {
|
||||
$tempColor = parent::namedColor2RGB($color);
|
||||
return array((int) $tempColor[0],
|
||||
(int) $tempColor[1],
|
||||
(int) $tempColor[2],
|
||||
$alpha);
|
||||
}
|
||||
} else {
|
||||
return null; // error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getRange
|
||||
* Given a degree, you can get the range of colors between one color and
|
||||
* another color.
|
||||
*
|
||||
* @access public
|
||||
* @param string How much each 'step' between the colors we should take.
|
||||
* @return array Returns an array of all the colors, one element for each color.
|
||||
*/
|
||||
function getRange ($degrees)
|
||||
{
|
||||
$tempColors = parent::getRange($degrees);
|
||||
|
||||
// now add alpha-channel information
|
||||
$steps = count($tempColors);
|
||||
for($counter=0;$counter<$steps;$counter++) {
|
||||
$tempColors[$counter] = parent::hex2rgb($tempColors[$counter]);
|
||||
unset($tempColors[$counter]['hex']);
|
||||
$tempColors[$counter][3] = (int) round(
|
||||
(((float) $this->color1[3]*($steps-$counter))+
|
||||
((float) $this->color2[3]*($counter))
|
||||
) / $steps
|
||||
);
|
||||
}
|
||||
|
||||
return $tempColors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to correctly set the colors.
|
||||
*
|
||||
* @param mixed color 1
|
||||
* @param mixed color 2
|
||||
* @access private
|
||||
*/
|
||||
function _setColors ( $col1, $col2 )
|
||||
{
|
||||
$this->color1 = Image_Canvas_Color::color2RGB($col1);
|
||||
$this->color2 = Image_Canvas_Color::color2RGB($col2);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,12 +1,12 @@
|
||||
This is where the font files are located.
|
||||
|
||||
Font files can be found at:
|
||||
|
||||
MS CoreFonts
|
||||
http://corefonts.sourceforge.net/
|
||||
|
||||
Divide By Zero (most are cartoonish)
|
||||
http://fonts.tom7.com/
|
||||
|
||||
MING FDB Fonts
|
||||
This is where the font files are located.
|
||||
|
||||
Font files can be found at:
|
||||
|
||||
MS CoreFonts
|
||||
http://corefonts.sourceforge.net/
|
||||
|
||||
Divide By Zero (most are cartoonish)
|
||||
http://fonts.tom7.com/
|
||||
|
||||
MING FDB Fonts
|
||||
http://ming.sf.net/
|
@ -1,25 +1,25 @@
|
||||
Arial,arial.ttf
|
||||
Arial Bold,arialbd.ttf
|
||||
Arial Bold Italic,arialbi.ttf
|
||||
Arial Italic,ariali.ttf
|
||||
Courier New,cour.ttf
|
||||
Courier New Bold,courbd.ttf
|
||||
Courier New Bold Italic,courbi.ttf
|
||||
Courier New Italic,couri.ttf
|
||||
Garamond,gara.ttf
|
||||
Garamond Bold,garabd.ttf
|
||||
Garamond Italic,garait.ttf
|
||||
Gothic,gothic.ttf
|
||||
Gothic Bold,gothicb.ttf
|
||||
Gothic Bold Italic,gothicbi.ttf
|
||||
Gothic Italic,gothici.ttf
|
||||
Sans Serif,micross.ttf
|
||||
Reference Sans Serif,refsan.ttf
|
||||
Times New Roman,times.ttf
|
||||
Times New Roman Bold,timesbd.ttf
|
||||
Times New Roman Bold Italic,timesbi.ttf
|
||||
Times New Roman Italic,timesi.ttf
|
||||
Verdana,verdana.ttf
|
||||
Verdana Bold,verdanab.ttf
|
||||
Verdana Bold Italic,verdanaz.ttf
|
||||
Arial,arial.ttf
|
||||
Arial Bold,arialbd.ttf
|
||||
Arial Bold Italic,arialbi.ttf
|
||||
Arial Italic,ariali.ttf
|
||||
Courier New,cour.ttf
|
||||
Courier New Bold,courbd.ttf
|
||||
Courier New Bold Italic,courbi.ttf
|
||||
Courier New Italic,couri.ttf
|
||||
Garamond,gara.ttf
|
||||
Garamond Bold,garabd.ttf
|
||||
Garamond Italic,garait.ttf
|
||||
Gothic,gothic.ttf
|
||||
Gothic Bold,gothicb.ttf
|
||||
Gothic Bold Italic,gothicbi.ttf
|
||||
Gothic Italic,gothici.ttf
|
||||
Sans Serif,micross.ttf
|
||||
Reference Sans Serif,refsan.ttf
|
||||
Times New Roman,times.ttf
|
||||
Times New Roman Bold,timesbd.ttf
|
||||
Times New Roman Bold Italic,timesbi.ttf
|
||||
Times New Roman Italic,timesi.ttf
|
||||
Verdana,verdana.ttf
|
||||
Verdana Bold,verdanab.ttf
|
||||
Verdana Bold Italic,verdanaz.ttf
|
||||
Verdana Italic,verdanai.ttf
|
@ -1,119 +1,119 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Canvas
|
||||
*
|
||||
* Canvas class to handle JPEG format.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: JPG.php,v 1.2 2005/08/24 20:37:34 nosey Exp $
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Canvas/GD.php
|
||||
*/
|
||||
require_once 'Image/Canvas/GD.php';
|
||||
|
||||
/**
|
||||
* JPEG Canvas class.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
class Image_Canvas_GD_JPG extends Image_Canvas_GD
|
||||
{
|
||||
|
||||
/**
|
||||
* The JPEG quality
|
||||
* @var int
|
||||
* @access private
|
||||
*/
|
||||
var $_quality = 75;
|
||||
|
||||
/**
|
||||
* Create the JPEG canvas
|
||||
*
|
||||
* Additional parameters other than those available for common {@link
|
||||
* Image_Graph_Canvas_GD} class are:
|
||||
*
|
||||
* 'quality' The JPEG quality in as a percentage value from 0 (lowest
|
||||
* quality, smallest file) to 100 (highest quality, biggest file)
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
*/
|
||||
function Image_Canvas_GD_JPG($param)
|
||||
{
|
||||
parent::Image_Canvas_GD($param);
|
||||
|
||||
if (isset($param['quality'])) {
|
||||
$this->_quality = max(0, min(100, $param['quality']));
|
||||
}
|
||||
|
||||
$this->rectangle(
|
||||
array(
|
||||
'x0' => $this->_left,
|
||||
'y0' => $this->_top,
|
||||
'x1' => $this->_left + $this->_width - 1,
|
||||
'y1' => $this->_top + $this->_height - 1,
|
||||
'fill' => 'white',
|
||||
'line' => 'transparent'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function show($param = false)
|
||||
{
|
||||
parent::show($param);
|
||||
header('Content-type: image/jpg');
|
||||
header('Content-Disposition: inline; filename = \"'. basename($_SERVER['PHP_SELF'], '.php') . '.jpg\"');
|
||||
ImageJPEG($this->_canvas, '', $this->_quality);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function save($param = false)
|
||||
{
|
||||
parent::save($param);
|
||||
ImageJPEG($this->_canvas, $param['filename'], $this->_quality);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Canvas
|
||||
*
|
||||
* Canvas class to handle JPEG format.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: JPG.php,v 1.2 2005/08/24 20:37:34 nosey Exp $
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Canvas/GD.php
|
||||
*/
|
||||
require_once 'Image/Canvas/GD.php';
|
||||
|
||||
/**
|
||||
* JPEG Canvas class.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
class Image_Canvas_GD_JPG extends Image_Canvas_GD
|
||||
{
|
||||
|
||||
/**
|
||||
* The JPEG quality
|
||||
* @var int
|
||||
* @access private
|
||||
*/
|
||||
var $_quality = 75;
|
||||
|
||||
/**
|
||||
* Create the JPEG canvas
|
||||
*
|
||||
* Additional parameters other than those available for common {@link
|
||||
* Image_Graph_Canvas_GD} class are:
|
||||
*
|
||||
* 'quality' The JPEG quality in as a percentage value from 0 (lowest
|
||||
* quality, smallest file) to 100 (highest quality, biggest file)
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
*/
|
||||
function Image_Canvas_GD_JPG($param)
|
||||
{
|
||||
parent::Image_Canvas_GD($param);
|
||||
|
||||
if (isset($param['quality'])) {
|
||||
$this->_quality = max(0, min(100, $param['quality']));
|
||||
}
|
||||
|
||||
$this->rectangle(
|
||||
array(
|
||||
'x0' => $this->_left,
|
||||
'y0' => $this->_top,
|
||||
'x1' => $this->_left + $this->_width - 1,
|
||||
'y1' => $this->_top + $this->_height - 1,
|
||||
'fill' => 'white',
|
||||
'line' => 'transparent'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function show($param = false)
|
||||
{
|
||||
parent::show($param);
|
||||
header('Content-type: image/jpg');
|
||||
header('Content-Disposition: inline; filename = \"'. basename($_SERVER['PHP_SELF'], '.php') . '.jpg\"');
|
||||
ImageJPEG($this->_canvas, '', $this->_quality);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function save($param = false)
|
||||
{
|
||||
parent::save($param);
|
||||
ImageJPEG($this->_canvas, $param['filename'], $this->_quality);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,125 +1,125 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Canvas
|
||||
*
|
||||
* Canvas class to handle PNG format.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: PNG.php,v 1.3 2005/08/24 20:37:34 nosey Exp $
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Canvas/GD.php
|
||||
*/
|
||||
require_once 'Image/Canvas/GD.php';
|
||||
|
||||
/**
|
||||
* PNG Canvas class.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
class Image_Canvas_GD_PNG extends Image_Canvas_GD
|
||||
{
|
||||
|
||||
/**
|
||||
* Create the PNG canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
*/
|
||||
function Image_Canvas_GD_PNG($param)
|
||||
{
|
||||
parent::Image_Canvas_GD($param);
|
||||
|
||||
if ((isset($param['transparent'])) && ($param['transparent']) &&
|
||||
($this->_gd2)
|
||||
) {
|
||||
if ($param['transparent'] === true) {
|
||||
$transparent = '#123ABD';
|
||||
} else {
|
||||
$transparent = $param['transparent'];
|
||||
}
|
||||
$color = $this->_color($transparent);
|
||||
$trans = ImageColorTransparent($this->_canvas, $color);
|
||||
|
||||
$this->rectangle(
|
||||
array(
|
||||
'x0' => $this->_left,
|
||||
'y0' => $this->_top,
|
||||
'x1' => $this->_left + $this->_width - 1,
|
||||
'y1' => $this->_top + $this->_height - 1,
|
||||
'fill' => 'opague',
|
||||
'line' => 'transparent'
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$this->rectangle(
|
||||
array(
|
||||
'x0' => $this->_left,
|
||||
'y0' => $this->_top,
|
||||
'x1' => $this->_left + $this->_width - 1,
|
||||
'y1' => $this->_top + $this->_height - 1,
|
||||
'fill' => 'white',
|
||||
'line' => 'transparent'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function show($param = false)
|
||||
{
|
||||
parent::show($param);
|
||||
header('Content-type: image/png');
|
||||
header('Content-Disposition: inline; filename = \"'. basename($_SERVER['PHP_SELF'], '.php') . '.png\"');
|
||||
ImagePNG($this->_canvas);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function save($param = false)
|
||||
{
|
||||
parent::save($param);
|
||||
ImagePNG($this->_canvas, $param['filename']);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Canvas
|
||||
*
|
||||
* Canvas class to handle PNG format.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: PNG.php,v 1.3 2005/08/24 20:37:34 nosey Exp $
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Canvas/GD.php
|
||||
*/
|
||||
require_once 'Image/Canvas/GD.php';
|
||||
|
||||
/**
|
||||
* PNG Canvas class.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
class Image_Canvas_GD_PNG extends Image_Canvas_GD
|
||||
{
|
||||
|
||||
/**
|
||||
* Create the PNG canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
*/
|
||||
function Image_Canvas_GD_PNG($param)
|
||||
{
|
||||
parent::Image_Canvas_GD($param);
|
||||
|
||||
if ((isset($param['transparent'])) && ($param['transparent']) &&
|
||||
($this->_gd2)
|
||||
) {
|
||||
if ($param['transparent'] === true) {
|
||||
$transparent = '#123ABD';
|
||||
} else {
|
||||
$transparent = $param['transparent'];
|
||||
}
|
||||
$color = $this->_color($transparent);
|
||||
$trans = ImageColorTransparent($this->_canvas, $color);
|
||||
|
||||
$this->rectangle(
|
||||
array(
|
||||
'x0' => $this->_left,
|
||||
'y0' => $this->_top,
|
||||
'x1' => $this->_left + $this->_width - 1,
|
||||
'y1' => $this->_top + $this->_height - 1,
|
||||
'fill' => 'opague',
|
||||
'line' => 'transparent'
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$this->rectangle(
|
||||
array(
|
||||
'x0' => $this->_left,
|
||||
'y0' => $this->_top,
|
||||
'x1' => $this->_left + $this->_width - 1,
|
||||
'y1' => $this->_top + $this->_height - 1,
|
||||
'fill' => 'white',
|
||||
'line' => 'transparent'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function show($param = false)
|
||||
{
|
||||
parent::show($param);
|
||||
header('Content-type: image/png');
|
||||
header('Content-Disposition: inline; filename = \"'. basename($_SERVER['PHP_SELF'], '.php') . '.png\"');
|
||||
ImagePNG($this->_canvas);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas
|
||||
*
|
||||
* @param array $param Parameter array
|
||||
* @abstract
|
||||
*/
|
||||
function save($param = false)
|
||||
{
|
||||
parent::save($param);
|
||||
ImagePNG($this->_canvas, $param['filename']);
|
||||
ImageDestroy($this->_canvas);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,354 +1,354 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Canvas
|
||||
*
|
||||
* Class for handling output as a HTML imagemap
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: ImageMap.php,v 1.6 2005/08/17 17:59:11 nosey Exp $
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class for handling output as a HTML imagemap
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
* @since version 0.2.0
|
||||
*/
|
||||
class Image_Canvas_ImageMap extends Image_Canvas
|
||||
{
|
||||
|
||||
/**
|
||||
* The image map (if any)
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_map = array();
|
||||
|
||||
/**
|
||||
* Add a map tag
|
||||
* @param string $shape The shape, either rect, circle or polygon
|
||||
* @param string $coords The list of coordinates for the shape
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function _addMapTag($shape, $coords, $params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$url = $params['url'];
|
||||
$target = (isset($params['target']) ? $params['target'] : false);
|
||||
$alt = (isset($params['alt']) ? $params['alt'] : false);
|
||||
|
||||
$tags = '';
|
||||
if (isset($params['htmltags'])) {
|
||||
foreach ($params['htmltags'] as $key => $value) {
|
||||
$tags .= ' ';
|
||||
if (strpos($value, '"') >= 0) {
|
||||
$tags .= $key . '=\'' . $value . '\'';
|
||||
} else {
|
||||
$tags .= $key . '="' . $value . '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_map[] =
|
||||
'<area shape="' . $shape . '" coords="' . $coords . '" href="' . $url . '"' .
|
||||
($target ? ' target="' . $target . '"' : '') .
|
||||
($alt ? ' alt="' . $alt . '"' : '') .
|
||||
(isset($params['id']) ? ' id="' . $params['id'] . '"' : '') .
|
||||
$tags .
|
||||
'>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a line
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x0': int X start point
|
||||
* 'y0': int Y start point
|
||||
* 'x1': int X end point
|
||||
* 'y1': int Y end point
|
||||
* 'color': mixed [optional] The line color
|
||||
* 'mapsize': int [optional] The size of the image map (surrounding the line)
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function line($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$mapsize = (isset($params['mapsize']) ? $params['mapsize'] : 2);
|
||||
$this->_addMapTag(
|
||||
'polygon',
|
||||
$this->_getX($params['x0'] - $mapsize) . ',' .
|
||||
$this->_getY($params['y0'] - $mapsize) . ',' .
|
||||
$this->_getX($params['x1'] + $mapsize) . ',' .
|
||||
$this->_getY($params['y1'] - $mapsize) . ',' .
|
||||
|
||||
$this->_getX($params['x1'] + $mapsize) . ',' .
|
||||
$this->_getY($params['y1'] + $mapsize) . ',' .
|
||||
$this->_getX($params['x0'] - $mapsize) . ',' .
|
||||
$this->_getY($params['y0'] + $mapsize),
|
||||
$params
|
||||
);
|
||||
}
|
||||
parent::line($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a polygon
|
||||
*
|
||||
* Parameter array:
|
||||
* 'connect': bool [optional] Specifies whether the start point should be
|
||||
* connected to the endpoint (closed polygon) or not (connected line)
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* 'map_vertices': bool [optional] Specifies whether the image map should map the vertices instead of the polygon as a whole
|
||||
* 'url': string [optional] URL to link the polygon as a whole to (also used for default in case 'map_vertices' is used)
|
||||
* 'alt': string [optional] Alternative text to show in the image map (also used for default in case 'map_vertices' is used)
|
||||
* 'target': string [optional] The link target on the image map (also used for default in case 'map_vertices' is used)
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function polygon($params)
|
||||
{
|
||||
if ((isset($params['map_vertices'])) && ($params['map_vertices'] === true)) {
|
||||
$mapsize = (isset($params['mapsize']) ? $params['mapsize'] : 2);
|
||||
foreach ($this->_polygon as $point) {
|
||||
$vertex_param = $params;
|
||||
if (isset($point['url'])) {
|
||||
$vertex_param['url'] = $point['url'];
|
||||
}
|
||||
if (isset($point['target'])) {
|
||||
$vertex_param['target'] = $point['target'];
|
||||
}
|
||||
if (isset($point['alt'])) {
|
||||
$vertex_param['alt'] = $point['alt'];
|
||||
}
|
||||
$vertex_mapsize = $mapsize;
|
||||
if (isset($point['mapsize'])) {
|
||||
$vertex_mapsize = $point['mapsize'];
|
||||
}
|
||||
if (isset($point['htmltags'])) {
|
||||
$vertex_param['htmltags'] = $point['htmltags'];
|
||||
}
|
||||
$this->_addMapTag(
|
||||
'circle',
|
||||
$this->_getX($point['X']) . ',' .
|
||||
$this->_getY($point['Y']) . ',' .
|
||||
$mapsize,
|
||||
$vertex_param
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (isset($params['url'])) {
|
||||
$points = '';
|
||||
foreach ($this->_polygon as $point) {
|
||||
if ($points != '') {
|
||||
$points .= ',';
|
||||
}
|
||||
$points .= $this->_getX($point['X']) . ',' . $this->_getY($point['Y']);
|
||||
}
|
||||
$this->_addMapTag('polygon', $points, $params);
|
||||
}
|
||||
parent::polygon($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a rectangle
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x0': int X start point
|
||||
* 'y0': int Y start point
|
||||
* 'x1': int X end point
|
||||
* 'y1': int Y end point
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function rectangle($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$this->_addMapTag(
|
||||
'rect',
|
||||
$this->_getX($params['x0']) . ',' .
|
||||
$this->_getY($params['y0']) . ',' .
|
||||
$this->_getX($params['x1']) . ',' .
|
||||
$this->_getY($params['y1']),
|
||||
$params
|
||||
);
|
||||
}
|
||||
parent::rectangle($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw an ellipse
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x': int X center point
|
||||
* 'y': int Y center point
|
||||
* 'rx': int X radius
|
||||
* 'ry': int Y radius
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function ellipse($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
if ($params['rx'] == $params['ry']) {
|
||||
$this->_addMapTag(
|
||||
'circle',
|
||||
$this->_getX($params['x']) . ',' .
|
||||
$this->_getY($params['y']) . ',' .
|
||||
$this->_getX($params['rx']),
|
||||
$params
|
||||
);
|
||||
} else {
|
||||
$points = '';
|
||||
for ($v = 0; $v <= 360; $v += 30) {
|
||||
if ($points != '') {
|
||||
$points .= ',';
|
||||
}
|
||||
$points .=
|
||||
round($this->_getX($params['x']) + $this->_getX($params['rx']) * cos(deg2rad($v % 360))) . ',' .
|
||||
round($this->_getY($params['y']) + $this->_getX($params['ry']) * sin(deg2rad($v % 360)));
|
||||
}
|
||||
$this->_addMapTag(
|
||||
'polygon',
|
||||
$points,
|
||||
$params
|
||||
);
|
||||
}
|
||||
}
|
||||
parent::ellipse($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a pie slice
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x': int X center point
|
||||
* 'y': int Y center point
|
||||
* 'rx': int X radius
|
||||
* 'ry': int Y radius
|
||||
* 'v1': int The starting angle (in degrees)
|
||||
* 'v2': int The end angle (in degrees)
|
||||
* 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
|
||||
* 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function pieslice($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$x = $this->_getX($params['x']);
|
||||
$y = $this->_getY($params['y']);
|
||||
$rx = $params['rx'];
|
||||
$ry = $params['ry'];
|
||||
$v1a = $params['v1'];
|
||||
$v2a = $params['v2'];
|
||||
$v1 = min($v1a, $v2a);
|
||||
$v2 = max($v1a, $v2a);
|
||||
$srx = (isset($params['srx']) ? $params['srx'] : 0);
|
||||
$sry = (isset($params['sry']) ? $params['sry'] : 0);
|
||||
|
||||
$points =
|
||||
round(($x + $srx * cos(deg2rad($v1 % 360)))) . ',' .
|
||||
round(($y + $sry * sin(deg2rad($v1 % 360)))) . ',';
|
||||
|
||||
for ($v = $v1; $v < $v2; $v += 30) {
|
||||
$points .=
|
||||
round(($x + $rx * cos(deg2rad($v % 360)))) . ',' .
|
||||
round(($y + $ry * sin(deg2rad($v % 360)))) . ',';
|
||||
}
|
||||
|
||||
$points .=
|
||||
round(($x + $rx * cos(deg2rad($v2 % 360)))) . ',' .
|
||||
round(($y + $ry * sin(deg2rad($v2 % 360))));
|
||||
|
||||
if (($srx != 0) || ($sry != 0)) {
|
||||
$points .= ',';
|
||||
for ($v = $v2; $v > $v1; $v -= 30) {
|
||||
$points .=
|
||||
round(($x + $srx * cos(deg2rad($v % 360)))) . ',' .
|
||||
round(($y + $sry * sin(deg2rad($v % 360)))) . ',';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->_addMapTag('polygon', $points, $params);
|
||||
}
|
||||
parent::pieslice($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas to the browser
|
||||
*
|
||||
* @param array $params Parameter array, the contents and meaning depends on the actual Canvas
|
||||
* @abstract
|
||||
*/
|
||||
function show($params = false)
|
||||
{
|
||||
parent::show($params);
|
||||
if (count($this->_map) > 0) {
|
||||
print $this->toHtml($params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the result of the canvas to a file
|
||||
*
|
||||
* Parameter array:
|
||||
* 'filename': string The file to output to
|
||||
* @param array $params Parameter array, the contents and meaning depends on the actual Canvas
|
||||
* @abstract
|
||||
*/
|
||||
function save($params = false)
|
||||
{
|
||||
parent::save($params);
|
||||
$file = fopen($param['filename'], 'w+');
|
||||
fwrite($file, $this->toHtml($params));
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a canvas specific HTML tag.
|
||||
*
|
||||
* Parameter array:
|
||||
* 'name': string The name of the image map
|
||||
*/
|
||||
function toHtml($params)
|
||||
{
|
||||
if (count($this->_map) > 0) {
|
||||
return '<map name="' . $params['name'] . '">' . "\n\t" . implode($this->_map, "\n\t") . "\n</map>";
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Canvas
|
||||
*
|
||||
* Class for handling output as a HTML imagemap
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: ImageMap.php,v 1.8 2006/10/24 18:58:16 nosey Exp $
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class for handling output as a HTML imagemap
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Canvas
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
|
||||
* @since version 0.2.0
|
||||
*/
|
||||
class Image_Canvas_ImageMap extends Image_Canvas
|
||||
{
|
||||
|
||||
/**
|
||||
* The image map (if any)
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_map = array();
|
||||
|
||||
/**
|
||||
* Add a map tag
|
||||
* @param string $shape The shape, either rect, circle or polygon
|
||||
* @param string $coords The list of coordinates for the shape
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function _addMapTag($shape, $coords, $params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$url = $params['url'];
|
||||
$target = (isset($params['target']) ? $params['target'] : false);
|
||||
$alt = (isset($params['alt']) ? $params['alt'] : false);
|
||||
|
||||
$tags = '';
|
||||
if (isset($params['htmltags'])) {
|
||||
foreach ($params['htmltags'] as $key => $value) {
|
||||
$tags .= ' ';
|
||||
if (strpos($value, '"') !== false) {
|
||||
$tags .= $key . '=\'' . $value . '\'';
|
||||
} else {
|
||||
$tags .= $key . '="' . $value . '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_map[] =
|
||||
'<area shape="' . $shape . '" coords="' . $coords . '" href="' . $url . '"' .
|
||||
($target ? ' target="' . $target . '"' : '') .
|
||||
($alt ? ' alt="' . $alt . '"' : '') .
|
||||
(isset($params['id']) ? ' id="' . $params['id'] . '"' : '') .
|
||||
$tags .
|
||||
'>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a line
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x0': int X start point
|
||||
* 'y0': int Y start point
|
||||
* 'x1': int X end point
|
||||
* 'y1': int Y end point
|
||||
* 'color': mixed [optional] The line color
|
||||
* 'mapsize': int [optional] The size of the image map (surrounding the line)
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function line($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$mapsize = (isset($params['mapsize']) ? $params['mapsize'] : 2);
|
||||
$this->_addMapTag(
|
||||
'polygon',
|
||||
$this->_getX($params['x0'] - $mapsize) . ',' .
|
||||
$this->_getY($params['y0'] - $mapsize) . ',' .
|
||||
$this->_getX($params['x1'] + $mapsize) . ',' .
|
||||
$this->_getY($params['y1'] - $mapsize) . ',' .
|
||||
|
||||
$this->_getX($params['x1'] + $mapsize) . ',' .
|
||||
$this->_getY($params['y1'] + $mapsize) . ',' .
|
||||
$this->_getX($params['x0'] - $mapsize) . ',' .
|
||||
$this->_getY($params['y0'] + $mapsize),
|
||||
$params
|
||||
);
|
||||
}
|
||||
parent::line($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a polygon
|
||||
*
|
||||
* Parameter array:
|
||||
* 'connect': bool [optional] Specifies whether the start point should be
|
||||
* connected to the endpoint (closed polygon) or not (connected line)
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* 'map_vertices': bool [optional] Specifies whether the image map should map the vertices instead of the polygon as a whole
|
||||
* 'url': string [optional] URL to link the polygon as a whole to (also used for default in case 'map_vertices' is used)
|
||||
* 'alt': string [optional] Alternative text to show in the image map (also used for default in case 'map_vertices' is used)
|
||||
* 'target': string [optional] The link target on the image map (also used for default in case 'map_vertices' is used)
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function polygon($params)
|
||||
{
|
||||
if ((isset($params['map_vertices'])) && ($params['map_vertices'] === true)) {
|
||||
$mapsize = (isset($params['mapsize']) ? $params['mapsize'] : 2);
|
||||
foreach ($this->_polygon as $point) {
|
||||
$vertex_param = $params;
|
||||
if (isset($point['url'])) {
|
||||
$vertex_param['url'] = $point['url'];
|
||||
}
|
||||
if (isset($point['target'])) {
|
||||
$vertex_param['target'] = $point['target'];
|
||||
}
|
||||
if (isset($point['alt'])) {
|
||||
$vertex_param['alt'] = $point['alt'];
|
||||
}
|
||||
$vertex_mapsize = $mapsize;
|
||||
if (isset($point['mapsize'])) {
|
||||
$vertex_mapsize = $point['mapsize'];
|
||||
}
|
||||
if (isset($point['htmltags'])) {
|
||||
$vertex_param['htmltags'] = $point['htmltags'];
|
||||
}
|
||||
$this->_addMapTag(
|
||||
'circle',
|
||||
$this->_getX($point['X']) . ',' .
|
||||
$this->_getY($point['Y']) . ',' .
|
||||
$mapsize,
|
||||
$vertex_param
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (isset($params['url'])) {
|
||||
$points = '';
|
||||
foreach ($this->_polygon as $point) {
|
||||
if ($points != '') {
|
||||
$points .= ',';
|
||||
}
|
||||
$points .= $this->_getX($point['X']) . ',' . $this->_getY($point['Y']);
|
||||
}
|
||||
$this->_addMapTag('polygon', $points, $params);
|
||||
}
|
||||
parent::polygon($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a rectangle
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x0': int X start point
|
||||
* 'y0': int Y start point
|
||||
* 'x1': int X end point
|
||||
* 'y1': int Y end point
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function rectangle($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$this->_addMapTag(
|
||||
'rect',
|
||||
$this->_getX($params['x0']) . ',' .
|
||||
$this->_getY($params['y0']) . ',' .
|
||||
$this->_getX($params['x1']) . ',' .
|
||||
$this->_getY($params['y1']),
|
||||
$params
|
||||
);
|
||||
}
|
||||
parent::rectangle($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw an ellipse
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x': int X center point
|
||||
* 'y': int Y center point
|
||||
* 'rx': int X radius
|
||||
* 'ry': int Y radius
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function ellipse($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
if ($params['rx'] == $params['ry']) {
|
||||
$this->_addMapTag(
|
||||
'circle',
|
||||
$this->_getX($params['x']) . ',' .
|
||||
$this->_getY($params['y']) . ',' .
|
||||
$this->_getX($params['rx']),
|
||||
$params
|
||||
);
|
||||
} else {
|
||||
$points = '';
|
||||
for ($v = 0; $v <= 360; $v += 30) {
|
||||
if ($points != '') {
|
||||
$points .= ',';
|
||||
}
|
||||
$points .=
|
||||
round($this->_getX($params['x']) + $this->_getX($params['rx']) * cos(deg2rad($v % 360))) . ',' .
|
||||
round($this->_getY($params['y']) + $this->_getX($params['ry']) * sin(deg2rad($v % 360)));
|
||||
}
|
||||
$this->_addMapTag(
|
||||
'polygon',
|
||||
$points,
|
||||
$params
|
||||
);
|
||||
}
|
||||
}
|
||||
parent::ellipse($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a pie slice
|
||||
*
|
||||
* Parameter array:
|
||||
* 'x': int X center point
|
||||
* 'y': int Y center point
|
||||
* 'rx': int X radius
|
||||
* 'ry': int Y radius
|
||||
* 'v1': int The starting angle (in degrees)
|
||||
* 'v2': int The end angle (in degrees)
|
||||
* 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
|
||||
* 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
|
||||
* 'fill': mixed [optional] The fill color
|
||||
* 'line': mixed [optional] The line color
|
||||
* @param array $params Parameter array
|
||||
*/
|
||||
function pieslice($params)
|
||||
{
|
||||
if (isset($params['url'])) {
|
||||
$x = $this->_getX($params['x']);
|
||||
$y = $this->_getY($params['y']);
|
||||
$rx = $params['rx'];
|
||||
$ry = $params['ry'];
|
||||
$v1a = $params['v1'];
|
||||
$v2a = $params['v2'];
|
||||
$v1 = min($v1a, $v2a);
|
||||
$v2 = max($v1a, $v2a);
|
||||
$srx = (isset($params['srx']) ? $params['srx'] : 0);
|
||||
$sry = (isset($params['sry']) ? $params['sry'] : 0);
|
||||
|
||||
$points =
|
||||
round(($x + $srx * cos(deg2rad($v1 % 360)))) . ',' .
|
||||
round(($y + $sry * sin(deg2rad($v1 % 360)))) . ',';
|
||||
|
||||
for ($v = $v1; $v < $v2; $v += 30) {
|
||||
$points .=
|
||||
round(($x + $rx * cos(deg2rad($v % 360)))) . ',' .
|
||||
round(($y + $ry * sin(deg2rad($v % 360)))) . ',';
|
||||
}
|
||||
|
||||
$points .=
|
||||
round(($x + $rx * cos(deg2rad($v2 % 360)))) . ',' .
|
||||
round(($y + $ry * sin(deg2rad($v2 % 360))));
|
||||
|
||||
if (($srx != 0) || ($sry != 0)) {
|
||||
$points .= ',';
|
||||
for ($v = $v2; $v > $v1; $v -= 30) {
|
||||
$points .=
|
||||
round(($x + $srx * cos(deg2rad($v % 360)))) . ',' .
|
||||
round(($y + $sry * sin(deg2rad($v % 360)))) . ',';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->_addMapTag('polygon', $points, $params);
|
||||
}
|
||||
parent::pieslice($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the result of the canvas to the browser
|
||||
*
|
||||
* @param array $params Parameter array, the contents and meaning depends on the actual Canvas
|
||||
* @abstract
|
||||
*/
|
||||
function show($params = false)
|
||||
{
|
||||
parent::show($params);
|
||||
if (count($this->_map) > 0) {
|
||||
print $this->toHtml($params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the result of the canvas to a file
|
||||
*
|
||||
* Parameter array:
|
||||
* 'filename': string The file to output to
|
||||
* @param array $params Parameter array, the contents and meaning depends on the actual Canvas
|
||||
* @abstract
|
||||
*/
|
||||
function save($params = false)
|
||||
{
|
||||
parent::save($params);
|
||||
$file = fopen($params['filename'], 'w+');
|
||||
fwrite($file, $this->toHtml($params));
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a canvas specific HTML tag.
|
||||
*
|
||||
* Parameter array:
|
||||
* 'name': string The name of the image map
|
||||
*/
|
||||
function toHtml($params)
|
||||
{
|
||||
if (count($this->_map) > 0) {
|
||||
return '<map name="' . $params['name'] . '">' . "\n\t" . implode($this->_map, "\n\t") . "\n</map>";
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|