Enhancement in ecm module
This commit is contained in:
parent
e40543db23
commit
2fb72e7258
@ -1,9 +1,9 @@
|
||||
dolibarr-*.exe
|
||||
dolibarr-*.tgz
|
||||
dolibarr-*.zip
|
||||
dolibarr-*.rpm
|
||||
dolibarr-*.deb
|
||||
makepack-google.conf
|
||||
module_google-*.tgz
|
||||
module_pibarcode-1.0.tgz
|
||||
*.exe
|
||||
dolibarr-*.exe
|
||||
dolibarr-*.tgz
|
||||
dolibarr-*.zip
|
||||
dolibarr-*.rpm
|
||||
dolibarr-*.deb
|
||||
makepack-google.conf
|
||||
module_google-*.tgz
|
||||
module_pibarcode-1.0.tgz
|
||||
*.exe
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
Alias /dolibarr "WAMPROOT/www/dolibarr/htdocs/"
|
||||
|
||||
# NOTE:
|
||||
# To restrict access to dolibarr from outside set lines
|
||||
#
|
||||
# Order Deny,Allow
|
||||
# Deny from all
|
||||
# Allow from 127.0.0.1
|
||||
#
|
||||
# instead of
|
||||
#
|
||||
# Order Allow,Deny
|
||||
# Allow from all
|
||||
#
|
||||
|
||||
<Directory "WAMPROOT/www/dolibarr/htdocs/">
|
||||
Options Indexes FollowSymLinks MultiViews
|
||||
AllowOverride all
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
Alias /dolibarr "WAMPROOT/www/dolibarr/htdocs/"
|
||||
|
||||
# NOTE:
|
||||
# To restrict access to dolibarr from outside set lines
|
||||
#
|
||||
# Order Deny,Allow
|
||||
# Deny from all
|
||||
# Allow from 127.0.0.1
|
||||
#
|
||||
# instead of
|
||||
#
|
||||
# Order Allow,Deny
|
||||
# Allow from all
|
||||
#
|
||||
|
||||
<Directory "WAMPROOT/www/dolibarr/htdocs/">
|
||||
Options Indexes FollowSymLinks MultiViews
|
||||
AllowOverride all
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
@ -1,7 +1,7 @@
|
||||
@echo off
|
||||
REM NET STOP doliwampapache
|
||||
REM NET STOP doliwampmysqld
|
||||
.\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k install -n doliwampapache
|
||||
REM reg add HKLM\SYSTEM\CurrentControlSet\Services\doliwampapache /V Start /t REG_DWORD /d 3 /f
|
||||
REM .\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install-manual doliwampmysqld
|
||||
.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install doliwampmysqld
|
||||
@echo off
|
||||
REM NET STOP doliwampapache
|
||||
REM NET STOP doliwampmysqld
|
||||
.\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k install -n doliwampapache
|
||||
REM reg add HKLM\SYSTEM\CurrentControlSet\Services\doliwampapache /V Start /t REG_DWORD /d 3 /f
|
||||
REM .\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install-manual doliwampmysqld
|
||||
.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install doliwampmysqld
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
Alias /phpmyadmin "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/"
|
||||
|
||||
# to give access to phpmyadmin from outside
|
||||
# replace the lines
|
||||
#
|
||||
# Order Deny,Allow
|
||||
# Deny from all
|
||||
# Allow from 127.0.0.1
|
||||
#
|
||||
# by
|
||||
#
|
||||
# Order Allow,Deny
|
||||
# Allow from all
|
||||
#
|
||||
|
||||
<Directory "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/">
|
||||
Options Indexes FollowSymLinks MultiViews
|
||||
AllowOverride all
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
Allow from 127.0.0.1
|
||||
Alias /phpmyadmin "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/"
|
||||
|
||||
# to give access to phpmyadmin from outside
|
||||
# replace the lines
|
||||
#
|
||||
# Order Deny,Allow
|
||||
# Deny from all
|
||||
# Allow from 127.0.0.1
|
||||
#
|
||||
# by
|
||||
#
|
||||
# Order Allow,Deny
|
||||
# Allow from all
|
||||
#
|
||||
|
||||
<Directory "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/">
|
||||
Options Indexes FollowSymLinks MultiViews
|
||||
AllowOverride all
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
Allow from 127.0.0.1
|
||||
</Directory>
|
||||
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
NET START doliwampapache
|
||||
NET START doliwampmysqld
|
||||
echo Please wait...
|
||||
@echo off
|
||||
NET START doliwampapache
|
||||
NET START doliwampmysqld
|
||||
echo Please wait...
|
||||
sleep 1
|
||||
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
NET STOP doliwampapache
|
||||
NET STOP doliwampmysqld
|
||||
echo Please wait...
|
||||
@echo off
|
||||
NET STOP doliwampapache
|
||||
NET STOP doliwampmysqld
|
||||
echo Please wait...
|
||||
sleep 1
|
||||
@ -1,5 +1,5 @@
|
||||
NET STOP doliwampapache
|
||||
.\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k uninstall -n doliwampapache
|
||||
NET STOP doliwampmysqld
|
||||
.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --remove doliwampmysqld
|
||||
NET STOP doliwampapache
|
||||
.\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k uninstall -n doliwampapache
|
||||
NET STOP doliwampmysqld
|
||||
.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --remove doliwampmysqld
|
||||
REM wampmanager.exe -quit -id={doliwampserver}
|
||||
@ -1,178 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<PADGEN_PML>
|
||||
<AppVerInfo>PADGen 3.0.1.35</AppVerInfo>
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>2.1</Program_Version>
|
||||
<Program_Release_Month>04</Program_Release_Month>
|
||||
<Program_Release_Day>27</Program_Release_Day>
|
||||
<Program_Release_Year>2007</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
<Program_Type>Freeware</Program_Type>
|
||||
<Program_Release_Status>Major Update</Program_Release_Status>
|
||||
<Program_Install_Support>No Install Support</Program_Install_Support>
|
||||
<Program_OS_Support>Win95,Win98,WinME,WinNT 4.x,Windows2000,WinXP,Windows2003,Windows Vista Starter,Windows Vista Home Basic,Windows Vista Home Premium,Windows Vista Business,Windows Vista Enterprise,Windows Vista Ultimate,Windows Vista Home Basic x64,Windows Vista Home Premium x64,Windows Vista Business x64,Windows Vista Enterprise x64,Windows Vista Ultimate x64,Unix,Linux,OS/2,OS/2 Warp,OS/2 Warp 4,MAC 68k,Mac PPC,Mac OS X,Mac Other,BEOS</Program_OS_Support>
|
||||
<Program_Language>English,French</Program_Language>
|
||||
<Program_Change_Info>http://www.dolibarr.org</Program_Change_Info>
|
||||
<Program_Specific_Category>Business</Program_Specific_Category>
|
||||
<Program_Category_Class>Business::Accounting & Finance</Program_Category_Class>
|
||||
<Program_System_Requirements>None</Program_System_Requirements>
|
||||
<File_Info>
|
||||
<File_Size_Bytes>1016660</File_Size_Bytes>
|
||||
<File_Size_K>992</File_Size_K>
|
||||
<File_Size_MB>0.97</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
<Expire_Count />
|
||||
<Expire_Based_On>Days</Expire_Based_On>
|
||||
<Expire_Other_Info />
|
||||
<Expire_Month />
|
||||
<Expire_Day />
|
||||
<Expire_Year />
|
||||
</Expire_Info>
|
||||
</Program_Info>
|
||||
<Program_Descriptions>
|
||||
<English>
|
||||
<Keywords>dolibarr</Keywords>
|
||||
<Char_Desc_45>Dolibarr ERP/CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP/CRM</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
<Keywords />
|
||||
<Char_Desc_45 />
|
||||
<Char_Desc_80 />
|
||||
<Char_Desc_250 />
|
||||
<Char_Desc_450 />
|
||||
<Char_Desc_2000 />
|
||||
</French>
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/demo/doc/images/dolibarr_screenshot2.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/demo/doc/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>http://www.dolibarr.org/demo/build/pad/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>http://www.dolibarr.org/component/option,com_docman/task,doc_download/gid,1/Itemid,36/lang,en/</Primary_Download_URL>
|
||||
<Secondary_Download_URL />
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
</Download_URLs>
|
||||
</Web_Info>
|
||||
<Permissions>
|
||||
<Distribution_Permissions>GNU GPL</Distribution_Permissions>
|
||||
<EULA>GNU GPL</EULA>
|
||||
</Permissions>
|
||||
<ASP>
|
||||
<ASP_FORM>Y</ASP_FORM>
|
||||
<ASP_Member>N</ASP_Member>
|
||||
<ASP_Member_Number />
|
||||
</ASP>
|
||||
<Affiliates>
|
||||
<Affiliates_FORM>Y</Affiliates_FORM>
|
||||
<Affiliates_VERSION>1.2</Affiliates_VERSION>
|
||||
<Affiliates_URL>http://www.asp-shareware.org/pad/extensions/Affiliates.htm</Affiliates_URL>
|
||||
<Affiliates_Information_Page />
|
||||
<Affiliates_Avangate_Order_Page />
|
||||
<Affiliates_Avangate_Vendor_ID />
|
||||
<Affiliates_Avangate_Product_ID />
|
||||
<Affiliates_Avangate_Maximum_Commission_Rate />
|
||||
<Affiliates_BMTMicro_Order_Page />
|
||||
<Affiliates_BMTMicro_Vendor_ID />
|
||||
<Affiliates_BMTMicro_Product_ID />
|
||||
<Affiliates_BMTMicro_Maximum_Commission_Rate />
|
||||
<Affiliates_clixGalore_Order_Page />
|
||||
<Affiliates_clixGalore_Vendor_ID />
|
||||
<Affiliates_clixGalore_Product_ID />
|
||||
<Affiliates_clixGalore_Maximum_Commission_Rate />
|
||||
<Affiliates_CommissionJunction_Order_Page />
|
||||
<Affiliates_CommissionJunction_Vendor_ID />
|
||||
<Affiliates_CommissionJunction_Product_ID />
|
||||
<Affiliates_CommissionJunction_Maximum_Commission_Rate />
|
||||
<Affiliates_DigiBuy_Order_Page />
|
||||
<Affiliates_DigiBuy_Vendor_ID />
|
||||
<Affiliates_DigiBuy_Product_ID />
|
||||
<Affiliates_DigiBuy_Maximum_Commission_Rate />
|
||||
<Affiliates_DigitalCandle_Order_Page />
|
||||
<Affiliates_DigitalCandle_Vendor_ID />
|
||||
<Affiliates_DigitalCandle_Product_ID />
|
||||
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
|
||||
<Affiliates_Emetrix_Order_Page />
|
||||
<Affiliates_Emetrix_Vendor_ID />
|
||||
<Affiliates_Emetrix_Product_ID />
|
||||
<Affiliates_Emetrix_Maximum_Commission_Rate />
|
||||
<Affiliates_eSellerate_Order_Page />
|
||||
<Affiliates_eSellerate_Vendor_ID />
|
||||
<Affiliates_eSellerate_Product_ID />
|
||||
<Affiliates_eSellerate_Maximum_Commission_Rate />
|
||||
<Affiliates_Kagi_Order_Page />
|
||||
<Affiliates_Kagi_Vendor_ID />
|
||||
<Affiliates_Kagi_Product_ID />
|
||||
<Affiliates_Kagi_Maximum_Commission_Rate />
|
||||
<Affiliates_LinkShare_Order_Page />
|
||||
<Affiliates_LinkShare_Vendor_ID />
|
||||
<Affiliates_LinkShare_Product_ID />
|
||||
<Affiliates_LinkShare_Maximum_Commission_Rate />
|
||||
<Affiliates_NorthStarSol_Order_Page />
|
||||
<Affiliates_NorthStarSol_Vendor_ID />
|
||||
<Affiliates_NorthStarSol_Product_ID />
|
||||
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
|
||||
<Affiliates_Order1_Order_Page />
|
||||
<Affiliates_Order1_Vendor_ID />
|
||||
<Affiliates_Order1_Product_ID />
|
||||
<Affiliates_Order1_Maximum_Commission_Rate />
|
||||
<Affiliates_Osolis_Order_Page />
|
||||
<Affiliates_Osolis_Vendor_ID />
|
||||
<Affiliates_Osolis_Product_ID />
|
||||
<Affiliates_Osolis_Maximum_Commission_Rate />
|
||||
<Affiliates_Plimus_Order_Page />
|
||||
<Affiliates_Plimus_Vendor_ID />
|
||||
<Affiliates_Plimus_Product_ID />
|
||||
<Affiliates_Plimus_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnet_Order_Page />
|
||||
<Affiliates_Regnet_Vendor_ID />
|
||||
<Affiliates_Regnet_Product_ID />
|
||||
<Affiliates_Regnet_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnow_Order_Page />
|
||||
<Affiliates_Regnow_Vendor_ID />
|
||||
<Affiliates_Regnow_Product_ID />
|
||||
<Affiliates_Regnow_Maximum_Commission_Rate />
|
||||
<Affiliates_Regsoft_Order_Page />
|
||||
<Affiliates_Regsoft_Vendor_ID />
|
||||
<Affiliates_Regsoft_Product_ID />
|
||||
<Affiliates_Regsoft_Maximum_Commission_Rate />
|
||||
<Affiliates_ShareIt_Order_Page />
|
||||
<Affiliates_ShareIt_Vendor_ID />
|
||||
<Affiliates_ShareIt_Product_ID />
|
||||
<Affiliates_ShareIt_Maximum_Commission_Rate />
|
||||
<Affiliates_Shareasale_Order_Page />
|
||||
<Affiliates_Shareasale_Vendor_ID />
|
||||
<Affiliates_Shareasale_Product_ID />
|
||||
<Affiliates_Shareasale_Maximum_Commission_Rate />
|
||||
<Affiliates_SWReg_Order_Page />
|
||||
<Affiliates_SWReg_Vendor_ID />
|
||||
<Affiliates_SWReg_Product_ID />
|
||||
<Affiliates_SWReg_Maximum_Commission_Rate />
|
||||
<Affiliates_V-Share_Order_Page />
|
||||
<Affiliates_V-Share_Vendor_ID />
|
||||
<Affiliates_V-Share_Product_ID />
|
||||
<Affiliates_V-Share_Maximum_Commission_Rate />
|
||||
<Affiliates_VFree_Order_Page />
|
||||
<Affiliates_VFree_Vendor_ID />
|
||||
<Affiliates_VFree_Product_ID />
|
||||
<Affiliates_VFree_Maximum_Commission_Rate />
|
||||
<Affiliates_Yaskifo_Order_Page />
|
||||
<Affiliates_Yaskifo_Vendor_ID />
|
||||
<Affiliates_Yaskifo_Product_ID />
|
||||
<Affiliates_Yaskifo_Maximum_Commission_Rate />
|
||||
</Affiliates>
|
||||
</PADGEN_PML>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<PADGEN_PML>
|
||||
<AppVerInfo>PADGen 3.0.1.35</AppVerInfo>
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>2.1</Program_Version>
|
||||
<Program_Release_Month>04</Program_Release_Month>
|
||||
<Program_Release_Day>27</Program_Release_Day>
|
||||
<Program_Release_Year>2007</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
<Program_Type>Freeware</Program_Type>
|
||||
<Program_Release_Status>Major Update</Program_Release_Status>
|
||||
<Program_Install_Support>No Install Support</Program_Install_Support>
|
||||
<Program_OS_Support>Win95,Win98,WinME,WinNT 4.x,Windows2000,WinXP,Windows2003,Windows Vista Starter,Windows Vista Home Basic,Windows Vista Home Premium,Windows Vista Business,Windows Vista Enterprise,Windows Vista Ultimate,Windows Vista Home Basic x64,Windows Vista Home Premium x64,Windows Vista Business x64,Windows Vista Enterprise x64,Windows Vista Ultimate x64,Unix,Linux,OS/2,OS/2 Warp,OS/2 Warp 4,MAC 68k,Mac PPC,Mac OS X,Mac Other,BEOS</Program_OS_Support>
|
||||
<Program_Language>English,French</Program_Language>
|
||||
<Program_Change_Info>http://www.dolibarr.org</Program_Change_Info>
|
||||
<Program_Specific_Category>Business</Program_Specific_Category>
|
||||
<Program_Category_Class>Business::Accounting & Finance</Program_Category_Class>
|
||||
<Program_System_Requirements>None</Program_System_Requirements>
|
||||
<File_Info>
|
||||
<File_Size_Bytes>1016660</File_Size_Bytes>
|
||||
<File_Size_K>992</File_Size_K>
|
||||
<File_Size_MB>0.97</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
<Expire_Count />
|
||||
<Expire_Based_On>Days</Expire_Based_On>
|
||||
<Expire_Other_Info />
|
||||
<Expire_Month />
|
||||
<Expire_Day />
|
||||
<Expire_Year />
|
||||
</Expire_Info>
|
||||
</Program_Info>
|
||||
<Program_Descriptions>
|
||||
<English>
|
||||
<Keywords>dolibarr</Keywords>
|
||||
<Char_Desc_45>Dolibarr ERP/CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP/CRM</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
<Keywords />
|
||||
<Char_Desc_45 />
|
||||
<Char_Desc_80 />
|
||||
<Char_Desc_250 />
|
||||
<Char_Desc_450 />
|
||||
<Char_Desc_2000 />
|
||||
</French>
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/demo/doc/images/dolibarr_screenshot2.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/demo/doc/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>http://www.dolibarr.org/demo/build/pad/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>http://www.dolibarr.org/component/option,com_docman/task,doc_download/gid,1/Itemid,36/lang,en/</Primary_Download_URL>
|
||||
<Secondary_Download_URL />
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
</Download_URLs>
|
||||
</Web_Info>
|
||||
<Permissions>
|
||||
<Distribution_Permissions>GNU GPL</Distribution_Permissions>
|
||||
<EULA>GNU GPL</EULA>
|
||||
</Permissions>
|
||||
<ASP>
|
||||
<ASP_FORM>Y</ASP_FORM>
|
||||
<ASP_Member>N</ASP_Member>
|
||||
<ASP_Member_Number />
|
||||
</ASP>
|
||||
<Affiliates>
|
||||
<Affiliates_FORM>Y</Affiliates_FORM>
|
||||
<Affiliates_VERSION>1.2</Affiliates_VERSION>
|
||||
<Affiliates_URL>http://www.asp-shareware.org/pad/extensions/Affiliates.htm</Affiliates_URL>
|
||||
<Affiliates_Information_Page />
|
||||
<Affiliates_Avangate_Order_Page />
|
||||
<Affiliates_Avangate_Vendor_ID />
|
||||
<Affiliates_Avangate_Product_ID />
|
||||
<Affiliates_Avangate_Maximum_Commission_Rate />
|
||||
<Affiliates_BMTMicro_Order_Page />
|
||||
<Affiliates_BMTMicro_Vendor_ID />
|
||||
<Affiliates_BMTMicro_Product_ID />
|
||||
<Affiliates_BMTMicro_Maximum_Commission_Rate />
|
||||
<Affiliates_clixGalore_Order_Page />
|
||||
<Affiliates_clixGalore_Vendor_ID />
|
||||
<Affiliates_clixGalore_Product_ID />
|
||||
<Affiliates_clixGalore_Maximum_Commission_Rate />
|
||||
<Affiliates_CommissionJunction_Order_Page />
|
||||
<Affiliates_CommissionJunction_Vendor_ID />
|
||||
<Affiliates_CommissionJunction_Product_ID />
|
||||
<Affiliates_CommissionJunction_Maximum_Commission_Rate />
|
||||
<Affiliates_DigiBuy_Order_Page />
|
||||
<Affiliates_DigiBuy_Vendor_ID />
|
||||
<Affiliates_DigiBuy_Product_ID />
|
||||
<Affiliates_DigiBuy_Maximum_Commission_Rate />
|
||||
<Affiliates_DigitalCandle_Order_Page />
|
||||
<Affiliates_DigitalCandle_Vendor_ID />
|
||||
<Affiliates_DigitalCandle_Product_ID />
|
||||
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
|
||||
<Affiliates_Emetrix_Order_Page />
|
||||
<Affiliates_Emetrix_Vendor_ID />
|
||||
<Affiliates_Emetrix_Product_ID />
|
||||
<Affiliates_Emetrix_Maximum_Commission_Rate />
|
||||
<Affiliates_eSellerate_Order_Page />
|
||||
<Affiliates_eSellerate_Vendor_ID />
|
||||
<Affiliates_eSellerate_Product_ID />
|
||||
<Affiliates_eSellerate_Maximum_Commission_Rate />
|
||||
<Affiliates_Kagi_Order_Page />
|
||||
<Affiliates_Kagi_Vendor_ID />
|
||||
<Affiliates_Kagi_Product_ID />
|
||||
<Affiliates_Kagi_Maximum_Commission_Rate />
|
||||
<Affiliates_LinkShare_Order_Page />
|
||||
<Affiliates_LinkShare_Vendor_ID />
|
||||
<Affiliates_LinkShare_Product_ID />
|
||||
<Affiliates_LinkShare_Maximum_Commission_Rate />
|
||||
<Affiliates_NorthStarSol_Order_Page />
|
||||
<Affiliates_NorthStarSol_Vendor_ID />
|
||||
<Affiliates_NorthStarSol_Product_ID />
|
||||
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
|
||||
<Affiliates_Order1_Order_Page />
|
||||
<Affiliates_Order1_Vendor_ID />
|
||||
<Affiliates_Order1_Product_ID />
|
||||
<Affiliates_Order1_Maximum_Commission_Rate />
|
||||
<Affiliates_Osolis_Order_Page />
|
||||
<Affiliates_Osolis_Vendor_ID />
|
||||
<Affiliates_Osolis_Product_ID />
|
||||
<Affiliates_Osolis_Maximum_Commission_Rate />
|
||||
<Affiliates_Plimus_Order_Page />
|
||||
<Affiliates_Plimus_Vendor_ID />
|
||||
<Affiliates_Plimus_Product_ID />
|
||||
<Affiliates_Plimus_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnet_Order_Page />
|
||||
<Affiliates_Regnet_Vendor_ID />
|
||||
<Affiliates_Regnet_Product_ID />
|
||||
<Affiliates_Regnet_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnow_Order_Page />
|
||||
<Affiliates_Regnow_Vendor_ID />
|
||||
<Affiliates_Regnow_Product_ID />
|
||||
<Affiliates_Regnow_Maximum_Commission_Rate />
|
||||
<Affiliates_Regsoft_Order_Page />
|
||||
<Affiliates_Regsoft_Vendor_ID />
|
||||
<Affiliates_Regsoft_Product_ID />
|
||||
<Affiliates_Regsoft_Maximum_Commission_Rate />
|
||||
<Affiliates_ShareIt_Order_Page />
|
||||
<Affiliates_ShareIt_Vendor_ID />
|
||||
<Affiliates_ShareIt_Product_ID />
|
||||
<Affiliates_ShareIt_Maximum_Commission_Rate />
|
||||
<Affiliates_Shareasale_Order_Page />
|
||||
<Affiliates_Shareasale_Vendor_ID />
|
||||
<Affiliates_Shareasale_Product_ID />
|
||||
<Affiliates_Shareasale_Maximum_Commission_Rate />
|
||||
<Affiliates_SWReg_Order_Page />
|
||||
<Affiliates_SWReg_Vendor_ID />
|
||||
<Affiliates_SWReg_Product_ID />
|
||||
<Affiliates_SWReg_Maximum_Commission_Rate />
|
||||
<Affiliates_V-Share_Order_Page />
|
||||
<Affiliates_V-Share_Vendor_ID />
|
||||
<Affiliates_V-Share_Product_ID />
|
||||
<Affiliates_V-Share_Maximum_Commission_Rate />
|
||||
<Affiliates_VFree_Order_Page />
|
||||
<Affiliates_VFree_Vendor_ID />
|
||||
<Affiliates_VFree_Product_ID />
|
||||
<Affiliates_VFree_Maximum_Commission_Rate />
|
||||
<Affiliates_Yaskifo_Order_Page />
|
||||
<Affiliates_Yaskifo_Vendor_ID />
|
||||
<Affiliates_Yaskifo_Product_ID />
|
||||
<Affiliates_Yaskifo_Maximum_Commission_Rate />
|
||||
</Affiliates>
|
||||
</PADGEN_PML>
|
||||
|
||||
@ -1,178 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<PADGEN_PML>
|
||||
<AppVerInfo>PADGen 3.0.1.35</AppVerInfo>
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>2.2</Program_Version>
|
||||
<Program_Release_Month>12</Program_Release_Month>
|
||||
<Program_Release_Day>27</Program_Release_Day>
|
||||
<Program_Release_Year>2007</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
<Program_Type>Freeware</Program_Type>
|
||||
<Program_Release_Status>Major Update</Program_Release_Status>
|
||||
<Program_Install_Support>No Install Support</Program_Install_Support>
|
||||
<Program_OS_Support>Win95,Win98,WinME,WinNT 4.x,Windows2000,WinXP,Windows2003,Windows Vista Starter,Windows Vista Home Basic,Windows Vista Home Premium,Windows Vista Business,Windows Vista Enterprise,Windows Vista Ultimate,Windows Vista Home Basic x64,Windows Vista Home Premium x64,Windows Vista Business x64,Windows Vista Enterprise x64,Windows Vista Ultimate x64,Unix,Linux,OS/2,OS/2 Warp,OS/2 Warp 4,MAC 68k,Mac PPC,Mac OS X,Mac OS X 10.1,Mac OS X 10.2,Mac OS X 10.3,Mac OS X 10.4,Mac OS X 10.5,Mac Other,BEOS</Program_OS_Support>
|
||||
<Program_Language>English,French</Program_Language>
|
||||
<Program_Change_Info>http://www.dolibarr.org</Program_Change_Info>
|
||||
<Program_Specific_Category>Business</Program_Specific_Category>
|
||||
<Program_Category_Class>Business::Accounting & Finance</Program_Category_Class>
|
||||
<Program_System_Requirements>None</Program_System_Requirements>
|
||||
<File_Info>
|
||||
<File_Size_Bytes>1016660</File_Size_Bytes>
|
||||
<File_Size_K>992</File_Size_K>
|
||||
<File_Size_MB>0.97</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
<Expire_Count />
|
||||
<Expire_Based_On>Days</Expire_Based_On>
|
||||
<Expire_Other_Info />
|
||||
<Expire_Month />
|
||||
<Expire_Day />
|
||||
<Expire_Year />
|
||||
</Expire_Info>
|
||||
</Program_Info>
|
||||
<Program_Descriptions>
|
||||
<English>
|
||||
<Keywords>dolibarr</Keywords>
|
||||
<Char_Desc_45>Dolibarr ERP/CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP/CRM</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
<Keywords />
|
||||
<Char_Desc_45 />
|
||||
<Char_Desc_80 />
|
||||
<Char_Desc_250 />
|
||||
<Char_Desc_450 />
|
||||
<Char_Desc_2000 />
|
||||
</French>
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot2.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>http://www.dolibarr.org/images/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>http://www.dolibarr.org/images/dolibarr.tgz</Primary_Download_URL>
|
||||
<Secondary_Download_URL>http://www.dolibarr.org/images/dolibarr.tgz</Secondary_Download_URL>
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
</Download_URLs>
|
||||
</Web_Info>
|
||||
<Permissions>
|
||||
<Distribution_Permissions>GNU GPL</Distribution_Permissions>
|
||||
<EULA>GNU GPL</EULA>
|
||||
</Permissions>
|
||||
<ASP>
|
||||
<ASP_FORM>Y</ASP_FORM>
|
||||
<ASP_Member>N</ASP_Member>
|
||||
<ASP_Member_Number />
|
||||
</ASP>
|
||||
<Affiliates>
|
||||
<Affiliates_FORM>Y</Affiliates_FORM>
|
||||
<Affiliates_VERSION>1.2</Affiliates_VERSION>
|
||||
<Affiliates_URL>http://www.asp-shareware.org/pad/extensions/Affiliates.htm</Affiliates_URL>
|
||||
<Affiliates_Information_Page />
|
||||
<Affiliates_Avangate_Order_Page />
|
||||
<Affiliates_Avangate_Vendor_ID />
|
||||
<Affiliates_Avangate_Product_ID />
|
||||
<Affiliates_Avangate_Maximum_Commission_Rate />
|
||||
<Affiliates_BMTMicro_Order_Page />
|
||||
<Affiliates_BMTMicro_Vendor_ID />
|
||||
<Affiliates_BMTMicro_Product_ID />
|
||||
<Affiliates_BMTMicro_Maximum_Commission_Rate />
|
||||
<Affiliates_clixGalore_Order_Page />
|
||||
<Affiliates_clixGalore_Vendor_ID />
|
||||
<Affiliates_clixGalore_Product_ID />
|
||||
<Affiliates_clixGalore_Maximum_Commission_Rate />
|
||||
<Affiliates_CommissionJunction_Order_Page />
|
||||
<Affiliates_CommissionJunction_Vendor_ID />
|
||||
<Affiliates_CommissionJunction_Product_ID />
|
||||
<Affiliates_CommissionJunction_Maximum_Commission_Rate />
|
||||
<Affiliates_DigiBuy_Order_Page />
|
||||
<Affiliates_DigiBuy_Vendor_ID />
|
||||
<Affiliates_DigiBuy_Product_ID />
|
||||
<Affiliates_DigiBuy_Maximum_Commission_Rate />
|
||||
<Affiliates_DigitalCandle_Order_Page />
|
||||
<Affiliates_DigitalCandle_Vendor_ID />
|
||||
<Affiliates_DigitalCandle_Product_ID />
|
||||
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
|
||||
<Affiliates_Emetrix_Order_Page />
|
||||
<Affiliates_Emetrix_Vendor_ID />
|
||||
<Affiliates_Emetrix_Product_ID />
|
||||
<Affiliates_Emetrix_Maximum_Commission_Rate />
|
||||
<Affiliates_eSellerate_Order_Page />
|
||||
<Affiliates_eSellerate_Vendor_ID />
|
||||
<Affiliates_eSellerate_Product_ID />
|
||||
<Affiliates_eSellerate_Maximum_Commission_Rate />
|
||||
<Affiliates_Kagi_Order_Page />
|
||||
<Affiliates_Kagi_Vendor_ID />
|
||||
<Affiliates_Kagi_Product_ID />
|
||||
<Affiliates_Kagi_Maximum_Commission_Rate />
|
||||
<Affiliates_LinkShare_Order_Page />
|
||||
<Affiliates_LinkShare_Vendor_ID />
|
||||
<Affiliates_LinkShare_Product_ID />
|
||||
<Affiliates_LinkShare_Maximum_Commission_Rate />
|
||||
<Affiliates_NorthStarSol_Order_Page />
|
||||
<Affiliates_NorthStarSol_Vendor_ID />
|
||||
<Affiliates_NorthStarSol_Product_ID />
|
||||
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
|
||||
<Affiliates_Order1_Order_Page />
|
||||
<Affiliates_Order1_Vendor_ID />
|
||||
<Affiliates_Order1_Product_ID />
|
||||
<Affiliates_Order1_Maximum_Commission_Rate />
|
||||
<Affiliates_Osolis_Order_Page />
|
||||
<Affiliates_Osolis_Vendor_ID />
|
||||
<Affiliates_Osolis_Product_ID />
|
||||
<Affiliates_Osolis_Maximum_Commission_Rate />
|
||||
<Affiliates_Plimus_Order_Page />
|
||||
<Affiliates_Plimus_Vendor_ID />
|
||||
<Affiliates_Plimus_Product_ID />
|
||||
<Affiliates_Plimus_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnet_Order_Page />
|
||||
<Affiliates_Regnet_Vendor_ID />
|
||||
<Affiliates_Regnet_Product_ID />
|
||||
<Affiliates_Regnet_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnow_Order_Page />
|
||||
<Affiliates_Regnow_Vendor_ID />
|
||||
<Affiliates_Regnow_Product_ID />
|
||||
<Affiliates_Regnow_Maximum_Commission_Rate />
|
||||
<Affiliates_Regsoft_Order_Page />
|
||||
<Affiliates_Regsoft_Vendor_ID />
|
||||
<Affiliates_Regsoft_Product_ID />
|
||||
<Affiliates_Regsoft_Maximum_Commission_Rate />
|
||||
<Affiliates_ShareIt_Order_Page />
|
||||
<Affiliates_ShareIt_Vendor_ID />
|
||||
<Affiliates_ShareIt_Product_ID />
|
||||
<Affiliates_ShareIt_Maximum_Commission_Rate />
|
||||
<Affiliates_Shareasale_Order_Page />
|
||||
<Affiliates_Shareasale_Vendor_ID />
|
||||
<Affiliates_Shareasale_Product_ID />
|
||||
<Affiliates_Shareasale_Maximum_Commission_Rate />
|
||||
<Affiliates_SWReg_Order_Page />
|
||||
<Affiliates_SWReg_Vendor_ID />
|
||||
<Affiliates_SWReg_Product_ID />
|
||||
<Affiliates_SWReg_Maximum_Commission_Rate />
|
||||
<Affiliates_V-Share_Order_Page />
|
||||
<Affiliates_V-Share_Vendor_ID />
|
||||
<Affiliates_V-Share_Product_ID />
|
||||
<Affiliates_V-Share_Maximum_Commission_Rate />
|
||||
<Affiliates_VFree_Order_Page />
|
||||
<Affiliates_VFree_Vendor_ID />
|
||||
<Affiliates_VFree_Product_ID />
|
||||
<Affiliates_VFree_Maximum_Commission_Rate />
|
||||
<Affiliates_Yaskifo_Order_Page />
|
||||
<Affiliates_Yaskifo_Vendor_ID />
|
||||
<Affiliates_Yaskifo_Product_ID />
|
||||
<Affiliates_Yaskifo_Maximum_Commission_Rate />
|
||||
</Affiliates>
|
||||
</PADGEN_PML>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<PADGEN_PML>
|
||||
<AppVerInfo>PADGen 3.0.1.35</AppVerInfo>
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>2.2</Program_Version>
|
||||
<Program_Release_Month>12</Program_Release_Month>
|
||||
<Program_Release_Day>27</Program_Release_Day>
|
||||
<Program_Release_Year>2007</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
<Program_Type>Freeware</Program_Type>
|
||||
<Program_Release_Status>Major Update</Program_Release_Status>
|
||||
<Program_Install_Support>No Install Support</Program_Install_Support>
|
||||
<Program_OS_Support>Win95,Win98,WinME,WinNT 4.x,Windows2000,WinXP,Windows2003,Windows Vista Starter,Windows Vista Home Basic,Windows Vista Home Premium,Windows Vista Business,Windows Vista Enterprise,Windows Vista Ultimate,Windows Vista Home Basic x64,Windows Vista Home Premium x64,Windows Vista Business x64,Windows Vista Enterprise x64,Windows Vista Ultimate x64,Unix,Linux,OS/2,OS/2 Warp,OS/2 Warp 4,MAC 68k,Mac PPC,Mac OS X,Mac OS X 10.1,Mac OS X 10.2,Mac OS X 10.3,Mac OS X 10.4,Mac OS X 10.5,Mac Other,BEOS</Program_OS_Support>
|
||||
<Program_Language>English,French</Program_Language>
|
||||
<Program_Change_Info>http://www.dolibarr.org</Program_Change_Info>
|
||||
<Program_Specific_Category>Business</Program_Specific_Category>
|
||||
<Program_Category_Class>Business::Accounting & Finance</Program_Category_Class>
|
||||
<Program_System_Requirements>None</Program_System_Requirements>
|
||||
<File_Info>
|
||||
<File_Size_Bytes>1016660</File_Size_Bytes>
|
||||
<File_Size_K>992</File_Size_K>
|
||||
<File_Size_MB>0.97</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
<Expire_Count />
|
||||
<Expire_Based_On>Days</Expire_Based_On>
|
||||
<Expire_Other_Info />
|
||||
<Expire_Month />
|
||||
<Expire_Day />
|
||||
<Expire_Year />
|
||||
</Expire_Info>
|
||||
</Program_Info>
|
||||
<Program_Descriptions>
|
||||
<English>
|
||||
<Keywords>dolibarr</Keywords>
|
||||
<Char_Desc_45>Dolibarr ERP/CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP/CRM</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP/CRM is an open source tool to manage invoices, customers, suppliers, contracts and any other things a small or medium company needs.</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
<Keywords />
|
||||
<Char_Desc_45 />
|
||||
<Char_Desc_80 />
|
||||
<Char_Desc_250 />
|
||||
<Char_Desc_450 />
|
||||
<Char_Desc_2000 />
|
||||
</French>
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot2.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>http://www.dolibarr.org/images/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>http://www.dolibarr.org/images/dolibarr.tgz</Primary_Download_URL>
|
||||
<Secondary_Download_URL>http://www.dolibarr.org/images/dolibarr.tgz</Secondary_Download_URL>
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
</Download_URLs>
|
||||
</Web_Info>
|
||||
<Permissions>
|
||||
<Distribution_Permissions>GNU GPL</Distribution_Permissions>
|
||||
<EULA>GNU GPL</EULA>
|
||||
</Permissions>
|
||||
<ASP>
|
||||
<ASP_FORM>Y</ASP_FORM>
|
||||
<ASP_Member>N</ASP_Member>
|
||||
<ASP_Member_Number />
|
||||
</ASP>
|
||||
<Affiliates>
|
||||
<Affiliates_FORM>Y</Affiliates_FORM>
|
||||
<Affiliates_VERSION>1.2</Affiliates_VERSION>
|
||||
<Affiliates_URL>http://www.asp-shareware.org/pad/extensions/Affiliates.htm</Affiliates_URL>
|
||||
<Affiliates_Information_Page />
|
||||
<Affiliates_Avangate_Order_Page />
|
||||
<Affiliates_Avangate_Vendor_ID />
|
||||
<Affiliates_Avangate_Product_ID />
|
||||
<Affiliates_Avangate_Maximum_Commission_Rate />
|
||||
<Affiliates_BMTMicro_Order_Page />
|
||||
<Affiliates_BMTMicro_Vendor_ID />
|
||||
<Affiliates_BMTMicro_Product_ID />
|
||||
<Affiliates_BMTMicro_Maximum_Commission_Rate />
|
||||
<Affiliates_clixGalore_Order_Page />
|
||||
<Affiliates_clixGalore_Vendor_ID />
|
||||
<Affiliates_clixGalore_Product_ID />
|
||||
<Affiliates_clixGalore_Maximum_Commission_Rate />
|
||||
<Affiliates_CommissionJunction_Order_Page />
|
||||
<Affiliates_CommissionJunction_Vendor_ID />
|
||||
<Affiliates_CommissionJunction_Product_ID />
|
||||
<Affiliates_CommissionJunction_Maximum_Commission_Rate />
|
||||
<Affiliates_DigiBuy_Order_Page />
|
||||
<Affiliates_DigiBuy_Vendor_ID />
|
||||
<Affiliates_DigiBuy_Product_ID />
|
||||
<Affiliates_DigiBuy_Maximum_Commission_Rate />
|
||||
<Affiliates_DigitalCandle_Order_Page />
|
||||
<Affiliates_DigitalCandle_Vendor_ID />
|
||||
<Affiliates_DigitalCandle_Product_ID />
|
||||
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
|
||||
<Affiliates_Emetrix_Order_Page />
|
||||
<Affiliates_Emetrix_Vendor_ID />
|
||||
<Affiliates_Emetrix_Product_ID />
|
||||
<Affiliates_Emetrix_Maximum_Commission_Rate />
|
||||
<Affiliates_eSellerate_Order_Page />
|
||||
<Affiliates_eSellerate_Vendor_ID />
|
||||
<Affiliates_eSellerate_Product_ID />
|
||||
<Affiliates_eSellerate_Maximum_Commission_Rate />
|
||||
<Affiliates_Kagi_Order_Page />
|
||||
<Affiliates_Kagi_Vendor_ID />
|
||||
<Affiliates_Kagi_Product_ID />
|
||||
<Affiliates_Kagi_Maximum_Commission_Rate />
|
||||
<Affiliates_LinkShare_Order_Page />
|
||||
<Affiliates_LinkShare_Vendor_ID />
|
||||
<Affiliates_LinkShare_Product_ID />
|
||||
<Affiliates_LinkShare_Maximum_Commission_Rate />
|
||||
<Affiliates_NorthStarSol_Order_Page />
|
||||
<Affiliates_NorthStarSol_Vendor_ID />
|
||||
<Affiliates_NorthStarSol_Product_ID />
|
||||
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
|
||||
<Affiliates_Order1_Order_Page />
|
||||
<Affiliates_Order1_Vendor_ID />
|
||||
<Affiliates_Order1_Product_ID />
|
||||
<Affiliates_Order1_Maximum_Commission_Rate />
|
||||
<Affiliates_Osolis_Order_Page />
|
||||
<Affiliates_Osolis_Vendor_ID />
|
||||
<Affiliates_Osolis_Product_ID />
|
||||
<Affiliates_Osolis_Maximum_Commission_Rate />
|
||||
<Affiliates_Plimus_Order_Page />
|
||||
<Affiliates_Plimus_Vendor_ID />
|
||||
<Affiliates_Plimus_Product_ID />
|
||||
<Affiliates_Plimus_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnet_Order_Page />
|
||||
<Affiliates_Regnet_Vendor_ID />
|
||||
<Affiliates_Regnet_Product_ID />
|
||||
<Affiliates_Regnet_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnow_Order_Page />
|
||||
<Affiliates_Regnow_Vendor_ID />
|
||||
<Affiliates_Regnow_Product_ID />
|
||||
<Affiliates_Regnow_Maximum_Commission_Rate />
|
||||
<Affiliates_Regsoft_Order_Page />
|
||||
<Affiliates_Regsoft_Vendor_ID />
|
||||
<Affiliates_Regsoft_Product_ID />
|
||||
<Affiliates_Regsoft_Maximum_Commission_Rate />
|
||||
<Affiliates_ShareIt_Order_Page />
|
||||
<Affiliates_ShareIt_Vendor_ID />
|
||||
<Affiliates_ShareIt_Product_ID />
|
||||
<Affiliates_ShareIt_Maximum_Commission_Rate />
|
||||
<Affiliates_Shareasale_Order_Page />
|
||||
<Affiliates_Shareasale_Vendor_ID />
|
||||
<Affiliates_Shareasale_Product_ID />
|
||||
<Affiliates_Shareasale_Maximum_Commission_Rate />
|
||||
<Affiliates_SWReg_Order_Page />
|
||||
<Affiliates_SWReg_Vendor_ID />
|
||||
<Affiliates_SWReg_Product_ID />
|
||||
<Affiliates_SWReg_Maximum_Commission_Rate />
|
||||
<Affiliates_V-Share_Order_Page />
|
||||
<Affiliates_V-Share_Vendor_ID />
|
||||
<Affiliates_V-Share_Product_ID />
|
||||
<Affiliates_V-Share_Maximum_Commission_Rate />
|
||||
<Affiliates_VFree_Order_Page />
|
||||
<Affiliates_VFree_Vendor_ID />
|
||||
<Affiliates_VFree_Product_ID />
|
||||
<Affiliates_VFree_Maximum_Commission_Rate />
|
||||
<Affiliates_Yaskifo_Order_Page />
|
||||
<Affiliates_Yaskifo_Vendor_ID />
|
||||
<Affiliates_Yaskifo_Product_ID />
|
||||
<Affiliates_Yaskifo_Maximum_Commission_Rate />
|
||||
</Affiliates>
|
||||
</PADGEN_PML>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
README (english)
|
||||
--------------------------------
|
||||
This directory contains some sample files to test ldap command on command line.
|
||||
README (english)
|
||||
--------------------------------
|
||||
This directory contains some sample files to test ldap command on command line.
|
||||
They are used to help developmement and debugging of Dolibarr LDAP features.
|
||||
@ -1,13 +1,13 @@
|
||||
# ldapadd_sample1.txt
|
||||
#
|
||||
# Use this sample to add a dc "my-domain".
|
||||
# This is the first thing to create
|
||||
#
|
||||
# ldapadd -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapadd_sample1.txt
|
||||
|
||||
dn: dc=my-domain,dc=com
|
||||
objectclass: dcObject
|
||||
objectClass: organization
|
||||
objectClass: top
|
||||
dc: my-domain
|
||||
# ldapadd_sample1.txt
|
||||
#
|
||||
# Use this sample to add a dc "my-domain".
|
||||
# This is the first thing to create
|
||||
#
|
||||
# ldapadd -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapadd_sample1.txt
|
||||
|
||||
dn: dc=my-domain,dc=com
|
||||
objectclass: dcObject
|
||||
objectClass: organization
|
||||
objectClass: top
|
||||
dc: my-domain
|
||||
o: Mon organisation
|
||||
@ -1,19 +1,19 @@
|
||||
# ldapadd_sample3.txt
|
||||
#
|
||||
# Use this sample to add cn records
|
||||
# This is the step to create records inside tree ou=contacts,dc=my-domain,dc=com
|
||||
#
|
||||
# ldapadd -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapadd_sample3.txt
|
||||
|
||||
dn: cn=Bruno et Sabine Tary,ou=contacts,dc=my-domain,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
cn: Bruno et Sabine Tary
|
||||
cn: Barbara Jensen
|
||||
cn: Babs Jensen
|
||||
sn: Jensen
|
||||
description: aaa
|
||||
title: this is title
|
||||
mail: mail@mail.com
|
||||
# ldapadd_sample3.txt
|
||||
#
|
||||
# Use this sample to add cn records
|
||||
# This is the step to create records inside tree ou=contacts,dc=my-domain,dc=com
|
||||
#
|
||||
# ldapadd -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapadd_sample3.txt
|
||||
|
||||
dn: cn=Bruno et Sabine Tary,ou=contacts,dc=my-domain,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
cn: Bruno et Sabine Tary
|
||||
cn: Barbara Jensen
|
||||
cn: Babs Jensen
|
||||
sn: Jensen
|
||||
description: aaa
|
||||
title: this is title
|
||||
mail: mail@mail.com
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# ldapdelete_sample1.txt
|
||||
#
|
||||
# Use this sample to delete a dc "my-domain"
|
||||
# This delete the first level of LDAP tree.
|
||||
#
|
||||
# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapdelete_sample1.txt
|
||||
|
||||
dn: dc=my-domain,dc=com
|
||||
changetype: delete
|
||||
# ldapdelete_sample1.txt
|
||||
#
|
||||
# Use this sample to delete a dc "my-domain"
|
||||
# This delete the first level of LDAP tree.
|
||||
#
|
||||
# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapdelete_sample1.txt
|
||||
|
||||
dn: dc=my-domain,dc=com
|
||||
changetype: delete
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# ldapdelete_sample3.txt
|
||||
#
|
||||
# Use this sample to delete cn records
|
||||
# This is the step to delete a cn record stored inside tree ou=contacts,dc=my-domain,dc=com
|
||||
#
|
||||
# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapdelete_sample3.txt
|
||||
|
||||
dn: cn=Bruno et Sabine Tary,ou=contacts,dc=my-domain,dc=com
|
||||
changetype: delete
|
||||
# ldapdelete_sample3.txt
|
||||
#
|
||||
# Use this sample to delete cn records
|
||||
# This is the step to delete a cn record stored inside tree ou=contacts,dc=my-domain,dc=com
|
||||
#
|
||||
# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapdelete_sample3.txt
|
||||
|
||||
dn: cn=Bruno et Sabine Tary,ou=contacts,dc=my-domain,dc=com
|
||||
changetype: delete
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
# ldapmodify_sample1.txt
|
||||
#
|
||||
# Use this sample to modify a dc "my-domain"
|
||||
#
|
||||
# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapmodify_sample1.txt
|
||||
|
||||
dn: dc=my-domain,dc=com
|
||||
changetype: modify
|
||||
replace: o
|
||||
objectclass: dcObject
|
||||
objectClass: organization
|
||||
objectClass: top
|
||||
dc: my-domain
|
||||
# ldapmodify_sample1.txt
|
||||
#
|
||||
# Use this sample to modify a dc "my-domain"
|
||||
#
|
||||
# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapmodify_sample1.txt
|
||||
|
||||
dn: dc=my-domain,dc=com
|
||||
changetype: modify
|
||||
replace: o
|
||||
objectclass: dcObject
|
||||
objectClass: organization
|
||||
objectClass: top
|
||||
dc: my-domain
|
||||
o: Mon organisation
|
||||
@ -1,168 +1,168 @@
|
||||
# File of all ISO-4217 currencies codes
|
||||
# http://en.wikipedia.org/wiki/ISO_4217
|
||||
# http://fx.sauder.ubc.ca/currency_table.html for symbols for 2 letter code
|
||||
#
|
||||
# Code,Name,Nb decimals
|
||||
AED,UAE Dirham,2
|
||||
AFN,Afghanistan Afghani,2
|
||||
ALL,Albanian Lek,2
|
||||
AMD,Armenian Dram,2
|
||||
ANG,Netherlands Antillian Guilder,2
|
||||
AOA,Angolan Kwanza,2
|
||||
ARS,Argentine Peso,2
|
||||
AUD,Australian Dollar,2
|
||||
AWG,Aruban Guilder,2
|
||||
AZM,Azerbaijanian Manat,2
|
||||
BAM,Bosnia and Herzegovina Convertible Marks,2
|
||||
BBD,Barbados Dollar,2
|
||||
BDT,Bangladesh Taka,2
|
||||
BGN,Bulgarian Lev,2
|
||||
BHD,Bahraini Dinar,3
|
||||
BIF,Burundi Franc,0
|
||||
BMD,Bermudian Dollar,2
|
||||
BND,Brunei Dollar,2
|
||||
BOB,Bolivian Boliviano,2
|
||||
BRL,Brazilian Real,2
|
||||
BSD,Bahamian Dollar,2
|
||||
BTN,Bhutan Ngultrum,2
|
||||
BWP,Botswana Pula,2
|
||||
BYR,Belarussian Ruble,0
|
||||
BZD,Belize Dollar,2
|
||||
CAD,Canadian Dollar,2
|
||||
CDF,Franc Congolais,2
|
||||
CHF,Swiss Franc,2
|
||||
CLP,Chilean Peso,0
|
||||
CNY,Chinese Yuan Renminbi,2
|
||||
COP,Colombian Peso,2
|
||||
CRC,Costa Rican Colon,2
|
||||
CSD,Serbian Dinar,2
|
||||
CUP,Cuban Peso,2
|
||||
CVE,Cape Verde Escudo,2
|
||||
CYP,Cyprus Pound,2
|
||||
CZK,Czech Koruna,2
|
||||
DJF,Djibouti Franc,0
|
||||
DKK,Danish Krone,2
|
||||
DOP,Dominican Peso,2
|
||||
DZD,Algerian Dinar,2
|
||||
EEK,Estonian Kroon,2
|
||||
EGP,Egyptian Pound,2
|
||||
ERN,Eritrea Nafka,2
|
||||
ETB,Ethiopian Birr,2
|
||||
EUR,euro,2
|
||||
FJD,Fiji Dollar,2
|
||||
FKP,Falkland Islands Pound,2
|
||||
GBP,Pound Sterling,2
|
||||
GEL,Georgian Lari,2
|
||||
GHC,Ghana Cedi,2
|
||||
GIP,Gibraltar Pound,2
|
||||
GMD,Gambian Dalasi,2
|
||||
GNF,Guinea Franc,0
|
||||
GTQ,Guatemala Quetzal,2
|
||||
GYD,Guyana Dollar,2
|
||||
HKD,Hong Kong Dollar,2
|
||||
HNL,Honduras Lempira,2
|
||||
HRK,Croatian Kuna,2
|
||||
HTG,Haiti Gourde,2
|
||||
HUF,Hungarian Forint,2
|
||||
IDR,Indonesian Rupiah,2
|
||||
ILS,New Israeli Shekel,2
|
||||
INR,Indian Rupee,2
|
||||
IQD,Iraqi Dinar,3
|
||||
IRR,Iranian Rial,2
|
||||
ISK,Iceland Krona,2
|
||||
JMD,Jamaican Dollar,2
|
||||
JOD,Jordanian Dinar,3
|
||||
JPY,Japanese Yen,0
|
||||
KES,Kenyan Shilling,2
|
||||
KGS,Kyrgyzstan Som,2
|
||||
KHR,Cambodia Riel,2
|
||||
KMF,Comoro Franc,0
|
||||
KPW,North Korean Won,2
|
||||
KRW,Korean Won,0
|
||||
KWD,Kuwaiti Dinar,3
|
||||
KYD,Cayman Islands Dollar,2
|
||||
KZT,Kazakhstan Tenge,2
|
||||
LAK,Lao Kip,2
|
||||
LBP,Lebanese Pound,2
|
||||
LKR,Sri Lanka Rupee,2
|
||||
LRD,Liberian Dollar,2
|
||||
LSL,Lesotho Loti,2
|
||||
LTL,Lithuanian Litas,2
|
||||
LVL,Latvian Lats,2
|
||||
LYD,Libyan Dinar,3
|
||||
MAD,Moroccan Dirham,2
|
||||
MDL,Moldovan Leu,2
|
||||
MGA,Malagasy Ariary,2
|
||||
MKD,Macedonian Denar,2
|
||||
MMK,Myanmar Kyat,2
|
||||
MNT,Mongolian Tugrik,2
|
||||
MOP,Macau Pataca,2
|
||||
MRO,Mauritania Ouguiya,2
|
||||
MTL,Maltese Lira,2
|
||||
MUR,Mauritius Rupee,2
|
||||
MVR,Maldives Rufiyaa,2
|
||||
MWK,Malawi Kwacha,2
|
||||
MXN,Mexican Peso,2
|
||||
MYR,Malaysian Ringgit,2
|
||||
MZM,Mozambique Metical,2
|
||||
NAD,Namibia Dollar,2
|
||||
NGN,Nigerian Naira,2
|
||||
NIO,Nicaragua Cordoba Oro,2
|
||||
NOK,Norwegian Krone,2
|
||||
NPR,Nepalese Rupee,2
|
||||
NZD,New Zealand Dollar,2
|
||||
OMR,Rial Omani,3
|
||||
PAB,Panama Balboa,2
|
||||
PEN,Peruvian Nuevo Sol,2
|
||||
PGK,Papua New Guinea Kina,2
|
||||
PHP,Philippine Peso,2
|
||||
PKR,Pakistan Rupee,2
|
||||
PLN,Polish Zloty,2
|
||||
PYG,Paraguayan Guarani,0
|
||||
QAR,Qatari Rial,2
|
||||
RON,Romanian Leu,2
|
||||
RUB,Russian Ruble,2
|
||||
RWF,Rwanda Franc,0
|
||||
SAR,Saudi Riyal,2
|
||||
SBD,Solomon Islands Dollar,2
|
||||
SCR,Seychelles Rupee,2
|
||||
SDD,Sudanese Dinar,2
|
||||
SEK,Swedish Krona,2
|
||||
SGD,Singapore Dollar,2
|
||||
SHP,St Helena Pound,2
|
||||
SIT,Slovenian Tolar,2
|
||||
SKK,Slovak Koruna,2
|
||||
SLL,Sierra Leone Leone,2
|
||||
SOS,Somali Shilling,2
|
||||
SRD,Surinam Dollar,2
|
||||
STD,São Tome and Principe Dobra,2
|
||||
SVC,El Salvador Colon,2
|
||||
SYP,Syrian Pound,2
|
||||
SZL,Swaziland Lilangeni,2
|
||||
THB,Thai Baht,2
|
||||
TJS,Tajik Somoni,2
|
||||
TMM,Turkmenistan Manat,2
|
||||
TND,Tunisian Dinar,3
|
||||
TOP,Tonga Pa'anga,2
|
||||
TRY,Turkish Lira,2
|
||||
TTD,Trinidad and Tobago Dollar,2
|
||||
TWD,New Taiwan Dollar,2
|
||||
TZS,Tanzanian Shilling,2
|
||||
UAH,Ukraine Hryvnia,2
|
||||
UGX,Uganda Shilling,2
|
||||
USD,US Dollar,2
|
||||
UYU,Peso Uruguayo,2
|
||||
UZS,Uzbekistan Sum,2
|
||||
VEB,Venezuelan Bolivar,2
|
||||
VND,Vietnamese Dong,2
|
||||
VUV,Vanuatu Vatu,0
|
||||
WST,Samoa Tala,2
|
||||
XAF,CFA Franc BEAC,0
|
||||
XCD,East Caribbean Dollar,2
|
||||
XDR,SDR (Special Drawing Rights),5
|
||||
XOF,CFA Franc BCEAO,0
|
||||
XPF,CFP Franc,0
|
||||
YER,Yemeni Rial,2
|
||||
ZAR,South African Rand,2
|
||||
ZMK,Zambian Kwacha,2
|
||||
ZWD,Zimbabwe Dollar,2
|
||||
# File of all ISO-4217 currencies codes
|
||||
# http://en.wikipedia.org/wiki/ISO_4217
|
||||
# http://fx.sauder.ubc.ca/currency_table.html for symbols for 2 letter code
|
||||
#
|
||||
# Code,Name,Nb decimals
|
||||
AED,UAE Dirham,2
|
||||
AFN,Afghanistan Afghani,2
|
||||
ALL,Albanian Lek,2
|
||||
AMD,Armenian Dram,2
|
||||
ANG,Netherlands Antillian Guilder,2
|
||||
AOA,Angolan Kwanza,2
|
||||
ARS,Argentine Peso,2
|
||||
AUD,Australian Dollar,2
|
||||
AWG,Aruban Guilder,2
|
||||
AZM,Azerbaijanian Manat,2
|
||||
BAM,Bosnia and Herzegovina Convertible Marks,2
|
||||
BBD,Barbados Dollar,2
|
||||
BDT,Bangladesh Taka,2
|
||||
BGN,Bulgarian Lev,2
|
||||
BHD,Bahraini Dinar,3
|
||||
BIF,Burundi Franc,0
|
||||
BMD,Bermudian Dollar,2
|
||||
BND,Brunei Dollar,2
|
||||
BOB,Bolivian Boliviano,2
|
||||
BRL,Brazilian Real,2
|
||||
BSD,Bahamian Dollar,2
|
||||
BTN,Bhutan Ngultrum,2
|
||||
BWP,Botswana Pula,2
|
||||
BYR,Belarussian Ruble,0
|
||||
BZD,Belize Dollar,2
|
||||
CAD,Canadian Dollar,2
|
||||
CDF,Franc Congolais,2
|
||||
CHF,Swiss Franc,2
|
||||
CLP,Chilean Peso,0
|
||||
CNY,Chinese Yuan Renminbi,2
|
||||
COP,Colombian Peso,2
|
||||
CRC,Costa Rican Colon,2
|
||||
CSD,Serbian Dinar,2
|
||||
CUP,Cuban Peso,2
|
||||
CVE,Cape Verde Escudo,2
|
||||
CYP,Cyprus Pound,2
|
||||
CZK,Czech Koruna,2
|
||||
DJF,Djibouti Franc,0
|
||||
DKK,Danish Krone,2
|
||||
DOP,Dominican Peso,2
|
||||
DZD,Algerian Dinar,2
|
||||
EEK,Estonian Kroon,2
|
||||
EGP,Egyptian Pound,2
|
||||
ERN,Eritrea Nafka,2
|
||||
ETB,Ethiopian Birr,2
|
||||
EUR,euro,2
|
||||
FJD,Fiji Dollar,2
|
||||
FKP,Falkland Islands Pound,2
|
||||
GBP,Pound Sterling,2
|
||||
GEL,Georgian Lari,2
|
||||
GHC,Ghana Cedi,2
|
||||
GIP,Gibraltar Pound,2
|
||||
GMD,Gambian Dalasi,2
|
||||
GNF,Guinea Franc,0
|
||||
GTQ,Guatemala Quetzal,2
|
||||
GYD,Guyana Dollar,2
|
||||
HKD,Hong Kong Dollar,2
|
||||
HNL,Honduras Lempira,2
|
||||
HRK,Croatian Kuna,2
|
||||
HTG,Haiti Gourde,2
|
||||
HUF,Hungarian Forint,2
|
||||
IDR,Indonesian Rupiah,2
|
||||
ILS,New Israeli Shekel,2
|
||||
INR,Indian Rupee,2
|
||||
IQD,Iraqi Dinar,3
|
||||
IRR,Iranian Rial,2
|
||||
ISK,Iceland Krona,2
|
||||
JMD,Jamaican Dollar,2
|
||||
JOD,Jordanian Dinar,3
|
||||
JPY,Japanese Yen,0
|
||||
KES,Kenyan Shilling,2
|
||||
KGS,Kyrgyzstan Som,2
|
||||
KHR,Cambodia Riel,2
|
||||
KMF,Comoro Franc,0
|
||||
KPW,North Korean Won,2
|
||||
KRW,Korean Won,0
|
||||
KWD,Kuwaiti Dinar,3
|
||||
KYD,Cayman Islands Dollar,2
|
||||
KZT,Kazakhstan Tenge,2
|
||||
LAK,Lao Kip,2
|
||||
LBP,Lebanese Pound,2
|
||||
LKR,Sri Lanka Rupee,2
|
||||
LRD,Liberian Dollar,2
|
||||
LSL,Lesotho Loti,2
|
||||
LTL,Lithuanian Litas,2
|
||||
LVL,Latvian Lats,2
|
||||
LYD,Libyan Dinar,3
|
||||
MAD,Moroccan Dirham,2
|
||||
MDL,Moldovan Leu,2
|
||||
MGA,Malagasy Ariary,2
|
||||
MKD,Macedonian Denar,2
|
||||
MMK,Myanmar Kyat,2
|
||||
MNT,Mongolian Tugrik,2
|
||||
MOP,Macau Pataca,2
|
||||
MRO,Mauritania Ouguiya,2
|
||||
MTL,Maltese Lira,2
|
||||
MUR,Mauritius Rupee,2
|
||||
MVR,Maldives Rufiyaa,2
|
||||
MWK,Malawi Kwacha,2
|
||||
MXN,Mexican Peso,2
|
||||
MYR,Malaysian Ringgit,2
|
||||
MZM,Mozambique Metical,2
|
||||
NAD,Namibia Dollar,2
|
||||
NGN,Nigerian Naira,2
|
||||
NIO,Nicaragua Cordoba Oro,2
|
||||
NOK,Norwegian Krone,2
|
||||
NPR,Nepalese Rupee,2
|
||||
NZD,New Zealand Dollar,2
|
||||
OMR,Rial Omani,3
|
||||
PAB,Panama Balboa,2
|
||||
PEN,Peruvian Nuevo Sol,2
|
||||
PGK,Papua New Guinea Kina,2
|
||||
PHP,Philippine Peso,2
|
||||
PKR,Pakistan Rupee,2
|
||||
PLN,Polish Zloty,2
|
||||
PYG,Paraguayan Guarani,0
|
||||
QAR,Qatari Rial,2
|
||||
RON,Romanian Leu,2
|
||||
RUB,Russian Ruble,2
|
||||
RWF,Rwanda Franc,0
|
||||
SAR,Saudi Riyal,2
|
||||
SBD,Solomon Islands Dollar,2
|
||||
SCR,Seychelles Rupee,2
|
||||
SDD,Sudanese Dinar,2
|
||||
SEK,Swedish Krona,2
|
||||
SGD,Singapore Dollar,2
|
||||
SHP,St Helena Pound,2
|
||||
SIT,Slovenian Tolar,2
|
||||
SKK,Slovak Koruna,2
|
||||
SLL,Sierra Leone Leone,2
|
||||
SOS,Somali Shilling,2
|
||||
SRD,Surinam Dollar,2
|
||||
STD,São Tome and Principe Dobra,2
|
||||
SVC,El Salvador Colon,2
|
||||
SYP,Syrian Pound,2
|
||||
SZL,Swaziland Lilangeni,2
|
||||
THB,Thai Baht,2
|
||||
TJS,Tajik Somoni,2
|
||||
TMM,Turkmenistan Manat,2
|
||||
TND,Tunisian Dinar,3
|
||||
TOP,Tonga Pa'anga,2
|
||||
TRY,Turkish Lira,2
|
||||
TTD,Trinidad and Tobago Dollar,2
|
||||
TWD,New Taiwan Dollar,2
|
||||
TZS,Tanzanian Shilling,2
|
||||
UAH,Ukraine Hryvnia,2
|
||||
UGX,Uganda Shilling,2
|
||||
USD,US Dollar,2
|
||||
UYU,Peso Uruguayo,2
|
||||
UZS,Uzbekistan Sum,2
|
||||
VEB,Venezuelan Bolivar,2
|
||||
VND,Vietnamese Dong,2
|
||||
VUV,Vanuatu Vatu,0
|
||||
WST,Samoa Tala,2
|
||||
XAF,CFA Franc BEAC,0
|
||||
XCD,East Caribbean Dollar,2
|
||||
XDR,SDR (Special Drawing Rights),5
|
||||
XOF,CFA Franc BCEAO,0
|
||||
XPF,CFP Franc,0
|
||||
YER,Yemeni Rial,2
|
||||
ZAR,South African Rand,2
|
||||
ZMK,Zambian Kwacha,2
|
||||
ZWD,Zimbabwe Dollar,2
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formproduct.class.php");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
@ -49,6 +50,7 @@ if ($_POST["action"] == 'set')
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$formproduct=new FormProduct($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -85,9 +87,8 @@ if ($conf->global->MAIN_MODULE_STOCK)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskIdWareHouse").'</td>';
|
||||
print '<td colspan="2"><select class="flat" name="level">';
|
||||
//$conf->global->CASHDESK_ID_WAREHOUSE
|
||||
print '</select>';
|
||||
print '<td colspan="2">';
|
||||
$formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'CASHDESK_ID_WAREHOUSE');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
_samples
|
||||
_testcases
|
||||
_samples
|
||||
_testcases
|
||||
|
||||
@ -1 +1 @@
|
||||
_sources
|
||||
_sources
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
This directory contains all FPDFI librairies:
|
||||
- FPDI
|
||||
- FPDI_TPL
|
||||
- FPDI_Protection
|
||||
Found on http://www.setasign.de/products/pdf-php-solutions/fpdi/
|
||||
This directory contains all FPDFI librairies:
|
||||
- FPDI
|
||||
- FPDI_TPL
|
||||
- FPDI_Protection
|
||||
Found on http://www.setasign.de/products/pdf-php-solutions/fpdi/
|
||||
|
||||
@ -1,97 +1,97 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
if (!defined("ORD_z"))
|
||||
define("ORD_z",ord('z'));
|
||||
if (!defined("ORD_exclmark"))
|
||||
define("ORD_exclmark", ord('!'));
|
||||
if (!defined("ORD_u"))
|
||||
define("ORD_u", ord("u"));
|
||||
if (!defined("ORD_tilde"))
|
||||
define("ORD_tilde", ord('~'));
|
||||
|
||||
class ASCII85Decode {
|
||||
|
||||
function ASCII85Decode(&$fpdi) {
|
||||
$this->fpdi =& $fpdi;
|
||||
}
|
||||
|
||||
|
||||
function decode($in) {
|
||||
$out = "";
|
||||
$state = 0;
|
||||
$chn = null;
|
||||
|
||||
$l = strlen($in);
|
||||
|
||||
for ($k = 0; $k < $l; ++$k) {
|
||||
$ch = ord($in[$k]) & 0xff;
|
||||
|
||||
if ($ch == ORD_tilde) {
|
||||
break;
|
||||
}
|
||||
if (preg_match("/^\s$/",chr($ch))) {
|
||||
continue;
|
||||
}
|
||||
if ($ch == ORD_z && $state == 0) {
|
||||
$out .= chr(0).chr(0).chr(0).chr(0);
|
||||
continue;
|
||||
}
|
||||
if ($ch < ORD_exclmark || $ch > ORD_u) {
|
||||
$this->fpdi->error("Illegal character in ASCII85Decode.");
|
||||
}
|
||||
|
||||
$chn[$state++] = $ch - ORD_exclmark;
|
||||
|
||||
if ($state == 5) {
|
||||
$state = 0;
|
||||
$r = 0;
|
||||
for ($j = 0; $j < 5; ++$j)
|
||||
$r = $r * 85 + $chn[$j];
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
$out .= chr($r >> 8);
|
||||
$out .= chr($r);
|
||||
}
|
||||
}
|
||||
$r = 0;
|
||||
|
||||
if ($state == 1)
|
||||
$this->fpdi->error("Illegal length in ASCII85Decode.");
|
||||
if ($state == 2) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85;
|
||||
$out .= chr($r >> 24);
|
||||
}
|
||||
else if ($state == 3) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85;
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
}
|
||||
else if ($state == 4) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ;
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
$out .= chr($r >> 8);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
if (!defined("ORD_z"))
|
||||
define("ORD_z",ord('z'));
|
||||
if (!defined("ORD_exclmark"))
|
||||
define("ORD_exclmark", ord('!'));
|
||||
if (!defined("ORD_u"))
|
||||
define("ORD_u", ord("u"));
|
||||
if (!defined("ORD_tilde"))
|
||||
define("ORD_tilde", ord('~'));
|
||||
|
||||
class ASCII85Decode {
|
||||
|
||||
function ASCII85Decode(&$fpdi) {
|
||||
$this->fpdi =& $fpdi;
|
||||
}
|
||||
|
||||
|
||||
function decode($in) {
|
||||
$out = "";
|
||||
$state = 0;
|
||||
$chn = null;
|
||||
|
||||
$l = strlen($in);
|
||||
|
||||
for ($k = 0; $k < $l; ++$k) {
|
||||
$ch = ord($in[$k]) & 0xff;
|
||||
|
||||
if ($ch == ORD_tilde) {
|
||||
break;
|
||||
}
|
||||
if (preg_match("/^\s$/",chr($ch))) {
|
||||
continue;
|
||||
}
|
||||
if ($ch == ORD_z && $state == 0) {
|
||||
$out .= chr(0).chr(0).chr(0).chr(0);
|
||||
continue;
|
||||
}
|
||||
if ($ch < ORD_exclmark || $ch > ORD_u) {
|
||||
$this->fpdi->error("Illegal character in ASCII85Decode.");
|
||||
}
|
||||
|
||||
$chn[$state++] = $ch - ORD_exclmark;
|
||||
|
||||
if ($state == 5) {
|
||||
$state = 0;
|
||||
$r = 0;
|
||||
for ($j = 0; $j < 5; ++$j)
|
||||
$r = $r * 85 + $chn[$j];
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
$out .= chr($r >> 8);
|
||||
$out .= chr($r);
|
||||
}
|
||||
}
|
||||
$r = 0;
|
||||
|
||||
if ($state == 1)
|
||||
$this->fpdi->error("Illegal length in ASCII85Decode.");
|
||||
if ($state == 2) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85;
|
||||
$out .= chr($r >> 24);
|
||||
}
|
||||
else if ($state == 3) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85;
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
}
|
||||
else if ($state == 4) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ;
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
$out .= chr($r >> 8);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,151 +1,151 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
class LZWDecode {
|
||||
|
||||
var $sTable = array();
|
||||
var $data = null;
|
||||
var $tIdx;
|
||||
var $bitsToGet = 9;
|
||||
var $bytePointer;
|
||||
var $bitPointer;
|
||||
var $nextData = 0;
|
||||
var $nextBits = 0;
|
||||
var $andTable = array(511, 1023, 2047, 4095);
|
||||
|
||||
function LZWDecode(&$fpdi) {
|
||||
$this->fpdi =& $fpdi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to decode LZW compressed data.
|
||||
*
|
||||
* @param string data The compressed data.
|
||||
*/
|
||||
function decode(&$data) {
|
||||
|
||||
if($data[0] == 0x00 && $data[1] == 0x01) {
|
||||
$this->fpdi->error("LZW flavour not supported.");
|
||||
}
|
||||
|
||||
$this->initsTable();
|
||||
|
||||
$this->data =& $data;
|
||||
|
||||
// Initialize pointers
|
||||
$this->bytePointer = 0;
|
||||
$this->bitPointer = 0;
|
||||
|
||||
$this->nextData = 0;
|
||||
$this->nextBits = 0;
|
||||
|
||||
$oldCode = 0;
|
||||
|
||||
$string = "";
|
||||
$uncompData = "";
|
||||
|
||||
while (($code = $this->getNextCode()) != 257) {
|
||||
if ($code == 256) {
|
||||
$this->initsTable();
|
||||
$code = $this->getNextCode();
|
||||
|
||||
if ($code == 257) {
|
||||
break;
|
||||
}
|
||||
|
||||
$uncompData .= $this->sTable[$code];
|
||||
$oldCode = $code;
|
||||
|
||||
} else {
|
||||
|
||||
if ($code < $this->tIdx) {
|
||||
$string = $this->sTable[$code];
|
||||
$uncompData .= $string;
|
||||
|
||||
$this->addStringToTable($this->sTable[$oldCode], $string[0]);
|
||||
$oldCode = $code;
|
||||
} else {
|
||||
$string = $this->sTable[$oldCode];
|
||||
$string = $string.$string[0];
|
||||
$uncompData .= $string;
|
||||
|
||||
$this->addStringToTable($string);
|
||||
$oldCode = $code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $uncompData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the string table.
|
||||
*/
|
||||
function initsTable() {
|
||||
$this->sTable = array();
|
||||
|
||||
for ($i = 0; $i < 256; $i++)
|
||||
$this->sTable[$i] = chr($i);
|
||||
|
||||
$this->tIdx = 258;
|
||||
$this->bitsToGet = 9;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new string to the string table.
|
||||
*/
|
||||
function addStringToTable ($oldString, $newString="") {
|
||||
$string = $oldString.$newString;
|
||||
|
||||
// Add this new String to the table
|
||||
$this->sTable[$this->tIdx++] = $string;
|
||||
|
||||
if ($this->tIdx == 511) {
|
||||
$this->bitsToGet = 10;
|
||||
} else if ($this->tIdx == 1023) {
|
||||
$this->bitsToGet = 11;
|
||||
} else if ($this->tIdx == 2047) {
|
||||
$this->bitsToGet = 12;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the next 9, 10, 11 or 12 bits
|
||||
function getNextCode() {
|
||||
if ($this->bytePointer == strlen($this->data))
|
||||
return 257;
|
||||
|
||||
$this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff);
|
||||
$this->nextBits += 8;
|
||||
|
||||
if ($this->nextBits < $this->bitsToGet) {
|
||||
$this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff);
|
||||
$this->nextBits += 8;
|
||||
}
|
||||
|
||||
$code = ($this->nextData >> ($this->nextBits - $this->bitsToGet)) & $this->andTable[$this->bitsToGet-9];
|
||||
$this->nextBits -= $this->bitsToGet;
|
||||
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
class LZWDecode {
|
||||
|
||||
var $sTable = array();
|
||||
var $data = null;
|
||||
var $tIdx;
|
||||
var $bitsToGet = 9;
|
||||
var $bytePointer;
|
||||
var $bitPointer;
|
||||
var $nextData = 0;
|
||||
var $nextBits = 0;
|
||||
var $andTable = array(511, 1023, 2047, 4095);
|
||||
|
||||
function LZWDecode(&$fpdi) {
|
||||
$this->fpdi =& $fpdi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to decode LZW compressed data.
|
||||
*
|
||||
* @param string data The compressed data.
|
||||
*/
|
||||
function decode(&$data) {
|
||||
|
||||
if($data[0] == 0x00 && $data[1] == 0x01) {
|
||||
$this->fpdi->error("LZW flavour not supported.");
|
||||
}
|
||||
|
||||
$this->initsTable();
|
||||
|
||||
$this->data =& $data;
|
||||
|
||||
// Initialize pointers
|
||||
$this->bytePointer = 0;
|
||||
$this->bitPointer = 0;
|
||||
|
||||
$this->nextData = 0;
|
||||
$this->nextBits = 0;
|
||||
|
||||
$oldCode = 0;
|
||||
|
||||
$string = "";
|
||||
$uncompData = "";
|
||||
|
||||
while (($code = $this->getNextCode()) != 257) {
|
||||
if ($code == 256) {
|
||||
$this->initsTable();
|
||||
$code = $this->getNextCode();
|
||||
|
||||
if ($code == 257) {
|
||||
break;
|
||||
}
|
||||
|
||||
$uncompData .= $this->sTable[$code];
|
||||
$oldCode = $code;
|
||||
|
||||
} else {
|
||||
|
||||
if ($code < $this->tIdx) {
|
||||
$string = $this->sTable[$code];
|
||||
$uncompData .= $string;
|
||||
|
||||
$this->addStringToTable($this->sTable[$oldCode], $string[0]);
|
||||
$oldCode = $code;
|
||||
} else {
|
||||
$string = $this->sTable[$oldCode];
|
||||
$string = $string.$string[0];
|
||||
$uncompData .= $string;
|
||||
|
||||
$this->addStringToTable($string);
|
||||
$oldCode = $code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $uncompData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the string table.
|
||||
*/
|
||||
function initsTable() {
|
||||
$this->sTable = array();
|
||||
|
||||
for ($i = 0; $i < 256; $i++)
|
||||
$this->sTable[$i] = chr($i);
|
||||
|
||||
$this->tIdx = 258;
|
||||
$this->bitsToGet = 9;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new string to the string table.
|
||||
*/
|
||||
function addStringToTable ($oldString, $newString="") {
|
||||
$string = $oldString.$newString;
|
||||
|
||||
// Add this new String to the table
|
||||
$this->sTable[$this->tIdx++] = $string;
|
||||
|
||||
if ($this->tIdx == 511) {
|
||||
$this->bitsToGet = 10;
|
||||
} else if ($this->tIdx == 1023) {
|
||||
$this->bitsToGet = 11;
|
||||
} else if ($this->tIdx == 2047) {
|
||||
$this->bitsToGet = 12;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the next 9, 10, 11 or 12 bits
|
||||
function getNextCode() {
|
||||
if ($this->bytePointer == strlen($this->data))
|
||||
return 257;
|
||||
|
||||
$this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff);
|
||||
$this->nextBits += 8;
|
||||
|
||||
if ($this->nextBits < $this->bitsToGet) {
|
||||
$this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff);
|
||||
$this->nextBits += 8;
|
||||
}
|
||||
|
||||
$code = ($this->nextData >> ($this->nextBits - $this->bitsToGet)) & $this->andTable[$this->bitsToGet-9];
|
||||
$this->nextBits -= $this->bitsToGet;
|
||||
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@ -1,385 +1,385 @@
|
||||
<?php
|
||||
//
|
||||
// FPDF_TPL - Version 1.1.1
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once(FPDF_PATH."fpdf.php");
|
||||
|
||||
class FPDF_TPL extends FPDF {
|
||||
/**
|
||||
* Array of Tpl-Data
|
||||
* @var array
|
||||
*/
|
||||
var $tpls = array();
|
||||
|
||||
/**
|
||||
* Current Template-ID
|
||||
* @var int
|
||||
*/
|
||||
var $tpl = 0;
|
||||
|
||||
/**
|
||||
* "In Template"-Flag
|
||||
* @var boolean
|
||||
*/
|
||||
var $_intpl = false;
|
||||
|
||||
/**
|
||||
* Nameprefix of Templates used in Resources-Dictonary
|
||||
* @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an /
|
||||
*/
|
||||
var $tplprefix = "/TPL";
|
||||
|
||||
/**
|
||||
* Resources used By Templates and Pages
|
||||
* @var array
|
||||
*/
|
||||
var $_res = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* See FPDF-Documentation
|
||||
* @param string $orientation
|
||||
* @param string $unit
|
||||
* @param mixed $format
|
||||
*/
|
||||
function fpdf_tpl($orientation='P',$unit='mm',$format='A4') {
|
||||
parent::fpdf($orientation,$unit,$format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a Template
|
||||
*
|
||||
* This method starts a template. You can give own coordinates to build an own sized
|
||||
* Template. Pay attention, that the margins are adapted to the new templatesize.
|
||||
* If you want to write outside the template, for example to build a clipped Template,
|
||||
* you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call.
|
||||
*
|
||||
* If no parameter is given, the template uses the current page-size.
|
||||
* The Method returns an ID of the current Template. This ID is used later for using this template.
|
||||
* Warning: A created Template is used in PDF at all events. Still if you don't use it after creation!
|
||||
*
|
||||
* @param int $x The x-coordinate given in user-unit
|
||||
* @param int $y The y-coordinate given in user-unit
|
||||
* @param int $w The width given in user-unit
|
||||
* @param int $h The height given in user-unit
|
||||
* @return int The ID of new created Template
|
||||
*/
|
||||
function beginTemplate($x=null,$y=null,$w=null,$h=null) {
|
||||
if ($this->page <= 0)
|
||||
$this->error("You have to add a page to fpdf first!");
|
||||
|
||||
if ($x == null)
|
||||
$x = 0;
|
||||
if ($y == null)
|
||||
$y = 0;
|
||||
if ($w == null)
|
||||
$w = $this->w;
|
||||
if ($h == null)
|
||||
$h = $this->h;
|
||||
|
||||
// Save settings
|
||||
$this->tpl++;
|
||||
$tpl =& $this->tpls[$this->tpl];
|
||||
$tpl = array(
|
||||
'o_x' => $this->x,
|
||||
'o_y' => $this->y,
|
||||
'o_AutoPageBreak' => $this->AutoPageBreak,
|
||||
'o_bMargin' => $this->bMargin,
|
||||
'o_tMargin' => $this->tMargin,
|
||||
'o_lMargin' => $this->lMargin,
|
||||
'o_rMargin' => $this->rMargin,
|
||||
'o_h' => $this->h,
|
||||
'o_w' => $this->w,
|
||||
'buffer' => '',
|
||||
'x' => $x,
|
||||
'y' => $y,
|
||||
'w' => $w,
|
||||
'h' => $h
|
||||
);
|
||||
|
||||
$this->SetAutoPageBreak(false);
|
||||
|
||||
// Define own high and width to calculate possitions correct
|
||||
$this->h = $h;
|
||||
$this->w = $w;
|
||||
|
||||
$this->_intpl = true;
|
||||
$this->SetXY($x+$this->lMargin,$y+$this->tMargin);
|
||||
$this->SetRightMargin($this->w-$w+$this->rMargin);
|
||||
|
||||
return $this->tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* End Template
|
||||
*
|
||||
* This method ends a template and reset initiated variables on beginTemplate.
|
||||
*
|
||||
* @return mixed If a template is opened, the ID is returned. If not a false is returned.
|
||||
*/
|
||||
function endTemplate() {
|
||||
if ($this->_intpl) {
|
||||
$this->_intpl = false;
|
||||
$tpl =& $this->tpls[$this->tpl];
|
||||
$this->SetXY($tpl['o_x'], $tpl['o_y']);
|
||||
$this->tMargin = $tpl['o_tMargin'];
|
||||
$this->lMargin = $tpl['o_lMargin'];
|
||||
$this->rMargin = $tpl['o_rMargin'];
|
||||
$this->h = $tpl['o_h'];
|
||||
$this->w = $tpl['o_w'];
|
||||
$this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']);
|
||||
|
||||
return $this->tpl;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a Template in current Page or other Template
|
||||
*
|
||||
* You can use a template in a page or in another template.
|
||||
* You can give the used template a new size like you use the Image()-method.
|
||||
* All parameters are optional. The width or height is calculated automaticaly
|
||||
* if one is given. If no parameter is given the origin size as defined in
|
||||
* beginTemplate() is used.
|
||||
* The calculated or used width and height are returned as an array.
|
||||
*
|
||||
* @param int $tplidx A valid template-Id
|
||||
* @param int $_x The x-position
|
||||
* @param int $_y The y-position
|
||||
* @param int $_w The new width of the template
|
||||
* @param int $_h The new height of the template
|
||||
* @retrun array The height and width of the template
|
||||
*/
|
||||
function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) {
|
||||
if ($this->page <= 0)
|
||||
$this->error("You have to add a page to fpdf first!");
|
||||
|
||||
if (!isset($this->tpls[$tplidx]))
|
||||
$this->error("Template does not exist!");
|
||||
|
||||
if ($this->_intpl) {
|
||||
$this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx];
|
||||
}
|
||||
|
||||
$tpl =& $this->tpls[$tplidx];
|
||||
$x = $tpl['x'];
|
||||
$y = $tpl['y'];
|
||||
$w = $tpl['w'];
|
||||
$h = $tpl['h'];
|
||||
|
||||
if ($_x == null)
|
||||
$_x = $x;
|
||||
if ($_y == null)
|
||||
$_y = $y;
|
||||
$wh = $this->getTemplateSize($tplidx,$_w,$_h);
|
||||
$_w = $wh['w'];
|
||||
$_h = $wh['h'];
|
||||
|
||||
$this->_out(sprintf("q %.4f 0 0 %.4f %.2f %.2f cm", ($_w/$w), ($_h/$h), $_x*$this->k, ($this->h-($_y+$_h))*$this->k)); // Translate
|
||||
$this->_out($this->tplprefix.$tplidx." Do Q");
|
||||
|
||||
return array("w" => $_w, "h" => $_h);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The calculated Size of a Template
|
||||
*
|
||||
* If one size is given, this method calculates the other one.
|
||||
*
|
||||
* @param int $tplidx A valid template-Id
|
||||
* @param int $_w The width of the template
|
||||
* @param int $_h The height of the template
|
||||
* @return array The height and width of the template
|
||||
*/
|
||||
function getTemplateSize($tplidx, $_w=0, $_h=0) {
|
||||
if (!$this->tpls[$tplidx])
|
||||
return false;
|
||||
|
||||
$tpl =& $this->tpls[$tplidx];
|
||||
$w = $tpl['w'];
|
||||
$h = $tpl['h'];
|
||||
|
||||
if ($_w == 0 and $_h == 0) {
|
||||
$_w = $w;
|
||||
$_h = $h;
|
||||
}
|
||||
|
||||
if($_w==0)
|
||||
$_w=$_h*$w/$h;
|
||||
if($_h==0)
|
||||
$_h=$_w*$h/$w;
|
||||
|
||||
return array("w" => $_w, "h" => $_h);
|
||||
}
|
||||
|
||||
/**
|
||||
* See FPDF-Documentation ;-)
|
||||
*/
|
||||
function SetFont($family,$style='',$size=0) {
|
||||
/**
|
||||
* force the resetting of font changes in a template
|
||||
*/
|
||||
if ($this->_intpl)
|
||||
$this->FontFamily = '';
|
||||
|
||||
parent::SetFont($family, $style, $size);
|
||||
|
||||
$fontkey = $this->FontFamily.$this->FontStyle;
|
||||
|
||||
if ($this->_intpl) {
|
||||
$this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey];
|
||||
} else {
|
||||
$this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See FPDF-Documentation ;-)
|
||||
*/
|
||||
function Image($file,$x,$y,$w=0,$h=0,$type='',$link='') {
|
||||
parent::Image($file,$x,$y,$w,$h,$type,$link);
|
||||
if ($this->_intpl) {
|
||||
$this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file];
|
||||
} else {
|
||||
$this->_res['page'][$this->page]['images'][$file] =& $this->images[$file];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See FPDF-Documentation ;-)
|
||||
*
|
||||
* AddPage is not available when you're "in" a template.
|
||||
*/
|
||||
function AddPage($orientation='') {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Adding pages in templates isn\'t possible!');
|
||||
parent::AddPage($orientation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserve adding Links in Templates ...won't work
|
||||
*/
|
||||
function Link($x,$y,$w,$h,$link) {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Using links in templates aren\'t possible!');
|
||||
parent::Link($x,$y,$w,$h,$link);
|
||||
}
|
||||
|
||||
function AddLink() {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Adding links in templates aren\'t possible!');
|
||||
return parent::AddLink();
|
||||
}
|
||||
|
||||
function SetLink($link,$y=0,$page=-1) {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Setting links in templates aren\'t possible!');
|
||||
parent::SetLink($link,$y,$page);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method that writes the form xobjects
|
||||
*/
|
||||
function _putformxobjects() {
|
||||
$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||
reset($this->tpls);
|
||||
foreach($this->tpls AS $tplidx => $tpl) {
|
||||
|
||||
$p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
|
||||
$this->_newobj();
|
||||
$this->tpls[$tplidx]['n'] = $this->n;
|
||||
$this->_out('<<'.$filter.'/Type /XObject');
|
||||
$this->_out('/Subtype /Form');
|
||||
$this->_out('/FormType 1');
|
||||
$this->_out(sprintf('/BBox [%.2f %.2f %.2f %.2f]',$tpl['x']*$this->k, ($tpl['h']-$tpl['y'])*$this->k, $tpl['w']*$this->k, ($tpl['h']-$tpl['y']-$tpl['h'])*$this->k));
|
||||
$this->_out('/Resources ');
|
||||
|
||||
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
|
||||
if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
|
||||
$this->_out('/Font <<');
|
||||
foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
|
||||
$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
|
||||
$this->_out('>>');
|
||||
}
|
||||
if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
|
||||
isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))
|
||||
{
|
||||
$this->_out('/XObject <<');
|
||||
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['images'] as $image)
|
||||
$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
|
||||
}
|
||||
if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
|
||||
$this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
$this->_out('>>');
|
||||
|
||||
$this->_out('/Length '.strlen($p).' >>');
|
||||
$this->_putstream($p);
|
||||
$this->_out('endobj');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method
|
||||
*/
|
||||
function _putresources() {
|
||||
$this->_putfonts();
|
||||
$this->_putimages();
|
||||
$this->_putformxobjects();
|
||||
//Resource dictionary
|
||||
$this->offsets[2]=strlen($this->buffer);
|
||||
$this->_out('2 0 obj');
|
||||
$this->_out('<<');
|
||||
$this->_putresourcedict();
|
||||
$this->_out('>>');
|
||||
$this->_out('endobj');
|
||||
}
|
||||
|
||||
function _putxobjectdict() {
|
||||
parent::_putxobjectdict();
|
||||
|
||||
if (count($this->tpls)) {
|
||||
foreach($this->tpls as $tplidx => $tpl) {
|
||||
$this->_out($this->tplprefix.$tplidx.' '.$tpl['n'].' 0 R');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method
|
||||
*/
|
||||
function _out($s) {
|
||||
//Add a line to the document
|
||||
if ($this->state==2) {
|
||||
if (!$this->_intpl)
|
||||
$this->pages[$this->page].=$s."\n";
|
||||
else
|
||||
$this->tpls[$this->tpl]['buffer'] .= $s."\n";
|
||||
} else {
|
||||
$this->buffer.=$s."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
//
|
||||
// FPDF_TPL - Version 1.1.1
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once(FPDF_PATH."fpdf.php");
|
||||
|
||||
class FPDF_TPL extends FPDF {
|
||||
/**
|
||||
* Array of Tpl-Data
|
||||
* @var array
|
||||
*/
|
||||
var $tpls = array();
|
||||
|
||||
/**
|
||||
* Current Template-ID
|
||||
* @var int
|
||||
*/
|
||||
var $tpl = 0;
|
||||
|
||||
/**
|
||||
* "In Template"-Flag
|
||||
* @var boolean
|
||||
*/
|
||||
var $_intpl = false;
|
||||
|
||||
/**
|
||||
* Nameprefix of Templates used in Resources-Dictonary
|
||||
* @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an /
|
||||
*/
|
||||
var $tplprefix = "/TPL";
|
||||
|
||||
/**
|
||||
* Resources used By Templates and Pages
|
||||
* @var array
|
||||
*/
|
||||
var $_res = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* See FPDF-Documentation
|
||||
* @param string $orientation
|
||||
* @param string $unit
|
||||
* @param mixed $format
|
||||
*/
|
||||
function fpdf_tpl($orientation='P',$unit='mm',$format='A4') {
|
||||
parent::fpdf($orientation,$unit,$format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a Template
|
||||
*
|
||||
* This method starts a template. You can give own coordinates to build an own sized
|
||||
* Template. Pay attention, that the margins are adapted to the new templatesize.
|
||||
* If you want to write outside the template, for example to build a clipped Template,
|
||||
* you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call.
|
||||
*
|
||||
* If no parameter is given, the template uses the current page-size.
|
||||
* The Method returns an ID of the current Template. This ID is used later for using this template.
|
||||
* Warning: A created Template is used in PDF at all events. Still if you don't use it after creation!
|
||||
*
|
||||
* @param int $x The x-coordinate given in user-unit
|
||||
* @param int $y The y-coordinate given in user-unit
|
||||
* @param int $w The width given in user-unit
|
||||
* @param int $h The height given in user-unit
|
||||
* @return int The ID of new created Template
|
||||
*/
|
||||
function beginTemplate($x=null,$y=null,$w=null,$h=null) {
|
||||
if ($this->page <= 0)
|
||||
$this->error("You have to add a page to fpdf first!");
|
||||
|
||||
if ($x == null)
|
||||
$x = 0;
|
||||
if ($y == null)
|
||||
$y = 0;
|
||||
if ($w == null)
|
||||
$w = $this->w;
|
||||
if ($h == null)
|
||||
$h = $this->h;
|
||||
|
||||
// Save settings
|
||||
$this->tpl++;
|
||||
$tpl =& $this->tpls[$this->tpl];
|
||||
$tpl = array(
|
||||
'o_x' => $this->x,
|
||||
'o_y' => $this->y,
|
||||
'o_AutoPageBreak' => $this->AutoPageBreak,
|
||||
'o_bMargin' => $this->bMargin,
|
||||
'o_tMargin' => $this->tMargin,
|
||||
'o_lMargin' => $this->lMargin,
|
||||
'o_rMargin' => $this->rMargin,
|
||||
'o_h' => $this->h,
|
||||
'o_w' => $this->w,
|
||||
'buffer' => '',
|
||||
'x' => $x,
|
||||
'y' => $y,
|
||||
'w' => $w,
|
||||
'h' => $h
|
||||
);
|
||||
|
||||
$this->SetAutoPageBreak(false);
|
||||
|
||||
// Define own high and width to calculate possitions correct
|
||||
$this->h = $h;
|
||||
$this->w = $w;
|
||||
|
||||
$this->_intpl = true;
|
||||
$this->SetXY($x+$this->lMargin,$y+$this->tMargin);
|
||||
$this->SetRightMargin($this->w-$w+$this->rMargin);
|
||||
|
||||
return $this->tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* End Template
|
||||
*
|
||||
* This method ends a template and reset initiated variables on beginTemplate.
|
||||
*
|
||||
* @return mixed If a template is opened, the ID is returned. If not a false is returned.
|
||||
*/
|
||||
function endTemplate() {
|
||||
if ($this->_intpl) {
|
||||
$this->_intpl = false;
|
||||
$tpl =& $this->tpls[$this->tpl];
|
||||
$this->SetXY($tpl['o_x'], $tpl['o_y']);
|
||||
$this->tMargin = $tpl['o_tMargin'];
|
||||
$this->lMargin = $tpl['o_lMargin'];
|
||||
$this->rMargin = $tpl['o_rMargin'];
|
||||
$this->h = $tpl['o_h'];
|
||||
$this->w = $tpl['o_w'];
|
||||
$this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']);
|
||||
|
||||
return $this->tpl;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a Template in current Page or other Template
|
||||
*
|
||||
* You can use a template in a page or in another template.
|
||||
* You can give the used template a new size like you use the Image()-method.
|
||||
* All parameters are optional. The width or height is calculated automaticaly
|
||||
* if one is given. If no parameter is given the origin size as defined in
|
||||
* beginTemplate() is used.
|
||||
* The calculated or used width and height are returned as an array.
|
||||
*
|
||||
* @param int $tplidx A valid template-Id
|
||||
* @param int $_x The x-position
|
||||
* @param int $_y The y-position
|
||||
* @param int $_w The new width of the template
|
||||
* @param int $_h The new height of the template
|
||||
* @retrun array The height and width of the template
|
||||
*/
|
||||
function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) {
|
||||
if ($this->page <= 0)
|
||||
$this->error("You have to add a page to fpdf first!");
|
||||
|
||||
if (!isset($this->tpls[$tplidx]))
|
||||
$this->error("Template does not exist!");
|
||||
|
||||
if ($this->_intpl) {
|
||||
$this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx];
|
||||
}
|
||||
|
||||
$tpl =& $this->tpls[$tplidx];
|
||||
$x = $tpl['x'];
|
||||
$y = $tpl['y'];
|
||||
$w = $tpl['w'];
|
||||
$h = $tpl['h'];
|
||||
|
||||
if ($_x == null)
|
||||
$_x = $x;
|
||||
if ($_y == null)
|
||||
$_y = $y;
|
||||
$wh = $this->getTemplateSize($tplidx,$_w,$_h);
|
||||
$_w = $wh['w'];
|
||||
$_h = $wh['h'];
|
||||
|
||||
$this->_out(sprintf("q %.4f 0 0 %.4f %.2f %.2f cm", ($_w/$w), ($_h/$h), $_x*$this->k, ($this->h-($_y+$_h))*$this->k)); // Translate
|
||||
$this->_out($this->tplprefix.$tplidx." Do Q");
|
||||
|
||||
return array("w" => $_w, "h" => $_h);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get The calculated Size of a Template
|
||||
*
|
||||
* If one size is given, this method calculates the other one.
|
||||
*
|
||||
* @param int $tplidx A valid template-Id
|
||||
* @param int $_w The width of the template
|
||||
* @param int $_h The height of the template
|
||||
* @return array The height and width of the template
|
||||
*/
|
||||
function getTemplateSize($tplidx, $_w=0, $_h=0) {
|
||||
if (!$this->tpls[$tplidx])
|
||||
return false;
|
||||
|
||||
$tpl =& $this->tpls[$tplidx];
|
||||
$w = $tpl['w'];
|
||||
$h = $tpl['h'];
|
||||
|
||||
if ($_w == 0 and $_h == 0) {
|
||||
$_w = $w;
|
||||
$_h = $h;
|
||||
}
|
||||
|
||||
if($_w==0)
|
||||
$_w=$_h*$w/$h;
|
||||
if($_h==0)
|
||||
$_h=$_w*$h/$w;
|
||||
|
||||
return array("w" => $_w, "h" => $_h);
|
||||
}
|
||||
|
||||
/**
|
||||
* See FPDF-Documentation ;-)
|
||||
*/
|
||||
function SetFont($family,$style='',$size=0) {
|
||||
/**
|
||||
* force the resetting of font changes in a template
|
||||
*/
|
||||
if ($this->_intpl)
|
||||
$this->FontFamily = '';
|
||||
|
||||
parent::SetFont($family, $style, $size);
|
||||
|
||||
$fontkey = $this->FontFamily.$this->FontStyle;
|
||||
|
||||
if ($this->_intpl) {
|
||||
$this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey];
|
||||
} else {
|
||||
$this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See FPDF-Documentation ;-)
|
||||
*/
|
||||
function Image($file,$x,$y,$w=0,$h=0,$type='',$link='') {
|
||||
parent::Image($file,$x,$y,$w,$h,$type,$link);
|
||||
if ($this->_intpl) {
|
||||
$this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file];
|
||||
} else {
|
||||
$this->_res['page'][$this->page]['images'][$file] =& $this->images[$file];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See FPDF-Documentation ;-)
|
||||
*
|
||||
* AddPage is not available when you're "in" a template.
|
||||
*/
|
||||
function AddPage($orientation='') {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Adding pages in templates isn\'t possible!');
|
||||
parent::AddPage($orientation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserve adding Links in Templates ...won't work
|
||||
*/
|
||||
function Link($x,$y,$w,$h,$link) {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Using links in templates aren\'t possible!');
|
||||
parent::Link($x,$y,$w,$h,$link);
|
||||
}
|
||||
|
||||
function AddLink() {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Adding links in templates aren\'t possible!');
|
||||
return parent::AddLink();
|
||||
}
|
||||
|
||||
function SetLink($link,$y=0,$page=-1) {
|
||||
if ($this->_intpl)
|
||||
$this->Error('Setting links in templates aren\'t possible!');
|
||||
parent::SetLink($link,$y,$page);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method that writes the form xobjects
|
||||
*/
|
||||
function _putformxobjects() {
|
||||
$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||
reset($this->tpls);
|
||||
foreach($this->tpls AS $tplidx => $tpl) {
|
||||
|
||||
$p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
|
||||
$this->_newobj();
|
||||
$this->tpls[$tplidx]['n'] = $this->n;
|
||||
$this->_out('<<'.$filter.'/Type /XObject');
|
||||
$this->_out('/Subtype /Form');
|
||||
$this->_out('/FormType 1');
|
||||
$this->_out(sprintf('/BBox [%.2f %.2f %.2f %.2f]',$tpl['x']*$this->k, ($tpl['h']-$tpl['y'])*$this->k, $tpl['w']*$this->k, ($tpl['h']-$tpl['y']-$tpl['h'])*$this->k));
|
||||
$this->_out('/Resources ');
|
||||
|
||||
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
|
||||
if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
|
||||
$this->_out('/Font <<');
|
||||
foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
|
||||
$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
|
||||
$this->_out('>>');
|
||||
}
|
||||
if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
|
||||
isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))
|
||||
{
|
||||
$this->_out('/XObject <<');
|
||||
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['images'] as $image)
|
||||
$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
|
||||
}
|
||||
if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
|
||||
$this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
$this->_out('>>');
|
||||
|
||||
$this->_out('/Length '.strlen($p).' >>');
|
||||
$this->_putstream($p);
|
||||
$this->_out('endobj');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method
|
||||
*/
|
||||
function _putresources() {
|
||||
$this->_putfonts();
|
||||
$this->_putimages();
|
||||
$this->_putformxobjects();
|
||||
//Resource dictionary
|
||||
$this->offsets[2]=strlen($this->buffer);
|
||||
$this->_out('2 0 obj');
|
||||
$this->_out('<<');
|
||||
$this->_putresourcedict();
|
||||
$this->_out('>>');
|
||||
$this->_out('endobj');
|
||||
}
|
||||
|
||||
function _putxobjectdict() {
|
||||
parent::_putxobjectdict();
|
||||
|
||||
if (count($this->tpls)) {
|
||||
foreach($this->tpls as $tplidx => $tpl) {
|
||||
$this->_out($this->tplprefix.$tplidx.' '.$tpl['n'].' 0 R');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method
|
||||
*/
|
||||
function _out($s) {
|
||||
//Add a line to the document
|
||||
if ($this->state==2) {
|
||||
if (!$this->_intpl)
|
||||
$this->pages[$this->page].=$s."\n";
|
||||
else
|
||||
$this->tpls[$this->tpl]['buffer'] .= $s."\n";
|
||||
} else {
|
||||
$this->buffer.=$s."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,466 +1,466 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
define('FPDI_VERSION','1.2');
|
||||
|
||||
ini_set('auto_detect_line_endings',1); // Strongly required!
|
||||
|
||||
require_once("fpdf_tpl.php");
|
||||
require_once("fpdi_pdf_parser.php");
|
||||
|
||||
|
||||
class FPDI extends FPDF_TPL {
|
||||
/**
|
||||
* Actual filename
|
||||
* @var string
|
||||
*/
|
||||
var $current_filename;
|
||||
|
||||
/**
|
||||
* Parser-Objects
|
||||
* @var array
|
||||
*/
|
||||
var $parsers;
|
||||
|
||||
/**
|
||||
* Current parser
|
||||
* @var object
|
||||
*/
|
||||
var $current_parser;
|
||||
|
||||
/**
|
||||
* Highest version of imported PDF
|
||||
* @var double
|
||||
*/
|
||||
var $importVersion = 1.3;
|
||||
|
||||
/**
|
||||
* object stack
|
||||
* @var array
|
||||
*/
|
||||
var $_obj_stack;
|
||||
|
||||
/**
|
||||
* done object stack
|
||||
* @var array
|
||||
*/
|
||||
var $_don_obj_stack;
|
||||
|
||||
/**
|
||||
* Current Object Id.
|
||||
* @var integer
|
||||
*/
|
||||
var $_current_obj_id;
|
||||
|
||||
/**
|
||||
* The name of the last imported page box
|
||||
* @var string
|
||||
*/
|
||||
var $lastUsedPageBox;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* See FPDF-Manual
|
||||
*/
|
||||
function FPDI($orientation='P',$unit='mm',$format='A4') {
|
||||
parent::FPDF_TPL($orientation,$unit,$format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a source-file
|
||||
*
|
||||
* @param string $filename a valid filename
|
||||
* @return int number of available pages
|
||||
*/
|
||||
function setSourceFile($filename) {
|
||||
$this->current_filename = $filename;
|
||||
$fn =& $this->current_filename;
|
||||
|
||||
if (!isset($this->parsers[$fn]))
|
||||
$this->parsers[$fn] =& new fpdi_pdf_parser($fn,$this);
|
||||
$this->current_parser =& $this->parsers[$fn];
|
||||
|
||||
return $this->parsers[$fn]->getPageCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a page
|
||||
*
|
||||
* @param int $pageno pagenumber
|
||||
* @return int Index of imported page - to use with fpdf_tpl::useTemplate()
|
||||
*/
|
||||
function importPage($pageno, $boxName='/CropBox') {
|
||||
if ($this->_intpl) {
|
||||
return $this->error("Please import the desired pages before creating a new template.");
|
||||
}
|
||||
|
||||
$fn =& $this->current_filename;
|
||||
|
||||
$parser =& $this->parsers[$fn];
|
||||
$parser->setPageno($pageno);
|
||||
|
||||
$this->tpl++;
|
||||
$this->tpls[$this->tpl] = array();
|
||||
$tpl =& $this->tpls[$this->tpl];
|
||||
$tpl['parser'] =& $parser;
|
||||
$tpl['resources'] = $parser->getPageResources();
|
||||
$tpl['buffer'] = $parser->getContent();
|
||||
|
||||
if (!in_array($boxName, $parser->availableBoxes))
|
||||
return $this->Error(sprintf("Unknown box: %s", $boxName));
|
||||
$pageboxes = $parser->getPageBoxes($pageno);
|
||||
|
||||
/**
|
||||
* MediaBox
|
||||
* CropBox: Default -> MediaBox
|
||||
* BleedBox: Default -> CropBox
|
||||
* TrimBox: Default -> CropBox
|
||||
* ArtBox: Default -> CropBox
|
||||
*/
|
||||
if (!isset($pageboxes[$boxName]) && ($boxName == "/BleedBox" || $boxName == "/TrimBox" || $boxName == "/ArtBox"))
|
||||
$boxName = "/CropBox";
|
||||
if (!isset($pageboxes[$boxName]) && $boxName == "/CropBox")
|
||||
$boxName = "/MediaBox";
|
||||
|
||||
if (!isset($pageboxes[$boxName]))
|
||||
return false;
|
||||
$this->lastUsedPageBox = $boxName;
|
||||
|
||||
$box = $pageboxes[$boxName];
|
||||
$tpl['box'] = $box;
|
||||
|
||||
// To build an array that can be used by PDF_TPL::useTemplate()
|
||||
$this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl],$box);
|
||||
// An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects()
|
||||
$tpl['x'] = 0;
|
||||
$tpl['y'] = 0;
|
||||
|
||||
$page =& $parser->pages[$parser->pageno];
|
||||
|
||||
// fix for rotated pages
|
||||
$rotation = $parser->getPageRotation($pageno);
|
||||
if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
|
||||
$steps = $angle / 90;
|
||||
|
||||
$_w = $tpl['w'];
|
||||
$_h = $tpl['h'];
|
||||
$tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
|
||||
$tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
|
||||
|
||||
if ($steps % 2 != 0) {
|
||||
$x = $y = ($steps == 1 || $steps == -3) ? $tpl['h'] : $tpl['w'];
|
||||
} else {
|
||||
$x = $tpl['w'];
|
||||
$y = $tpl['h'];
|
||||
}
|
||||
|
||||
$cx=($x/2+$tpl['box']['x'])*$this->k;
|
||||
$cy=($y/2+$tpl['box']['y'])*$this->k;
|
||||
|
||||
$angle*=-1;
|
||||
|
||||
$angle*=M_PI/180;
|
||||
$c=cos($angle);
|
||||
$s=sin($angle);
|
||||
|
||||
$tpl['buffer'] = sprintf('q %.5f %.5f %.5f %.5f %.2f %.2f cm 1 0 0 1 %.2f %.2f cm %s Q',$c,$s,-$s,$c,$cx,$cy,-$cx,-$cy, $tpl['buffer']);
|
||||
}
|
||||
|
||||
return $this->tpl;
|
||||
}
|
||||
|
||||
function getLastUsedPageBox() {
|
||||
return $this->lastUsedPageBox;
|
||||
}
|
||||
|
||||
function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) {
|
||||
$this->_out('q 0 J 1 w 0 j 0 G'); // reset standard values
|
||||
$s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h);
|
||||
$this->_out('Q');
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Private method, that rebuilds all needed objects of source files
|
||||
*/
|
||||
function _putimportedobjects() {
|
||||
if (is_array($this->parsers) && count($this->parsers) > 0) {
|
||||
foreach($this->parsers AS $filename => $p) {
|
||||
$this->current_parser =& $this->parsers[$filename];
|
||||
if (is_array($this->_obj_stack[$filename])) {
|
||||
while($n = key($this->_obj_stack[$filename])) {
|
||||
$nObj = $this->current_parser->pdf_resolve_object($this->current_parser->c,$this->_obj_stack[$filename][$n][1]);
|
||||
|
||||
$this->_newobj($this->_obj_stack[$filename][$n][0]);
|
||||
|
||||
if ($nObj[0] == PDF_TYPE_STREAM) {
|
||||
$this->pdf_write_value ($nObj);
|
||||
} else {
|
||||
$this->pdf_write_value ($nObj[1]);
|
||||
}
|
||||
|
||||
$this->_out('endobj');
|
||||
$this->_obj_stack[$filename][$n] = null; // free memory
|
||||
unset($this->_obj_stack[$filename][$n]);
|
||||
reset($this->_obj_stack[$filename]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PDF Version to the highest of imported documents
|
||||
*/
|
||||
function setVersion() {
|
||||
$this->PDFVersion = max($this->importVersion, $this->PDFVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put resources
|
||||
*/
|
||||
function _putresources() {
|
||||
$this->_putfonts();
|
||||
$this->_putimages();
|
||||
$this->_putformxobjects();
|
||||
$this->_putimportedobjects();
|
||||
//Resource dictionary
|
||||
$this->offsets[2]=strlen($this->buffer);
|
||||
$this->_out('2 0 obj');
|
||||
$this->_out('<<');
|
||||
$this->_putresourcedict();
|
||||
$this->_out('>>');
|
||||
$this->_out('endobj');
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method that writes the form xobjects
|
||||
*/
|
||||
function _putformxobjects() {
|
||||
$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||
reset($this->tpls);
|
||||
foreach($this->tpls AS $tplidx => $tpl) {
|
||||
$p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
|
||||
$this->_newobj();
|
||||
$this->tpls[$tplidx]['n'] = $this->n;
|
||||
$this->_out('<<'.$filter.'/Type /XObject');
|
||||
$this->_out('/Subtype /Form');
|
||||
$this->_out('/FormType 1');
|
||||
|
||||
$this->_out(sprintf('/BBox [%.2f %.2f %.2f %.2f]',
|
||||
($tpl['x'] + (isset($tpl['box']['x'])?$tpl['box']['x']:0))*$this->k,
|
||||
($tpl['h'] + (isset($tpl['box']['y'])?$tpl['box']['y']:0) - $tpl['y'])*$this->k,
|
||||
($tpl['w'] + (isset($tpl['box']['x'])?$tpl['box']['x']:0))*$this->k,
|
||||
($tpl['h'] + (isset($tpl['box']['y'])?$tpl['box']['y']:0) - $tpl['y']-$tpl['h'])*$this->k)
|
||||
);
|
||||
|
||||
if (isset($tpl['box']))
|
||||
$this->_out(sprintf('/Matrix [1 0 0 1 %.5f %.5f]',-$tpl['box']['x']*$this->k, -$tpl['box']['y']*$this->k));
|
||||
|
||||
$this->_out('/Resources ');
|
||||
|
||||
if (isset($tpl['resources'])) {
|
||||
$this->current_parser =& $tpl['parser'];
|
||||
$this->pdf_write_value($tpl['resources']);
|
||||
} else {
|
||||
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
|
||||
if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
|
||||
$this->_out('/Font <<');
|
||||
foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
|
||||
$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
|
||||
$this->_out('>>');
|
||||
}
|
||||
if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
|
||||
isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))
|
||||
{
|
||||
$this->_out('/XObject <<');
|
||||
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['images'] as $image)
|
||||
$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
|
||||
}
|
||||
if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
|
||||
$this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
|
||||
$this->_out('/Length '.strlen($p).' >>');
|
||||
$this->_putstream($p);
|
||||
$this->_out('endobj');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rewritten to handle existing own defined objects
|
||||
*/
|
||||
function _newobj($obj_id=false,$onlynewobj=false) {
|
||||
if (!$obj_id) {
|
||||
$obj_id = ++$this->n;
|
||||
}
|
||||
|
||||
//Begin a new object
|
||||
if (!$onlynewobj) {
|
||||
$this->offsets[$obj_id] = strlen($this->buffer);
|
||||
$this->_out($obj_id.' 0 obj');
|
||||
$this->_current_obj_id = $obj_id; // for later use with encryption
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a value
|
||||
* Needed to rebuild the source document
|
||||
*
|
||||
* @param mixed $value A PDF-Value. Structure of values see cases in this method
|
||||
*/
|
||||
function pdf_write_value(&$value)
|
||||
{
|
||||
|
||||
switch ($value[0]) {
|
||||
|
||||
case PDF_TYPE_NUMERIC :
|
||||
case PDF_TYPE_TOKEN :
|
||||
// A numeric value or a token.
|
||||
// Simply output them
|
||||
$this->_out($value[1]." ", false);
|
||||
break;
|
||||
|
||||
case PDF_TYPE_ARRAY :
|
||||
|
||||
// An array. Output the proper
|
||||
// structure and move on.
|
||||
|
||||
$this->_out("[",false);
|
||||
for ($i = 0; $i < count($value[1]); $i++) {
|
||||
$this->pdf_write_value($value[1][$i]);
|
||||
}
|
||||
|
||||
$this->_out("]");
|
||||
break;
|
||||
|
||||
case PDF_TYPE_DICTIONARY :
|
||||
|
||||
// A dictionary.
|
||||
$this->_out("<<",false);
|
||||
|
||||
reset ($value[1]);
|
||||
|
||||
while (list($k, $v) = each($value[1])) {
|
||||
$this->_out($k . " ",false);
|
||||
$this->pdf_write_value($v);
|
||||
}
|
||||
|
||||
$this->_out(">>");
|
||||
break;
|
||||
|
||||
case PDF_TYPE_OBJREF :
|
||||
|
||||
// An indirect object reference
|
||||
// Fill the object stack if needed
|
||||
$cpfn =& $this->current_parser->filename;
|
||||
if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) {
|
||||
$this->_newobj(false,true);
|
||||
$this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value);
|
||||
$this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value);
|
||||
}
|
||||
$objid = $this->_don_obj_stack[$cpfn][$value[1]][0];
|
||||
|
||||
$this->_out("{$objid} 0 R"); //{$value[2]}
|
||||
break;
|
||||
|
||||
case PDF_TYPE_STRING :
|
||||
|
||||
// A string.
|
||||
$this->_out('('.$value[1].')');
|
||||
|
||||
break;
|
||||
|
||||
case PDF_TYPE_STREAM :
|
||||
|
||||
// A stream. First, output the
|
||||
// stream dictionary, then the
|
||||
// stream data itself.
|
||||
$this->pdf_write_value($value[1]);
|
||||
$this->_out("stream");
|
||||
$this->_out($value[2][1]);
|
||||
$this->_out("endstream");
|
||||
break;
|
||||
case PDF_TYPE_HEX :
|
||||
|
||||
$this->_out("<".$value[1].">");
|
||||
break;
|
||||
|
||||
case PDF_TYPE_NULL :
|
||||
// The null object.
|
||||
|
||||
$this->_out("null");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Private Method
|
||||
*/
|
||||
function _out($s,$ln=true) {
|
||||
//Add a line to the document
|
||||
if ($this->state==2) {
|
||||
if (!$this->_intpl)
|
||||
$this->pages[$this->page] .= $s.($ln == true ? "\n" : '');
|
||||
else
|
||||
$this->tpls[$this->tpl]['buffer'] .= $s.($ln == true ? "\n" : '');
|
||||
} else {
|
||||
$this->buffer.=$s.($ln == true ? "\n" : '');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rewritten to close opened parsers
|
||||
*
|
||||
*/
|
||||
function _enddoc() {
|
||||
parent::_enddoc();
|
||||
$this->_closeParsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* close all files opened by parsers
|
||||
*/
|
||||
function _closeParsers() {
|
||||
if ($this->state > 2 && count($this->parsers) > 0) {
|
||||
foreach ($this->parsers as $k => $_){
|
||||
$this->parsers[$k]->closeFile();
|
||||
$this->parsers[$k] = null;
|
||||
unset($this->parsers[$k]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// for PHP5
|
||||
if (!class_exists('fpdi')) {
|
||||
class fpdi extends FPDI {}
|
||||
}
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
define('FPDI_VERSION','1.2');
|
||||
|
||||
ini_set('auto_detect_line_endings',1); // Strongly required!
|
||||
|
||||
require_once("fpdf_tpl.php");
|
||||
require_once("fpdi_pdf_parser.php");
|
||||
|
||||
|
||||
class FPDI extends FPDF_TPL {
|
||||
/**
|
||||
* Actual filename
|
||||
* @var string
|
||||
*/
|
||||
var $current_filename;
|
||||
|
||||
/**
|
||||
* Parser-Objects
|
||||
* @var array
|
||||
*/
|
||||
var $parsers;
|
||||
|
||||
/**
|
||||
* Current parser
|
||||
* @var object
|
||||
*/
|
||||
var $current_parser;
|
||||
|
||||
/**
|
||||
* Highest version of imported PDF
|
||||
* @var double
|
||||
*/
|
||||
var $importVersion = 1.3;
|
||||
|
||||
/**
|
||||
* object stack
|
||||
* @var array
|
||||
*/
|
||||
var $_obj_stack;
|
||||
|
||||
/**
|
||||
* done object stack
|
||||
* @var array
|
||||
*/
|
||||
var $_don_obj_stack;
|
||||
|
||||
/**
|
||||
* Current Object Id.
|
||||
* @var integer
|
||||
*/
|
||||
var $_current_obj_id;
|
||||
|
||||
/**
|
||||
* The name of the last imported page box
|
||||
* @var string
|
||||
*/
|
||||
var $lastUsedPageBox;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* See FPDF-Manual
|
||||
*/
|
||||
function FPDI($orientation='P',$unit='mm',$format='A4') {
|
||||
parent::FPDF_TPL($orientation,$unit,$format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a source-file
|
||||
*
|
||||
* @param string $filename a valid filename
|
||||
* @return int number of available pages
|
||||
*/
|
||||
function setSourceFile($filename) {
|
||||
$this->current_filename = $filename;
|
||||
$fn =& $this->current_filename;
|
||||
|
||||
if (!isset($this->parsers[$fn]))
|
||||
$this->parsers[$fn] =& new fpdi_pdf_parser($fn,$this);
|
||||
$this->current_parser =& $this->parsers[$fn];
|
||||
|
||||
return $this->parsers[$fn]->getPageCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a page
|
||||
*
|
||||
* @param int $pageno pagenumber
|
||||
* @return int Index of imported page - to use with fpdf_tpl::useTemplate()
|
||||
*/
|
||||
function importPage($pageno, $boxName='/CropBox') {
|
||||
if ($this->_intpl) {
|
||||
return $this->error("Please import the desired pages before creating a new template.");
|
||||
}
|
||||
|
||||
$fn =& $this->current_filename;
|
||||
|
||||
$parser =& $this->parsers[$fn];
|
||||
$parser->setPageno($pageno);
|
||||
|
||||
$this->tpl++;
|
||||
$this->tpls[$this->tpl] = array();
|
||||
$tpl =& $this->tpls[$this->tpl];
|
||||
$tpl['parser'] =& $parser;
|
||||
$tpl['resources'] = $parser->getPageResources();
|
||||
$tpl['buffer'] = $parser->getContent();
|
||||
|
||||
if (!in_array($boxName, $parser->availableBoxes))
|
||||
return $this->Error(sprintf("Unknown box: %s", $boxName));
|
||||
$pageboxes = $parser->getPageBoxes($pageno);
|
||||
|
||||
/**
|
||||
* MediaBox
|
||||
* CropBox: Default -> MediaBox
|
||||
* BleedBox: Default -> CropBox
|
||||
* TrimBox: Default -> CropBox
|
||||
* ArtBox: Default -> CropBox
|
||||
*/
|
||||
if (!isset($pageboxes[$boxName]) && ($boxName == "/BleedBox" || $boxName == "/TrimBox" || $boxName == "/ArtBox"))
|
||||
$boxName = "/CropBox";
|
||||
if (!isset($pageboxes[$boxName]) && $boxName == "/CropBox")
|
||||
$boxName = "/MediaBox";
|
||||
|
||||
if (!isset($pageboxes[$boxName]))
|
||||
return false;
|
||||
$this->lastUsedPageBox = $boxName;
|
||||
|
||||
$box = $pageboxes[$boxName];
|
||||
$tpl['box'] = $box;
|
||||
|
||||
// To build an array that can be used by PDF_TPL::useTemplate()
|
||||
$this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl],$box);
|
||||
// An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects()
|
||||
$tpl['x'] = 0;
|
||||
$tpl['y'] = 0;
|
||||
|
||||
$page =& $parser->pages[$parser->pageno];
|
||||
|
||||
// fix for rotated pages
|
||||
$rotation = $parser->getPageRotation($pageno);
|
||||
if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
|
||||
$steps = $angle / 90;
|
||||
|
||||
$_w = $tpl['w'];
|
||||
$_h = $tpl['h'];
|
||||
$tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
|
||||
$tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
|
||||
|
||||
if ($steps % 2 != 0) {
|
||||
$x = $y = ($steps == 1 || $steps == -3) ? $tpl['h'] : $tpl['w'];
|
||||
} else {
|
||||
$x = $tpl['w'];
|
||||
$y = $tpl['h'];
|
||||
}
|
||||
|
||||
$cx=($x/2+$tpl['box']['x'])*$this->k;
|
||||
$cy=($y/2+$tpl['box']['y'])*$this->k;
|
||||
|
||||
$angle*=-1;
|
||||
|
||||
$angle*=M_PI/180;
|
||||
$c=cos($angle);
|
||||
$s=sin($angle);
|
||||
|
||||
$tpl['buffer'] = sprintf('q %.5f %.5f %.5f %.5f %.2f %.2f cm 1 0 0 1 %.2f %.2f cm %s Q',$c,$s,-$s,$c,$cx,$cy,-$cx,-$cy, $tpl['buffer']);
|
||||
}
|
||||
|
||||
return $this->tpl;
|
||||
}
|
||||
|
||||
function getLastUsedPageBox() {
|
||||
return $this->lastUsedPageBox;
|
||||
}
|
||||
|
||||
function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) {
|
||||
$this->_out('q 0 J 1 w 0 j 0 G'); // reset standard values
|
||||
$s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h);
|
||||
$this->_out('Q');
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Private method, that rebuilds all needed objects of source files
|
||||
*/
|
||||
function _putimportedobjects() {
|
||||
if (is_array($this->parsers) && count($this->parsers) > 0) {
|
||||
foreach($this->parsers AS $filename => $p) {
|
||||
$this->current_parser =& $this->parsers[$filename];
|
||||
if (is_array($this->_obj_stack[$filename])) {
|
||||
while($n = key($this->_obj_stack[$filename])) {
|
||||
$nObj = $this->current_parser->pdf_resolve_object($this->current_parser->c,$this->_obj_stack[$filename][$n][1]);
|
||||
|
||||
$this->_newobj($this->_obj_stack[$filename][$n][0]);
|
||||
|
||||
if ($nObj[0] == PDF_TYPE_STREAM) {
|
||||
$this->pdf_write_value ($nObj);
|
||||
} else {
|
||||
$this->pdf_write_value ($nObj[1]);
|
||||
}
|
||||
|
||||
$this->_out('endobj');
|
||||
$this->_obj_stack[$filename][$n] = null; // free memory
|
||||
unset($this->_obj_stack[$filename][$n]);
|
||||
reset($this->_obj_stack[$filename]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PDF Version to the highest of imported documents
|
||||
*/
|
||||
function setVersion() {
|
||||
$this->PDFVersion = max($this->importVersion, $this->PDFVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put resources
|
||||
*/
|
||||
function _putresources() {
|
||||
$this->_putfonts();
|
||||
$this->_putimages();
|
||||
$this->_putformxobjects();
|
||||
$this->_putimportedobjects();
|
||||
//Resource dictionary
|
||||
$this->offsets[2]=strlen($this->buffer);
|
||||
$this->_out('2 0 obj');
|
||||
$this->_out('<<');
|
||||
$this->_putresourcedict();
|
||||
$this->_out('>>');
|
||||
$this->_out('endobj');
|
||||
}
|
||||
|
||||
/**
|
||||
* Private Method that writes the form xobjects
|
||||
*/
|
||||
function _putformxobjects() {
|
||||
$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||
reset($this->tpls);
|
||||
foreach($this->tpls AS $tplidx => $tpl) {
|
||||
$p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
|
||||
$this->_newobj();
|
||||
$this->tpls[$tplidx]['n'] = $this->n;
|
||||
$this->_out('<<'.$filter.'/Type /XObject');
|
||||
$this->_out('/Subtype /Form');
|
||||
$this->_out('/FormType 1');
|
||||
|
||||
$this->_out(sprintf('/BBox [%.2f %.2f %.2f %.2f]',
|
||||
($tpl['x'] + (isset($tpl['box']['x'])?$tpl['box']['x']:0))*$this->k,
|
||||
($tpl['h'] + (isset($tpl['box']['y'])?$tpl['box']['y']:0) - $tpl['y'])*$this->k,
|
||||
($tpl['w'] + (isset($tpl['box']['x'])?$tpl['box']['x']:0))*$this->k,
|
||||
($tpl['h'] + (isset($tpl['box']['y'])?$tpl['box']['y']:0) - $tpl['y']-$tpl['h'])*$this->k)
|
||||
);
|
||||
|
||||
if (isset($tpl['box']))
|
||||
$this->_out(sprintf('/Matrix [1 0 0 1 %.5f %.5f]',-$tpl['box']['x']*$this->k, -$tpl['box']['y']*$this->k));
|
||||
|
||||
$this->_out('/Resources ');
|
||||
|
||||
if (isset($tpl['resources'])) {
|
||||
$this->current_parser =& $tpl['parser'];
|
||||
$this->pdf_write_value($tpl['resources']);
|
||||
} else {
|
||||
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
|
||||
if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
|
||||
$this->_out('/Font <<');
|
||||
foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
|
||||
$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
|
||||
$this->_out('>>');
|
||||
}
|
||||
if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
|
||||
isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))
|
||||
{
|
||||
$this->_out('/XObject <<');
|
||||
if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['images'] as $image)
|
||||
$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
|
||||
}
|
||||
if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
|
||||
foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
|
||||
$this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
|
||||
$this->_out('/Length '.strlen($p).' >>');
|
||||
$this->_putstream($p);
|
||||
$this->_out('endobj');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rewritten to handle existing own defined objects
|
||||
*/
|
||||
function _newobj($obj_id=false,$onlynewobj=false) {
|
||||
if (!$obj_id) {
|
||||
$obj_id = ++$this->n;
|
||||
}
|
||||
|
||||
//Begin a new object
|
||||
if (!$onlynewobj) {
|
||||
$this->offsets[$obj_id] = strlen($this->buffer);
|
||||
$this->_out($obj_id.' 0 obj');
|
||||
$this->_current_obj_id = $obj_id; // for later use with encryption
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a value
|
||||
* Needed to rebuild the source document
|
||||
*
|
||||
* @param mixed $value A PDF-Value. Structure of values see cases in this method
|
||||
*/
|
||||
function pdf_write_value(&$value)
|
||||
{
|
||||
|
||||
switch ($value[0]) {
|
||||
|
||||
case PDF_TYPE_NUMERIC :
|
||||
case PDF_TYPE_TOKEN :
|
||||
// A numeric value or a token.
|
||||
// Simply output them
|
||||
$this->_out($value[1]." ", false);
|
||||
break;
|
||||
|
||||
case PDF_TYPE_ARRAY :
|
||||
|
||||
// An array. Output the proper
|
||||
// structure and move on.
|
||||
|
||||
$this->_out("[",false);
|
||||
for ($i = 0; $i < count($value[1]); $i++) {
|
||||
$this->pdf_write_value($value[1][$i]);
|
||||
}
|
||||
|
||||
$this->_out("]");
|
||||
break;
|
||||
|
||||
case PDF_TYPE_DICTIONARY :
|
||||
|
||||
// A dictionary.
|
||||
$this->_out("<<",false);
|
||||
|
||||
reset ($value[1]);
|
||||
|
||||
while (list($k, $v) = each($value[1])) {
|
||||
$this->_out($k . " ",false);
|
||||
$this->pdf_write_value($v);
|
||||
}
|
||||
|
||||
$this->_out(">>");
|
||||
break;
|
||||
|
||||
case PDF_TYPE_OBJREF :
|
||||
|
||||
// An indirect object reference
|
||||
// Fill the object stack if needed
|
||||
$cpfn =& $this->current_parser->filename;
|
||||
if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) {
|
||||
$this->_newobj(false,true);
|
||||
$this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value);
|
||||
$this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value);
|
||||
}
|
||||
$objid = $this->_don_obj_stack[$cpfn][$value[1]][0];
|
||||
|
||||
$this->_out("{$objid} 0 R"); //{$value[2]}
|
||||
break;
|
||||
|
||||
case PDF_TYPE_STRING :
|
||||
|
||||
// A string.
|
||||
$this->_out('('.$value[1].')');
|
||||
|
||||
break;
|
||||
|
||||
case PDF_TYPE_STREAM :
|
||||
|
||||
// A stream. First, output the
|
||||
// stream dictionary, then the
|
||||
// stream data itself.
|
||||
$this->pdf_write_value($value[1]);
|
||||
$this->_out("stream");
|
||||
$this->_out($value[2][1]);
|
||||
$this->_out("endstream");
|
||||
break;
|
||||
case PDF_TYPE_HEX :
|
||||
|
||||
$this->_out("<".$value[1].">");
|
||||
break;
|
||||
|
||||
case PDF_TYPE_NULL :
|
||||
// The null object.
|
||||
|
||||
$this->_out("null");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Private Method
|
||||
*/
|
||||
function _out($s,$ln=true) {
|
||||
//Add a line to the document
|
||||
if ($this->state==2) {
|
||||
if (!$this->_intpl)
|
||||
$this->pages[$this->page] .= $s.($ln == true ? "\n" : '');
|
||||
else
|
||||
$this->tpls[$this->tpl]['buffer'] .= $s.($ln == true ? "\n" : '');
|
||||
} else {
|
||||
$this->buffer.=$s.($ln == true ? "\n" : '');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rewritten to close opened parsers
|
||||
*
|
||||
*/
|
||||
function _enddoc() {
|
||||
parent::_enddoc();
|
||||
$this->_closeParsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* close all files opened by parsers
|
||||
*/
|
||||
function _closeParsers() {
|
||||
if ($this->state > 2 && count($this->parsers) > 0) {
|
||||
foreach ($this->parsers as $k => $_){
|
||||
$this->parsers[$k]->closeFile();
|
||||
$this->parsers[$k] = null;
|
||||
unset($this->parsers[$k]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// for PHP5
|
||||
if (!class_exists('fpdi')) {
|
||||
class fpdi extends FPDI {}
|
||||
}
|
||||
?>
|
||||
@ -1,379 +1,379 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once("pdf_parser.php");
|
||||
|
||||
class fpdi_pdf_parser extends pdf_parser {
|
||||
|
||||
/**
|
||||
* Pages
|
||||
* Index beginns at 0
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $pages;
|
||||
|
||||
/**
|
||||
* Page count
|
||||
* @var integer
|
||||
*/
|
||||
var $page_count;
|
||||
|
||||
/**
|
||||
* actual page number
|
||||
* @var integer
|
||||
*/
|
||||
var $pageno;
|
||||
|
||||
/**
|
||||
* PDF Version of imported Document
|
||||
* @var string
|
||||
*/
|
||||
var $pdfVersion;
|
||||
|
||||
/**
|
||||
* FPDI Reference
|
||||
* @var object
|
||||
*/
|
||||
var $fpdi;
|
||||
|
||||
/**
|
||||
* Available BoxTypes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $availableBoxes = array("/MediaBox","/CropBox","/BleedBox","/TrimBox","/ArtBox");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $filename Source-Filename
|
||||
* @param object $fpdi Object of type fpdi
|
||||
*/
|
||||
function fpdi_pdf_parser($filename,&$fpdi) {
|
||||
$this->fpdi =& $fpdi;
|
||||
$this->filename = $filename;
|
||||
|
||||
parent::pdf_parser($filename);
|
||||
|
||||
// resolve Pages-Dictonary
|
||||
$pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']);
|
||||
|
||||
// Read pages
|
||||
$this->read_pages($this->c, $pages, $this->pages);
|
||||
|
||||
// count pages;
|
||||
$this->page_count = count($this->pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite parent::error()
|
||||
*
|
||||
* @param string $msg Error-Message
|
||||
*/
|
||||
function error($msg) {
|
||||
$this->fpdi->error($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pagecount from sourcefile
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getPageCount() {
|
||||
return $this->page_count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set pageno
|
||||
*
|
||||
* @param int $pageno Pagenumber to use
|
||||
*/
|
||||
function setPageno($pageno) {
|
||||
$pageno = ((int) $pageno) - 1;
|
||||
|
||||
if ($pageno < 0 || $pageno >= $this->getPageCount()) {
|
||||
$this->fpdi->error("Pagenumber is wrong!");
|
||||
}
|
||||
|
||||
$this->pageno = $pageno;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page-resources from current page
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPageResources() {
|
||||
return $this->_getPageResources($this->pages[$this->pageno]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page-resources from /Page
|
||||
*
|
||||
* @param array $obj Array of pdf-data
|
||||
*/
|
||||
function _getPageResources ($obj) { // $obj = /Page
|
||||
$obj = $this->pdf_resolve_object($this->c, $obj);
|
||||
|
||||
// If the current object has a resources
|
||||
// dictionary associated with it, we use
|
||||
// it. Otherwise, we move back to its
|
||||
// parent object.
|
||||
if (isset ($obj[1][1]['/Resources'])) {
|
||||
$res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
} else {
|
||||
if (!isset ($obj[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
$res = $this->_getPageResources($obj[1][1]['/Parent']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get content of current page
|
||||
*
|
||||
* If more /Contents is an array, the streams are concated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getContent() {
|
||||
$buffer = "";
|
||||
|
||||
if (isset($this->pages[$this->pageno][1][1]['/Contents'])) {
|
||||
$contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']);
|
||||
foreach($contents AS $tmp_content) {
|
||||
$buffer .= $this->_rebuildContentStream($tmp_content).' ';
|
||||
}
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resolve all content-objects
|
||||
*
|
||||
* @param array $content_ref
|
||||
* @return array
|
||||
*/
|
||||
function _getPageContent($content_ref) {
|
||||
$contents = array();
|
||||
|
||||
if ($content_ref[0] == PDF_TYPE_OBJREF) {
|
||||
$content = $this->pdf_resolve_object($this->c, $content_ref);
|
||||
if ($content[1][0] == PDF_TYPE_ARRAY) {
|
||||
$contents = $this->_getPageContent($content[1]);
|
||||
} else {
|
||||
$contents[] = $content;
|
||||
}
|
||||
} else if ($content_ref[0] == PDF_TYPE_ARRAY) {
|
||||
foreach ($content_ref[1] AS $tmp_content_ref) {
|
||||
$contents = array_merge($contents,$this->_getPageContent($tmp_content_ref));
|
||||
}
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rebuild content-streams
|
||||
*
|
||||
* @param array $obj
|
||||
* @return string
|
||||
*/
|
||||
function _rebuildContentStream($obj) {
|
||||
$filters = array();
|
||||
|
||||
if (isset($obj[1][1]['/Filter'])) {
|
||||
$_filter = $obj[1][1]['/Filter'];
|
||||
|
||||
if ($_filter[0] == PDF_TYPE_TOKEN) {
|
||||
$filters[] = $_filter;
|
||||
} else if ($_filter[0] == PDF_TYPE_ARRAY) {
|
||||
$filters = $_filter[1];
|
||||
}
|
||||
}
|
||||
|
||||
$stream = $obj[2][1];
|
||||
|
||||
foreach ($filters AS $_filter) {
|
||||
switch ($_filter[1]) {
|
||||
case "/FlateDecode":
|
||||
if (function_exists('gzuncompress')) {
|
||||
$stream = (strlen($stream) > 0) ? @gzuncompress($stream) : '';
|
||||
} else {
|
||||
$this->fpdi->error(sprintf("To handle %s filter, please compile php with zlib support.",$_filter[1]));
|
||||
}
|
||||
if ($stream === false) {
|
||||
$this->fpdi->error("Error while decompressing stream.");
|
||||
}
|
||||
break;
|
||||
case null:
|
||||
$stream = $stream;
|
||||
break;
|
||||
default:
|
||||
if (preg_match("/^\/[a-z85]*$/i", $_filter[1], $filterName) && @include_once('decoders'.$_filter[1].'.php')) {
|
||||
$filterName = substr($_filter[1],1);
|
||||
if (class_exists($filterName)) {
|
||||
$decoder =& new $filterName($this->fpdi);
|
||||
$stream = $decoder->decode(trim($stream));
|
||||
} else {
|
||||
$this->fpdi->error(sprintf("Unsupported Filter: %s",$_filter[1]));
|
||||
}
|
||||
} else {
|
||||
$this->fpdi->error(sprintf("Unsupported Filter: %s",$_filter[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $stream;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Box from a page
|
||||
* Arrayformat is same as used by fpdf_tpl
|
||||
*
|
||||
* @param array $page a /Page
|
||||
* @param string $box_index Type of Box @see $availableBoxes
|
||||
* @return array
|
||||
*/
|
||||
function getPageBox($page, $box_index) {
|
||||
$page = $this->pdf_resolve_object($this->c,$page);
|
||||
$box = null;
|
||||
if (isset($page[1][1][$box_index]))
|
||||
$box =& $page[1][1][$box_index];
|
||||
|
||||
if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) {
|
||||
$tmp_box = $this->pdf_resolve_object($this->c,$box);
|
||||
$box = $tmp_box[1];
|
||||
}
|
||||
|
||||
if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) {
|
||||
$b =& $box[1];
|
||||
return array("x" => $b[0][1]/$this->fpdi->k,
|
||||
"y" => $b[1][1]/$this->fpdi->k,
|
||||
"w" => abs($b[0][1]-$b[2][1])/$this->fpdi->k,
|
||||
"h" => abs($b[1][1]-$b[3][1])/$this->fpdi->k);
|
||||
} else if (!isset ($page[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
return $this->getPageBox($this->pdf_resolve_object($this->c, $page[1][1]['/Parent']), $box_index);
|
||||
}
|
||||
}
|
||||
|
||||
function getPageBoxes($pageno) {
|
||||
return $this->_getPageBoxes($this->pages[$pageno-1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Boxes from /Page
|
||||
*
|
||||
* @param array a /Page
|
||||
* @return array
|
||||
*/
|
||||
function _getPageBoxes($page) {
|
||||
$boxes = array();
|
||||
|
||||
foreach($this->availableBoxes AS $box) {
|
||||
if ($_box = $this->getPageBox($page,$box)) {
|
||||
$boxes[$box] = $_box;
|
||||
}
|
||||
}
|
||||
|
||||
return $boxes;
|
||||
}
|
||||
|
||||
function getPageRotation($pageno) {
|
||||
return $this->_getPageRotation($this->pages[$pageno-1]);
|
||||
}
|
||||
|
||||
function _getPageRotation ($obj) { // $obj = /Page
|
||||
$obj = $this->pdf_resolve_object($this->c, $obj);
|
||||
if (isset ($obj[1][1]['/Rotate'])) {
|
||||
$res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
} else {
|
||||
if (!isset ($obj[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
$res = $this->_getPageRotation($obj[1][1]['/Parent']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read all /Page(es)
|
||||
*
|
||||
* @param object pdf_context
|
||||
* @param array /Pages
|
||||
* @param array the result-array
|
||||
*/
|
||||
function read_pages (&$c, &$pages, &$result) {
|
||||
// Get the kids dictionary
|
||||
$kids = $this->pdf_resolve_object ($c, $pages[1][1]['/Kids']);
|
||||
|
||||
if (!is_array($kids))
|
||||
$this->fpdi->Error("Cannot find /Kids in current /Page-Dictionary");
|
||||
foreach ($kids[1] as $v) {
|
||||
$pg = $this->pdf_resolve_object ($c, $v);
|
||||
if ($pg[1][1]['/Type'][1] === '/Pages') {
|
||||
// If one of the kids is an embedded
|
||||
// /Pages array, resolve it as well.
|
||||
$this->read_pages ($c, $pg, $result);
|
||||
} else {
|
||||
$result[] = $pg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get PDF-Version
|
||||
*
|
||||
* And reset the PDF Version used in FPDI if needed
|
||||
*/
|
||||
function getPDFVersion() {
|
||||
parent::getPDFVersion();
|
||||
|
||||
if (isset($this->fpdi->importVersion) && $this->pdfVersion > $this->fpdi->importVersion) {
|
||||
$this->fpdi->importVersion = $this->pdfVersion;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once("pdf_parser.php");
|
||||
|
||||
class fpdi_pdf_parser extends pdf_parser {
|
||||
|
||||
/**
|
||||
* Pages
|
||||
* Index beginns at 0
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $pages;
|
||||
|
||||
/**
|
||||
* Page count
|
||||
* @var integer
|
||||
*/
|
||||
var $page_count;
|
||||
|
||||
/**
|
||||
* actual page number
|
||||
* @var integer
|
||||
*/
|
||||
var $pageno;
|
||||
|
||||
/**
|
||||
* PDF Version of imported Document
|
||||
* @var string
|
||||
*/
|
||||
var $pdfVersion;
|
||||
|
||||
/**
|
||||
* FPDI Reference
|
||||
* @var object
|
||||
*/
|
||||
var $fpdi;
|
||||
|
||||
/**
|
||||
* Available BoxTypes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $availableBoxes = array("/MediaBox","/CropBox","/BleedBox","/TrimBox","/ArtBox");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $filename Source-Filename
|
||||
* @param object $fpdi Object of type fpdi
|
||||
*/
|
||||
function fpdi_pdf_parser($filename,&$fpdi) {
|
||||
$this->fpdi =& $fpdi;
|
||||
$this->filename = $filename;
|
||||
|
||||
parent::pdf_parser($filename);
|
||||
|
||||
// resolve Pages-Dictonary
|
||||
$pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']);
|
||||
|
||||
// Read pages
|
||||
$this->read_pages($this->c, $pages, $this->pages);
|
||||
|
||||
// count pages;
|
||||
$this->page_count = count($this->pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite parent::error()
|
||||
*
|
||||
* @param string $msg Error-Message
|
||||
*/
|
||||
function error($msg) {
|
||||
$this->fpdi->error($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pagecount from sourcefile
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getPageCount() {
|
||||
return $this->page_count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set pageno
|
||||
*
|
||||
* @param int $pageno Pagenumber to use
|
||||
*/
|
||||
function setPageno($pageno) {
|
||||
$pageno = ((int) $pageno) - 1;
|
||||
|
||||
if ($pageno < 0 || $pageno >= $this->getPageCount()) {
|
||||
$this->fpdi->error("Pagenumber is wrong!");
|
||||
}
|
||||
|
||||
$this->pageno = $pageno;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page-resources from current page
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPageResources() {
|
||||
return $this->_getPageResources($this->pages[$this->pageno]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page-resources from /Page
|
||||
*
|
||||
* @param array $obj Array of pdf-data
|
||||
*/
|
||||
function _getPageResources ($obj) { // $obj = /Page
|
||||
$obj = $this->pdf_resolve_object($this->c, $obj);
|
||||
|
||||
// If the current object has a resources
|
||||
// dictionary associated with it, we use
|
||||
// it. Otherwise, we move back to its
|
||||
// parent object.
|
||||
if (isset ($obj[1][1]['/Resources'])) {
|
||||
$res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
} else {
|
||||
if (!isset ($obj[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
$res = $this->_getPageResources($obj[1][1]['/Parent']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get content of current page
|
||||
*
|
||||
* If more /Contents is an array, the streams are concated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getContent() {
|
||||
$buffer = "";
|
||||
|
||||
if (isset($this->pages[$this->pageno][1][1]['/Contents'])) {
|
||||
$contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']);
|
||||
foreach($contents AS $tmp_content) {
|
||||
$buffer .= $this->_rebuildContentStream($tmp_content).' ';
|
||||
}
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resolve all content-objects
|
||||
*
|
||||
* @param array $content_ref
|
||||
* @return array
|
||||
*/
|
||||
function _getPageContent($content_ref) {
|
||||
$contents = array();
|
||||
|
||||
if ($content_ref[0] == PDF_TYPE_OBJREF) {
|
||||
$content = $this->pdf_resolve_object($this->c, $content_ref);
|
||||
if ($content[1][0] == PDF_TYPE_ARRAY) {
|
||||
$contents = $this->_getPageContent($content[1]);
|
||||
} else {
|
||||
$contents[] = $content;
|
||||
}
|
||||
} else if ($content_ref[0] == PDF_TYPE_ARRAY) {
|
||||
foreach ($content_ref[1] AS $tmp_content_ref) {
|
||||
$contents = array_merge($contents,$this->_getPageContent($tmp_content_ref));
|
||||
}
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rebuild content-streams
|
||||
*
|
||||
* @param array $obj
|
||||
* @return string
|
||||
*/
|
||||
function _rebuildContentStream($obj) {
|
||||
$filters = array();
|
||||
|
||||
if (isset($obj[1][1]['/Filter'])) {
|
||||
$_filter = $obj[1][1]['/Filter'];
|
||||
|
||||
if ($_filter[0] == PDF_TYPE_TOKEN) {
|
||||
$filters[] = $_filter;
|
||||
} else if ($_filter[0] == PDF_TYPE_ARRAY) {
|
||||
$filters = $_filter[1];
|
||||
}
|
||||
}
|
||||
|
||||
$stream = $obj[2][1];
|
||||
|
||||
foreach ($filters AS $_filter) {
|
||||
switch ($_filter[1]) {
|
||||
case "/FlateDecode":
|
||||
if (function_exists('gzuncompress')) {
|
||||
$stream = (strlen($stream) > 0) ? @gzuncompress($stream) : '';
|
||||
} else {
|
||||
$this->fpdi->error(sprintf("To handle %s filter, please compile php with zlib support.",$_filter[1]));
|
||||
}
|
||||
if ($stream === false) {
|
||||
$this->fpdi->error("Error while decompressing stream.");
|
||||
}
|
||||
break;
|
||||
case null:
|
||||
$stream = $stream;
|
||||
break;
|
||||
default:
|
||||
if (preg_match("/^\/[a-z85]*$/i", $_filter[1], $filterName) && @include_once('decoders'.$_filter[1].'.php')) {
|
||||
$filterName = substr($_filter[1],1);
|
||||
if (class_exists($filterName)) {
|
||||
$decoder =& new $filterName($this->fpdi);
|
||||
$stream = $decoder->decode(trim($stream));
|
||||
} else {
|
||||
$this->fpdi->error(sprintf("Unsupported Filter: %s",$_filter[1]));
|
||||
}
|
||||
} else {
|
||||
$this->fpdi->error(sprintf("Unsupported Filter: %s",$_filter[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $stream;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Box from a page
|
||||
* Arrayformat is same as used by fpdf_tpl
|
||||
*
|
||||
* @param array $page a /Page
|
||||
* @param string $box_index Type of Box @see $availableBoxes
|
||||
* @return array
|
||||
*/
|
||||
function getPageBox($page, $box_index) {
|
||||
$page = $this->pdf_resolve_object($this->c,$page);
|
||||
$box = null;
|
||||
if (isset($page[1][1][$box_index]))
|
||||
$box =& $page[1][1][$box_index];
|
||||
|
||||
if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) {
|
||||
$tmp_box = $this->pdf_resolve_object($this->c,$box);
|
||||
$box = $tmp_box[1];
|
||||
}
|
||||
|
||||
if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) {
|
||||
$b =& $box[1];
|
||||
return array("x" => $b[0][1]/$this->fpdi->k,
|
||||
"y" => $b[1][1]/$this->fpdi->k,
|
||||
"w" => abs($b[0][1]-$b[2][1])/$this->fpdi->k,
|
||||
"h" => abs($b[1][1]-$b[3][1])/$this->fpdi->k);
|
||||
} else if (!isset ($page[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
return $this->getPageBox($this->pdf_resolve_object($this->c, $page[1][1]['/Parent']), $box_index);
|
||||
}
|
||||
}
|
||||
|
||||
function getPageBoxes($pageno) {
|
||||
return $this->_getPageBoxes($this->pages[$pageno-1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Boxes from /Page
|
||||
*
|
||||
* @param array a /Page
|
||||
* @return array
|
||||
*/
|
||||
function _getPageBoxes($page) {
|
||||
$boxes = array();
|
||||
|
||||
foreach($this->availableBoxes AS $box) {
|
||||
if ($_box = $this->getPageBox($page,$box)) {
|
||||
$boxes[$box] = $_box;
|
||||
}
|
||||
}
|
||||
|
||||
return $boxes;
|
||||
}
|
||||
|
||||
function getPageRotation($pageno) {
|
||||
return $this->_getPageRotation($this->pages[$pageno-1]);
|
||||
}
|
||||
|
||||
function _getPageRotation ($obj) { // $obj = /Page
|
||||
$obj = $this->pdf_resolve_object($this->c, $obj);
|
||||
if (isset ($obj[1][1]['/Rotate'])) {
|
||||
$res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
} else {
|
||||
if (!isset ($obj[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
$res = $this->_getPageRotation($obj[1][1]['/Parent']);
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read all /Page(es)
|
||||
*
|
||||
* @param object pdf_context
|
||||
* @param array /Pages
|
||||
* @param array the result-array
|
||||
*/
|
||||
function read_pages (&$c, &$pages, &$result) {
|
||||
// Get the kids dictionary
|
||||
$kids = $this->pdf_resolve_object ($c, $pages[1][1]['/Kids']);
|
||||
|
||||
if (!is_array($kids))
|
||||
$this->fpdi->Error("Cannot find /Kids in current /Page-Dictionary");
|
||||
foreach ($kids[1] as $v) {
|
||||
$pg = $this->pdf_resolve_object ($c, $v);
|
||||
if ($pg[1][1]['/Type'][1] === '/Pages') {
|
||||
// If one of the kids is an embedded
|
||||
// /Pages array, resolve it as well.
|
||||
$this->read_pages ($c, $pg, $result);
|
||||
} else {
|
||||
$result[] = $pg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get PDF-Version
|
||||
*
|
||||
* And reset the PDF Version used in FPDI if needed
|
||||
*/
|
||||
function getPDFVersion() {
|
||||
parent::getPDFVersion();
|
||||
|
||||
if (isset($this->fpdi->importVersion) && $this->pdfVersion > $this->fpdi->importVersion) {
|
||||
$this->fpdi->importVersion = $this->pdfVersion;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,269 +1,269 @@
|
||||
<?php
|
||||
/****************************************************************************
|
||||
* Software: FPDI_Protection *
|
||||
* Version: 1.0.2 *
|
||||
* Date: 2006/11/20 *
|
||||
* Author: Klemen VODOPIVEC, Jan Slabon *
|
||||
* License: Freeware *
|
||||
* *
|
||||
* You may use and modify this software as you wish as stated in original *
|
||||
* FPDF package. *
|
||||
* *
|
||||
* Infos (by Jan Slabon): *
|
||||
* This class extends the FPDI-class available at http://www.setasign.de *
|
||||
* so that you can import pages and create new protected pdf files. *
|
||||
* *
|
||||
* This release is dedicated to my son Fin Frederik (*2005/06/04) *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
require_once("fpdi.php");
|
||||
|
||||
class FPDI_Protection extends FPDI {
|
||||
|
||||
var $encrypted; //whether document is protected
|
||||
var $Uvalue; //U entry in pdf document
|
||||
var $Ovalue; //O entry in pdf document
|
||||
var $Pvalue; //P entry in pdf document
|
||||
var $enc_obj_id; //encryption object id
|
||||
var $last_rc4_key; //last RC4 key encrypted (cached for optimisation)
|
||||
var $last_rc4_key_c; //last RC4 computed key
|
||||
var $padding = '';
|
||||
|
||||
function FPDI_Protection($orientation='P',$unit='mm',$format='A4')
|
||||
{
|
||||
parent::FPDI($orientation,$unit,$format);
|
||||
$this->_current_obj_id =& $this->current_obj_id; // for FPDI 1.1 compatibility
|
||||
|
||||
$this->encrypted=false;
|
||||
$this->last_rc4_key = '';
|
||||
$this->padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08".
|
||||
"\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to set permissions as well as user and owner passwords
|
||||
*
|
||||
* - permissions is an array with values taken from the following list:
|
||||
* 40bit: copy, print, modify, annot-forms
|
||||
* 128bit: fill-in, screenreaders, assemble, degraded-print
|
||||
* If a value is present it means that the permission is granted
|
||||
* - If a user password is set, user will be prompted before document is opened
|
||||
* - If an owner password is set, document can be opened in privilege mode with no
|
||||
* restriction if that password is entered
|
||||
*/
|
||||
function SetProtection($permissions=array(),$user_pass='',$owner_pass=null)
|
||||
{
|
||||
$options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32 );
|
||||
$protection = 192;
|
||||
foreach($permissions as $permission){
|
||||
if (!isset($options[$permission]))
|
||||
$this->Error('Incorrect permission: '.$permission);
|
||||
$protection += $options[$permission];
|
||||
}
|
||||
if ($owner_pass === null)
|
||||
$owner_pass = uniqid(rand());
|
||||
$this->encrypted = true;
|
||||
$this->_generateencryptionkey($user_pass, $owner_pass, $protection);
|
||||
}
|
||||
|
||||
|
||||
function _putstream($s)
|
||||
{
|
||||
if ($this->encrypted) {
|
||||
$s = $this->_RC4($this->_objectkey($this->_current_obj_id), $s);
|
||||
}
|
||||
parent::_putstream($s);
|
||||
}
|
||||
|
||||
|
||||
function _textstring($s)
|
||||
{
|
||||
if ($this->encrypted) {
|
||||
$s = $this->_RC4($this->_objectkey($this->_current_obj_id), $s);
|
||||
}
|
||||
return parent::_textstring($s);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compute key depending on object number where the encrypted data is stored
|
||||
*/
|
||||
function _objectkey($n)
|
||||
{
|
||||
return substr($this->_md5_16($this->encryption_key.pack('VXxx',$n)),0,10);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Escape special characters
|
||||
*/
|
||||
function _escape($s)
|
||||
{
|
||||
return str_replace(
|
||||
array('\\',')','(',"\r"),
|
||||
array('\\\\','\\)','\\(','\\r'),$s);
|
||||
}
|
||||
|
||||
function _putresources()
|
||||
{
|
||||
parent::_putresources();
|
||||
if ($this->encrypted) {
|
||||
$this->_newobj();
|
||||
$this->enc_obj_id = $this->_current_obj_id;
|
||||
$this->_out('<<');
|
||||
$this->_putencryption();
|
||||
$this->_out('>>');
|
||||
}
|
||||
}
|
||||
|
||||
function _putencryption()
|
||||
{
|
||||
$this->_out('/Filter /Standard');
|
||||
$this->_out('/V 1');
|
||||
$this->_out('/R 2');
|
||||
$this->_out('/O ('.$this->_escape($this->Ovalue).')');
|
||||
$this->_out('/U ('.$this->_escape($this->Uvalue).')');
|
||||
$this->_out('/P '.$this->Pvalue);
|
||||
}
|
||||
|
||||
|
||||
function _puttrailer()
|
||||
{
|
||||
parent::_puttrailer();
|
||||
if ($this->encrypted) {
|
||||
$this->_out('/Encrypt '.$this->enc_obj_id.' 0 R');
|
||||
$id = isset($this->fileidentifier) ? $this->fileidentifier : '';
|
||||
$this->_out('/ID [<'.$id.'><'.$id.'>]');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* RC4 is the standard encryption algorithm used in PDF format
|
||||
*/
|
||||
function _RC4($key, $text)
|
||||
{
|
||||
if ($this->last_rc4_key != $key) {
|
||||
$k = str_repeat($key, 256/strlen($key)+1);
|
||||
$rc4 = range(0,255);
|
||||
$j = 0;
|
||||
for ($i=0; $i<256; $i++){
|
||||
$t = $rc4[$i];
|
||||
$j = ($j + $t + ord($k{$i})) % 256;
|
||||
$rc4[$i] = $rc4[$j];
|
||||
$rc4[$j] = $t;
|
||||
}
|
||||
$this->last_rc4_key = $key;
|
||||
$this->last_rc4_key_c = $rc4;
|
||||
} else {
|
||||
$rc4 = $this->last_rc4_key_c;
|
||||
}
|
||||
|
||||
$len = strlen($text);
|
||||
$a = 0;
|
||||
$b = 0;
|
||||
$out = '';
|
||||
for ($i=0; $i<$len; $i++){
|
||||
$a = ($a+1)%256;
|
||||
$t= $rc4[$a];
|
||||
$b = ($b+$t)%256;
|
||||
$rc4[$a] = $rc4[$b];
|
||||
$rc4[$b] = $t;
|
||||
$k = $rc4[($rc4[$a]+$rc4[$b])%256];
|
||||
$out.=chr(ord($text{$i}) ^ $k);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get MD5 as binary string
|
||||
*/
|
||||
function _md5_16($string)
|
||||
{
|
||||
return pack('H*',md5($string));
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute O value
|
||||
*/
|
||||
function _Ovalue($user_pass, $owner_pass)
|
||||
{
|
||||
$tmp = $this->_md5_16($owner_pass);
|
||||
$owner_RC4_key = substr($tmp,0,5);
|
||||
return $this->_RC4($owner_RC4_key, $user_pass);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compute U value
|
||||
*/
|
||||
function _Uvalue()
|
||||
{
|
||||
return $this->_RC4($this->encryption_key, $this->padding);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compute encryption key
|
||||
*/
|
||||
function _generateencryptionkey($user_pass, $owner_pass, $protection)
|
||||
{
|
||||
// Pad passwords
|
||||
$user_pass = substr($user_pass.$this->padding,0,32);
|
||||
$owner_pass = substr($owner_pass.$this->padding,0,32);
|
||||
// Compute O value
|
||||
$this->Ovalue = $this->_Ovalue($user_pass,$owner_pass);
|
||||
// Compute encyption key
|
||||
$tmp = $this->_md5_16($user_pass.$this->Ovalue.chr($protection)."\xFF\xFF\xFF");
|
||||
$this->encryption_key = substr($tmp,0,5);
|
||||
// Compute U value
|
||||
$this->Uvalue = $this->_Uvalue();
|
||||
// Compute P value
|
||||
$this->Pvalue = -(($protection^255)+1);
|
||||
}
|
||||
|
||||
|
||||
function pdf_write_value(&$value) {
|
||||
switch ($value[0]) {
|
||||
case PDF_TYPE_STRING :
|
||||
if ($this->encrypted) {
|
||||
$value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]);
|
||||
$value[1] = $this->_escape($value[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case PDF_TYPE_STREAM :
|
||||
if ($this->encrypted) {
|
||||
$value[2][1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[2][1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case PDF_TYPE_HEX :
|
||||
|
||||
if ($this->encrypted) {
|
||||
$value[1] = $this->hex2str($value[1]);
|
||||
$value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]);
|
||||
|
||||
// remake hexstring of encrypted string
|
||||
$value[1] = $this->str2hex($value[1]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
parent::pdf_write_value($value);
|
||||
}
|
||||
|
||||
|
||||
function hex2str($hex) {
|
||||
return pack("H*", str_replace(array("\r","\n"," "),"", $hex));
|
||||
}
|
||||
|
||||
function str2hex($str) {
|
||||
return current(unpack("H*",$str));
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
/****************************************************************************
|
||||
* Software: FPDI_Protection *
|
||||
* Version: 1.0.2 *
|
||||
* Date: 2006/11/20 *
|
||||
* Author: Klemen VODOPIVEC, Jan Slabon *
|
||||
* License: Freeware *
|
||||
* *
|
||||
* You may use and modify this software as you wish as stated in original *
|
||||
* FPDF package. *
|
||||
* *
|
||||
* Infos (by Jan Slabon): *
|
||||
* This class extends the FPDI-class available at http://www.setasign.de *
|
||||
* so that you can import pages and create new protected pdf files. *
|
||||
* *
|
||||
* This release is dedicated to my son Fin Frederik (*2005/06/04) *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
require_once("fpdi.php");
|
||||
|
||||
class FPDI_Protection extends FPDI {
|
||||
|
||||
var $encrypted; //whether document is protected
|
||||
var $Uvalue; //U entry in pdf document
|
||||
var $Ovalue; //O entry in pdf document
|
||||
var $Pvalue; //P entry in pdf document
|
||||
var $enc_obj_id; //encryption object id
|
||||
var $last_rc4_key; //last RC4 key encrypted (cached for optimisation)
|
||||
var $last_rc4_key_c; //last RC4 computed key
|
||||
var $padding = '';
|
||||
|
||||
function FPDI_Protection($orientation='P',$unit='mm',$format='A4')
|
||||
{
|
||||
parent::FPDI($orientation,$unit,$format);
|
||||
$this->_current_obj_id =& $this->current_obj_id; // for FPDI 1.1 compatibility
|
||||
|
||||
$this->encrypted=false;
|
||||
$this->last_rc4_key = '';
|
||||
$this->padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08".
|
||||
"\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to set permissions as well as user and owner passwords
|
||||
*
|
||||
* - permissions is an array with values taken from the following list:
|
||||
* 40bit: copy, print, modify, annot-forms
|
||||
* 128bit: fill-in, screenreaders, assemble, degraded-print
|
||||
* If a value is present it means that the permission is granted
|
||||
* - If a user password is set, user will be prompted before document is opened
|
||||
* - If an owner password is set, document can be opened in privilege mode with no
|
||||
* restriction if that password is entered
|
||||
*/
|
||||
function SetProtection($permissions=array(),$user_pass='',$owner_pass=null)
|
||||
{
|
||||
$options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32 );
|
||||
$protection = 192;
|
||||
foreach($permissions as $permission){
|
||||
if (!isset($options[$permission]))
|
||||
$this->Error('Incorrect permission: '.$permission);
|
||||
$protection += $options[$permission];
|
||||
}
|
||||
if ($owner_pass === null)
|
||||
$owner_pass = uniqid(rand());
|
||||
$this->encrypted = true;
|
||||
$this->_generateencryptionkey($user_pass, $owner_pass, $protection);
|
||||
}
|
||||
|
||||
|
||||
function _putstream($s)
|
||||
{
|
||||
if ($this->encrypted) {
|
||||
$s = $this->_RC4($this->_objectkey($this->_current_obj_id), $s);
|
||||
}
|
||||
parent::_putstream($s);
|
||||
}
|
||||
|
||||
|
||||
function _textstring($s)
|
||||
{
|
||||
if ($this->encrypted) {
|
||||
$s = $this->_RC4($this->_objectkey($this->_current_obj_id), $s);
|
||||
}
|
||||
return parent::_textstring($s);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compute key depending on object number where the encrypted data is stored
|
||||
*/
|
||||
function _objectkey($n)
|
||||
{
|
||||
return substr($this->_md5_16($this->encryption_key.pack('VXxx',$n)),0,10);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Escape special characters
|
||||
*/
|
||||
function _escape($s)
|
||||
{
|
||||
return str_replace(
|
||||
array('\\',')','(',"\r"),
|
||||
array('\\\\','\\)','\\(','\\r'),$s);
|
||||
}
|
||||
|
||||
function _putresources()
|
||||
{
|
||||
parent::_putresources();
|
||||
if ($this->encrypted) {
|
||||
$this->_newobj();
|
||||
$this->enc_obj_id = $this->_current_obj_id;
|
||||
$this->_out('<<');
|
||||
$this->_putencryption();
|
||||
$this->_out('>>');
|
||||
}
|
||||
}
|
||||
|
||||
function _putencryption()
|
||||
{
|
||||
$this->_out('/Filter /Standard');
|
||||
$this->_out('/V 1');
|
||||
$this->_out('/R 2');
|
||||
$this->_out('/O ('.$this->_escape($this->Ovalue).')');
|
||||
$this->_out('/U ('.$this->_escape($this->Uvalue).')');
|
||||
$this->_out('/P '.$this->Pvalue);
|
||||
}
|
||||
|
||||
|
||||
function _puttrailer()
|
||||
{
|
||||
parent::_puttrailer();
|
||||
if ($this->encrypted) {
|
||||
$this->_out('/Encrypt '.$this->enc_obj_id.' 0 R');
|
||||
$id = isset($this->fileidentifier) ? $this->fileidentifier : '';
|
||||
$this->_out('/ID [<'.$id.'><'.$id.'>]');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* RC4 is the standard encryption algorithm used in PDF format
|
||||
*/
|
||||
function _RC4($key, $text)
|
||||
{
|
||||
if ($this->last_rc4_key != $key) {
|
||||
$k = str_repeat($key, 256/strlen($key)+1);
|
||||
$rc4 = range(0,255);
|
||||
$j = 0;
|
||||
for ($i=0; $i<256; $i++){
|
||||
$t = $rc4[$i];
|
||||
$j = ($j + $t + ord($k{$i})) % 256;
|
||||
$rc4[$i] = $rc4[$j];
|
||||
$rc4[$j] = $t;
|
||||
}
|
||||
$this->last_rc4_key = $key;
|
||||
$this->last_rc4_key_c = $rc4;
|
||||
} else {
|
||||
$rc4 = $this->last_rc4_key_c;
|
||||
}
|
||||
|
||||
$len = strlen($text);
|
||||
$a = 0;
|
||||
$b = 0;
|
||||
$out = '';
|
||||
for ($i=0; $i<$len; $i++){
|
||||
$a = ($a+1)%256;
|
||||
$t= $rc4[$a];
|
||||
$b = ($b+$t)%256;
|
||||
$rc4[$a] = $rc4[$b];
|
||||
$rc4[$b] = $t;
|
||||
$k = $rc4[($rc4[$a]+$rc4[$b])%256];
|
||||
$out.=chr(ord($text{$i}) ^ $k);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get MD5 as binary string
|
||||
*/
|
||||
function _md5_16($string)
|
||||
{
|
||||
return pack('H*',md5($string));
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute O value
|
||||
*/
|
||||
function _Ovalue($user_pass, $owner_pass)
|
||||
{
|
||||
$tmp = $this->_md5_16($owner_pass);
|
||||
$owner_RC4_key = substr($tmp,0,5);
|
||||
return $this->_RC4($owner_RC4_key, $user_pass);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compute U value
|
||||
*/
|
||||
function _Uvalue()
|
||||
{
|
||||
return $this->_RC4($this->encryption_key, $this->padding);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compute encryption key
|
||||
*/
|
||||
function _generateencryptionkey($user_pass, $owner_pass, $protection)
|
||||
{
|
||||
// Pad passwords
|
||||
$user_pass = substr($user_pass.$this->padding,0,32);
|
||||
$owner_pass = substr($owner_pass.$this->padding,0,32);
|
||||
// Compute O value
|
||||
$this->Ovalue = $this->_Ovalue($user_pass,$owner_pass);
|
||||
// Compute encyption key
|
||||
$tmp = $this->_md5_16($user_pass.$this->Ovalue.chr($protection)."\xFF\xFF\xFF");
|
||||
$this->encryption_key = substr($tmp,0,5);
|
||||
// Compute U value
|
||||
$this->Uvalue = $this->_Uvalue();
|
||||
// Compute P value
|
||||
$this->Pvalue = -(($protection^255)+1);
|
||||
}
|
||||
|
||||
|
||||
function pdf_write_value(&$value) {
|
||||
switch ($value[0]) {
|
||||
case PDF_TYPE_STRING :
|
||||
if ($this->encrypted) {
|
||||
$value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]);
|
||||
$value[1] = $this->_escape($value[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case PDF_TYPE_STREAM :
|
||||
if ($this->encrypted) {
|
||||
$value[2][1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[2][1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case PDF_TYPE_HEX :
|
||||
|
||||
if ($this->encrypted) {
|
||||
$value[1] = $this->hex2str($value[1]);
|
||||
$value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]);
|
||||
|
||||
// remake hexstring of encrypted string
|
||||
$value[1] = $this->str2hex($value[1]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
parent::pdf_write_value($value);
|
||||
}
|
||||
|
||||
|
||||
function hex2str($hex) {
|
||||
return pack("H*", str_replace(array("\r","\n"," "),"", $hex));
|
||||
}
|
||||
|
||||
function str2hex($str) {
|
||||
return current(unpack("H*",$str));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,78 +1,78 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
class pdf_context {
|
||||
|
||||
var $file;
|
||||
var $buffer;
|
||||
var $offset;
|
||||
var $length;
|
||||
|
||||
var $stack;
|
||||
|
||||
// Constructor
|
||||
|
||||
function pdf_context($f) {
|
||||
$this->file = $f;
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
// Optionally move the file
|
||||
// pointer to a new location
|
||||
// and reset the buffered data
|
||||
|
||||
function reset($pos = null, $l = 100) {
|
||||
if (!is_null ($pos)) {
|
||||
fseek ($this->file, $pos);
|
||||
}
|
||||
|
||||
$this->buffer = $l > 0 ? fread($this->file, $l) : '';
|
||||
$this->offset = 0;
|
||||
$this->length = strlen($this->buffer);
|
||||
$this->stack = array();
|
||||
}
|
||||
|
||||
// Make sure that there is at least one
|
||||
// character beyond the current offset in
|
||||
// the buffer to prevent the tokenizer
|
||||
// from attempting to access data that does
|
||||
// not exist
|
||||
|
||||
function ensure_content() {
|
||||
if ($this->offset >= $this->length - 1) {
|
||||
return $this->increase_length();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Forcefully read more data into the buffer
|
||||
|
||||
function increase_length($l=100) {
|
||||
if (feof($this->file)) {
|
||||
return false;
|
||||
} else {
|
||||
$this->buffer .= fread($this->file, $l);
|
||||
$this->length = strlen($this->buffer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
class pdf_context {
|
||||
|
||||
var $file;
|
||||
var $buffer;
|
||||
var $offset;
|
||||
var $length;
|
||||
|
||||
var $stack;
|
||||
|
||||
// Constructor
|
||||
|
||||
function pdf_context($f) {
|
||||
$this->file = $f;
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
// Optionally move the file
|
||||
// pointer to a new location
|
||||
// and reset the buffered data
|
||||
|
||||
function reset($pos = null, $l = 100) {
|
||||
if (!is_null ($pos)) {
|
||||
fseek ($this->file, $pos);
|
||||
}
|
||||
|
||||
$this->buffer = $l > 0 ? fread($this->file, $l) : '';
|
||||
$this->offset = 0;
|
||||
$this->length = strlen($this->buffer);
|
||||
$this->stack = array();
|
||||
}
|
||||
|
||||
// Make sure that there is at least one
|
||||
// character beyond the current offset in
|
||||
// the buffer to prevent the tokenizer
|
||||
// from attempting to access data that does
|
||||
// not exist
|
||||
|
||||
function ensure_content() {
|
||||
if ($this->offset >= $this->length - 1) {
|
||||
return $this->increase_length();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Forcefully read more data into the buffer
|
||||
|
||||
function increase_length($l=100) {
|
||||
if (feof($this->file)) {
|
||||
return false;
|
||||
} else {
|
||||
$this->buffer .= fread($this->file, $l);
|
||||
$this->length = strlen($this->buffer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,88 +1,88 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
|
||||
if (!defined("PHP_VER_LOWER43"))
|
||||
define("PHP_VER_LOWER43", version_compare(PHP_VERSION, "4.3", "<"));
|
||||
|
||||
|
||||
/**
|
||||
* ensure that strspn works correct if php-version < 4.3
|
||||
*/
|
||||
function _strspn($str1, $str2, $start=null, $length=null) {
|
||||
$numargs = func_num_args();
|
||||
|
||||
if (PHP_VER_LOWER43 == 1) {
|
||||
if (isset($length)) {
|
||||
$str1 = substr($str1, $start, $length);
|
||||
} else {
|
||||
$str1 = substr($str1, $start);
|
||||
}
|
||||
}
|
||||
|
||||
if ($numargs == 2 || PHP_VER_LOWER43 == 1) {
|
||||
return strspn($str1, $str2);
|
||||
} else if ($numargs == 3) {
|
||||
return strspn($str1, $str2, $start);
|
||||
} else {
|
||||
return strspn($str1, $str2, $start, $length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ensure that strcspn works correct if php-version < 4.3
|
||||
*/
|
||||
function _strcspn($str1, $str2, $start=null, $length=null) {
|
||||
$numargs = func_num_args();
|
||||
|
||||
if (PHP_VER_LOWER43 == 1) {
|
||||
if (isset($length)) {
|
||||
$str1 = substr($str1, $start, $length);
|
||||
} else {
|
||||
$str1 = substr($str1, $start);
|
||||
}
|
||||
}
|
||||
|
||||
if ($numargs == 2 || PHP_VER_LOWER43 == 1) {
|
||||
return strcspn($str1, $str2);
|
||||
} else if ($numargs == 3) {
|
||||
return strcspn($str1, $str2, $start);
|
||||
} else {
|
||||
return strcspn($str1, $str2, $start, $length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ensure that fgets works correct if php-version < 4.3
|
||||
*/
|
||||
function _fgets (&$h, $force=false) {
|
||||
$startpos = ftell($h);
|
||||
$s = fgets($h, 1024);
|
||||
|
||||
if ((PHP_VER_LOWER43 == 1 || $force) && preg_match("/^([^\r\n]*[\r\n]{1,2})(.)/",trim($s), $ns)) {
|
||||
$s = $ns[1];
|
||||
fseek($h,$startpos+strlen($s));
|
||||
}
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.2
|
||||
//
|
||||
// Copyright 2004-2007 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
|
||||
if (!defined("PHP_VER_LOWER43"))
|
||||
define("PHP_VER_LOWER43", version_compare(PHP_VERSION, "4.3", "<"));
|
||||
|
||||
|
||||
/**
|
||||
* ensure that strspn works correct if php-version < 4.3
|
||||
*/
|
||||
function _strspn($str1, $str2, $start=null, $length=null) {
|
||||
$numargs = func_num_args();
|
||||
|
||||
if (PHP_VER_LOWER43 == 1) {
|
||||
if (isset($length)) {
|
||||
$str1 = substr($str1, $start, $length);
|
||||
} else {
|
||||
$str1 = substr($str1, $start);
|
||||
}
|
||||
}
|
||||
|
||||
if ($numargs == 2 || PHP_VER_LOWER43 == 1) {
|
||||
return strspn($str1, $str2);
|
||||
} else if ($numargs == 3) {
|
||||
return strspn($str1, $str2, $start);
|
||||
} else {
|
||||
return strspn($str1, $str2, $start, $length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ensure that strcspn works correct if php-version < 4.3
|
||||
*/
|
||||
function _strcspn($str1, $str2, $start=null, $length=null) {
|
||||
$numargs = func_num_args();
|
||||
|
||||
if (PHP_VER_LOWER43 == 1) {
|
||||
if (isset($length)) {
|
||||
$str1 = substr($str1, $start, $length);
|
||||
} else {
|
||||
$str1 = substr($str1, $start);
|
||||
}
|
||||
}
|
||||
|
||||
if ($numargs == 2 || PHP_VER_LOWER43 == 1) {
|
||||
return strcspn($str1, $str2);
|
||||
} else if ($numargs == 3) {
|
||||
return strcspn($str1, $str2, $start);
|
||||
} else {
|
||||
return strcspn($str1, $str2, $start, $length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ensure that fgets works correct if php-version < 4.3
|
||||
*/
|
||||
function _fgets (&$h, $force=false) {
|
||||
$startpos = ftell($h);
|
||||
$s = fgets($h, 1024);
|
||||
|
||||
if ((PHP_VER_LOWER43 == 1 || $force) && preg_match("/^([^\r\n]*[\r\n]{1,2})(.)/",trim($s), $ns)) {
|
||||
$s = $ns[1];
|
||||
fseek($h,$startpos+strlen($s));
|
||||
}
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,115 +1,115 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/includes/login/functions_dolibarr.php
|
||||
\ingroup core
|
||||
\brief Authentication functions for Dolibarr mode
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\brief Check user and password
|
||||
\param usertotest Login
|
||||
\param passwordtotest Password
|
||||
\return string Login if ok, '' if ko.
|
||||
*/
|
||||
function check_user_password_dolibarr($usertotest,$passwordtotest)
|
||||
{
|
||||
global $_POST,$db,$conf,$langs;
|
||||
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest);
|
||||
|
||||
$login='';
|
||||
|
||||
if (! empty($_POST["username"]))
|
||||
{
|
||||
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
|
||||
$table = MAIN_DB_PREFIX."user";
|
||||
$usernamecol = 'login';
|
||||
|
||||
$sql ='SELECT pass, pass_crypted';
|
||||
$sql.=' from '.$table;
|
||||
$sql.=' where '.$usernamecol." = '".addslashes($_POST["username"])."'";
|
||||
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$passclear=$obj->pass;
|
||||
$passcrypted=$obj->pass_crypted;
|
||||
$passtyped=$_POST["password"];
|
||||
|
||||
$passok=false;
|
||||
|
||||
// Check crypted password
|
||||
$cryptType='';
|
||||
if ($conf->global->DATABASE_PWD_ENCRYPTED) $cryptType='md5';
|
||||
if ($cryptType == 'md5')
|
||||
{
|
||||
if (md5($passtyped) == $passcrypted) $passok=true;
|
||||
}
|
||||
|
||||
// For compatibility with old versions
|
||||
if (! $passok)
|
||||
{
|
||||
if ((! $passcrypted || $passtyped)
|
||||
&& ($passtyped == $passclear)) $passok=true;
|
||||
}
|
||||
|
||||
// Password ok ?
|
||||
if ($passok)
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok");
|
||||
$login=$_POST["username"];
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko bad password pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko user not found pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko db error pour '".$_POST["username"]."' error=".$db->lasterror());
|
||||
sleep(1);
|
||||
$_SESSION["dol_loginmesg"]=$db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
return $login;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/includes/login/functions_dolibarr.php
|
||||
\ingroup core
|
||||
\brief Authentication functions for Dolibarr mode
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\brief Check user and password
|
||||
\param usertotest Login
|
||||
\param passwordtotest Password
|
||||
\return string Login if ok, '' if ko.
|
||||
*/
|
||||
function check_user_password_dolibarr($usertotest,$passwordtotest)
|
||||
{
|
||||
global $_POST,$db,$conf,$langs;
|
||||
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest);
|
||||
|
||||
$login='';
|
||||
|
||||
if (! empty($_POST["username"]))
|
||||
{
|
||||
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
|
||||
$table = MAIN_DB_PREFIX."user";
|
||||
$usernamecol = 'login';
|
||||
|
||||
$sql ='SELECT pass, pass_crypted';
|
||||
$sql.=' from '.$table;
|
||||
$sql.=' where '.$usernamecol." = '".addslashes($_POST["username"])."'";
|
||||
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$passclear=$obj->pass;
|
||||
$passcrypted=$obj->pass_crypted;
|
||||
$passtyped=$_POST["password"];
|
||||
|
||||
$passok=false;
|
||||
|
||||
// Check crypted password
|
||||
$cryptType='';
|
||||
if ($conf->global->DATABASE_PWD_ENCRYPTED) $cryptType='md5';
|
||||
if ($cryptType == 'md5')
|
||||
{
|
||||
if (md5($passtyped) == $passcrypted) $passok=true;
|
||||
}
|
||||
|
||||
// For compatibility with old versions
|
||||
if (! $passok)
|
||||
{
|
||||
if ((! $passcrypted || $passtyped)
|
||||
&& ($passtyped == $passclear)) $passok=true;
|
||||
}
|
||||
|
||||
// Password ok ?
|
||||
if ($passok)
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok");
|
||||
$login=$_POST["username"];
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko bad password pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko user not found pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko db error pour '".$_POST["username"]."' error=".$db->lasterror());
|
||||
sleep(1);
|
||||
$_SESSION["dol_loginmesg"]=$db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
return $login;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -1,50 +1,50 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/includes/login/functions_forceuser.php
|
||||
\ingroup core
|
||||
\brief Authentication functions for forceuser
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\brief Check user and password
|
||||
\param usertotest Login
|
||||
\param passwordtotest Password
|
||||
\return string Login if ok, '' if ko.
|
||||
*/
|
||||
function check_user_password_forceuser($usertotest,$passwordtotest)
|
||||
{
|
||||
// Variable dolibarr_auto_user must be defined in conf.php file
|
||||
global $dolibarr_auto_user;
|
||||
|
||||
dolibarr_syslog("functions_forceuser::check_user_password_forceuser");
|
||||
|
||||
$login=$dolibarr_auto_user;
|
||||
if (empty($login)) $login='auto';
|
||||
|
||||
if ($_SESSION["dol_loginmesg"]) $login='';
|
||||
|
||||
return $login;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
/* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/includes/login/functions_forceuser.php
|
||||
\ingroup core
|
||||
\brief Authentication functions for forceuser
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\brief Check user and password
|
||||
\param usertotest Login
|
||||
\param passwordtotest Password
|
||||
\return string Login if ok, '' if ko.
|
||||
*/
|
||||
function check_user_password_forceuser($usertotest,$passwordtotest)
|
||||
{
|
||||
// Variable dolibarr_auto_user must be defined in conf.php file
|
||||
global $dolibarr_auto_user;
|
||||
|
||||
dolibarr_syslog("functions_forceuser::check_user_password_forceuser");
|
||||
|
||||
$login=$dolibarr_auto_user;
|
||||
if (empty($login)) $login='auto';
|
||||
|
||||
if ($_SESSION["dol_loginmesg"]) $login='';
|
||||
|
||||
return $login;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -1,4 +1,4 @@
|
||||
docs
|
||||
imagesAlt
|
||||
imagesAlt2
|
||||
images
|
||||
docs
|
||||
imagesAlt
|
||||
imagesAlt2
|
||||
images
|
||||
|
||||
@ -1 +1 @@
|
||||
ws_client_demo
|
||||
ws_client_demo
|
||||
|
||||
@ -1,438 +1,438 @@
|
||||
2003-07-21, version 0.6.5
|
||||
- soap_transport_http: SOAPAction header is quoted again, fixes problem w/ Weblogic Server
|
||||
- applied Jason Levitt patch for proper array serialization, fixes problem w/ Amazon shopping cart services
|
||||
- fixed null value serialization
|
||||
- applied patch from "BZC ToOn'S" - fixes wsdl serialization when no parameters
|
||||
- applied John's patch, implementing compression for the server
|
||||
|
||||
2003-07-22, version 0.6.5
|
||||
- soap_server: fixed bug causing charset encoding not to be passed to the parser
|
||||
- soap_fault: added default encoding to the fault serialization
|
||||
- soap_parser: changed the parser to pre-load the parent's result array when processing scalar values. This increases parsing speed.
|
||||
|
||||
2003-07-23, version 0.6.5
|
||||
- soap_base: fix code that overwrites user-supplied attributes in serialize_val
|
||||
- soap_base: use arrays-of-arrays rather than attempting multi-dimensional in serialize_val
|
||||
- xmlschema: emit import statements and qualify all elements with prefix in serializeSchema (better interop with validation tools)
|
||||
- soapclient: get xml character encoding from HTTP Content-Type header if provided, e.g. text/xml;charset="UTF-8"
|
||||
- soapclient: use headers in call if provided (previously ignored this parameter)
|
||||
- soap_server: in parse_request, if neither getallheaders nor $_SERVER are available, use $HTTP_SERVER_VARS to get SOAPAction and xml encoding
|
||||
|
||||
2003-07-24, version 0.6.5
|
||||
- soap_transport_http: apply patch from Steven Brown "if the server closes connection prematurely, nusoap would spin trying to read data that isn't there"
|
||||
|
||||
2003-07-25, version 0.6.5
|
||||
- wsdl: apply patch from Sven to workaround single schema limitation
|
||||
- wsdl: apply a variant of the patch from Holger to handle empty values for array by serializing an array with 0 elements
|
||||
- xmlschema: remove the redundant default namespace attribute on the schema element; everything in xsd is explicitly specified as being from xsd
|
||||
- soap_transport_http: fix setCredentials and add TODO comments in sendHTTPS about what to change if this setCredentials stays
|
||||
|
||||
2003-07-30, version 0.6.5
|
||||
- nusoap_base: change documentation of soap_defencoding to specify it is the encoding for outgoing messages
|
||||
- nusoap_base: only change &, <, > to entities, not all HTML entities
|
||||
- soap_transport_http: update the Content-Type header in sendRequest, since soap_defencoding could be changed after ctor is called
|
||||
- soap_server: use soap_defencoding instead of charset_encoding
|
||||
- soap_server: read encoding from _SERVER if available
|
||||
- nusoap_base: do entity translation for string parameters with an xsd type specified (thanks David Derr)
|
||||
|
||||
2003-07-31, version 0.6.5
|
||||
- soap_transport_http: add proxy authentication
|
||||
- soap_transport_http: build payload the same way for http and https
|
||||
- wsdl: add proxy authentication
|
||||
- soapclient: add proxy authentication
|
||||
- soapclient: allow proxy information in ctor, so that it can be used for wsdl
|
||||
|
||||
2003-08-01, version 0.6.5
|
||||
- soap_transport_http: close a persistent connection that's at EOF
|
||||
- soap_transport_http: prevent conflicts between setEncoding and usePersistentConnection
|
||||
- soap_transport_http: fix use of $headers instead of $this->incoming_headers in getResponse
|
||||
- soapclient: improve handling of persistent connections
|
||||
- soapclient: force xml_encoding to upper case
|
||||
- soap_server: let the Web server decide whether to close the connection (no Connection: close header)
|
||||
- soap_server: force xml_encoding to upper case
|
||||
|
||||
2003-08-04, version 0.6.5
|
||||
- soap_parser: use XML type information to pick a PHP data type; also decode base64
|
||||
- soap_server: read all HTTP headers when using _SERVER or HTTP_SERVER_VARS
|
||||
- soap_server: add gzip encoding support for outgoing messages
|
||||
- soap_transport_http: deflate is gzcompress/gzuncompress (cf. http://archive.develooper.com/libwww@perl.org/msg04650.html)
|
||||
- soap_transport_http: clean use of persistentConnection so it's always a set boolean
|
||||
- soapclient: add responseData member to access deflated/gunzipped payload
|
||||
|
||||
2003-08-05, version 0.6.5
|
||||
- soap_server: look multiple places when setting debug_flag
|
||||
|
||||
2003-08-07, version 0.6.5
|
||||
- nusoap_base: serialize specified type (e.g. ArrayOfString) even for simple array
|
||||
- wsdl: only specify encodingStyle in the input/output soap bindings when it is not empty (thanks Guillaume)
|
||||
|
||||
2003-08-15, version 0.6.5
|
||||
- soap_parser: fix parsing of elements with no XSD type specified
|
||||
- soap_parser: use PHP string type for XSD long and unsignedLong types
|
||||
|
||||
2003-08-16, version 0.6.5
|
||||
- soap_parser: fix code generating warning (thanks Torsten)
|
||||
|
||||
2003-08-19, version 0.6.5
|
||||
- soap_parser: fix another line of code generating a warning (thanks Torsten)
|
||||
|
||||
2003-08-22, version 0.6.5
|
||||
- soap_server: remove all '--' from debug_str; previous code changed '---' to '- --'
|
||||
- wsdl, soapclient, soap_parser: patch submitted by Mark Spavin as described by
|
||||
the following...
|
||||
> Changes for the multiple/nested imports from the wsdl file. This builds an
|
||||
> array of files not just the last one and also checks for relative paths to
|
||||
> the parent. This will then get the imported files from the remote site
|
||||
> instead of your local disk. Local wsdl files should still work (untested).
|
||||
>
|
||||
> Changes for multiple encoding sytles as previously posted
|
||||
|
||||
2003-08-24, version 0.6.5
|
||||
- wsdl, soapclient: fix some PHP notices from previous update
|
||||
|
||||
2003-08-26, version 0.6.5
|
||||
- wsdl: support multiple SOAP ports
|
||||
- soapclient, soap_server: when no charset is specified, use UTF-8, even though HTTP specifies US-ASCII.
|
||||
- soap_transport_http: do not prepend $host with 'ssl://' for https (is this required for older cURL versions?)
|
||||
|
||||
2003-08-27, version 0.6.5
|
||||
- soap_server: support compressed request messages (thanks John Huong)
|
||||
- soap_parser: deserialize Apache Vector as an array
|
||||
- xmlschema: use $this->typemap in getPHPType (which is not used)
|
||||
- soapclient, wsdl: check for WSDL errors after serializing parameters
|
||||
- nusoap_base: add serialization of Apache Map (when not using WSDL)
|
||||
- wsdl: add serialization of Apache Map (when using WSDL)
|
||||
- wsdl: only change &, <, > to entities, not all HTML entities
|
||||
|
||||
2003-08-28, version 0.6.5
|
||||
- soap_transport_http: disable cURL verification of peer and server (formerly the cURL default)
|
||||
- soap_transport_http: mingle cURL code with straight http, so sendHTTP is no longer needed
|
||||
|
||||
2003-08-29, version 0.6.6
|
||||
- soap_transport_http: add setContentType
|
||||
- soapclient: call setContentType using new getHTTPContentType and getHTTPContentTypeCharset
|
||||
|
||||
2003-09-05, version 0.6.6
|
||||
- wsdl: add some more code to handle null/nil values (but there's still a way to go)
|
||||
|
||||
2003-10-21, version 0.6.6
|
||||
- soap_transport_http: only include port in Host header if it was specified in the URL
|
||||
- soap_transport_http: add some code to use OpenSSL for PHP ssl:// scheme, but comment out since it's not ready
|
||||
- soap_server: use $_SERVER['PHP_SELF'] if $GLOBALS['PHP_SELF'] is not set
|
||||
- wsdl: add WSDL request and response and transport debug to debug
|
||||
- wsdl: handle custom type extending xmlschema namespace (GLUE ... Thanks Matt)
|
||||
- soap_parser: add param to docs
|
||||
- soapclient: add getHTTPBody, getHTTPContentType, getHTTPContentTypeCharset (anticipating MIME subclass)
|
||||
|
||||
2003-10-28, version 0.6.6
|
||||
- nusoap_base: add expandEntities method
|
||||
- wsdl: use expandEntities
|
||||
- soap_fault: use expandEntities
|
||||
- soap_transport_http: Allow credentials to be included in URL, rather than requiring setCredentials
|
||||
- soap_transport_http: Merge HTTP headers that span multiple lines
|
||||
- soap_parser: Properly set errors in ctor
|
||||
- soapclient: Pass headers to parseResponse and parse them in that method
|
||||
|
||||
2003-10-30, version 0.6.6
|
||||
- xmlschema: Add some information for the related type to an element
|
||||
|
||||
2003-12-09, version 0.6.6
|
||||
- nusoap_base: Add some namespace methods previously in xmlschema
|
||||
- xmlschema: Improve parsing of complexType, element and simpleType
|
||||
- xmlschema: Improve serialization
|
||||
- xmlschema: Track imports
|
||||
- xmlschema: Track elementFormDefault and form attributes
|
||||
- wsdl: Support multiple <schema> (note that setting $server->wsdl->schemaTargetNamespace no longer does anything! Use configureWSDL instead.)
|
||||
- wsdl: Use form attribute of element to control namespace specification
|
||||
- wsdl: Support chained imports (A imports B which imports C)
|
||||
- wsdl: Include port in endpoint address when serializing
|
||||
- soap_server: Fix use of style (rpc|document) and use (encoded|literal)
|
||||
- soap_server: Support _SERVER[CONTENT_TYPE] in addition to _SERVER[HTTP_CONTENT_TYPE]
|
||||
- soap_server: Support wsdl with multiple <schema>
|
||||
- soap_client: Remove a var_dump
|
||||
- soap_client: Add style and use parameters to call method to support doc/lit without WSDL
|
||||
- soap_transport_http: Check that $this->fp exists when doing persistent connections
|
||||
|
||||
2003-12-17, version 0.6.6
|
||||
- soap_server: pass namespaces to xmlschema constructor
|
||||
- wsdl: post-process after all imports
|
||||
- wsdl: remove some debug, add some error handling
|
||||
- xmlschema: allow enclosing namespaces to be specified in constructor
|
||||
- xmlschema: improve handling of compositors and simple types
|
||||
|
||||
2004-01-08, version 0.6.6
|
||||
- soap_server: when requested WSDL is in a file, return to client using passthru (thanks Ingo Fischer)
|
||||
- soapclient: have proxy inherit more client state
|
||||
- soapclient: allow timeout and response timeout to be specified in the constructor
|
||||
- wsdl: allow timeout and response timeout to be specified in the constructor
|
||||
- soap_transport_http: allow response timeout to be specified in send and sendHTTPS
|
||||
|
||||
2004-01-28, version 0.6.6
|
||||
- wsdl: add namespace for array and scalar when form is qualified
|
||||
- wsdl: fix a bug in which data type of complexType elements were ignored in serialization
|
||||
- wsdl: enhance handling of URLs with file scheme
|
||||
- wsdl: add addSimpleType
|
||||
- xmlschema: add addSimpleType
|
||||
- xmlschema: always set phpType elements
|
||||
- soapclient: allow a wsdl instance to be specified in constructor
|
||||
- soap_server: allow a wsdl instance to be specified in constructor (not tested!)
|
||||
- soap_server: fix default SOAPAction created in register method
|
||||
- soap_transport_http: accept chunking with LF separators in addition to CRLF.
|
||||
- wsdlcache: added class
|
||||
- nusoapmime: fix comments
|
||||
|
||||
2004-02-23, version 0.6.6
|
||||
- soap_transport_http: don't try to unchunk cURL data, since cURL already does it
|
||||
- soap_transport_http: append CVS revision to version in User-Agent
|
||||
- wsdl: serialize boolean as true|false, not 1|0, to agree with XML Schema
|
||||
- soap_server: always exit() after returning WSDL
|
||||
- soap_server: use the WSDL URL scheme as the default endpoint URL scheme
|
||||
- soap_server: append CVS revision to version in X-SOAP-Server
|
||||
- nusoap_base: add (CVS) revision
|
||||
- wsdlcache: synchronize using a per-WSDL lock file (Thanks Ingo)
|
||||
- wsdlcache: add cache lifetime, after which cache contents are invalidated (Thanks Ingo)
|
||||
|
||||
2004-03-15, version 0.6.6
|
||||
- nusoap_base: add isArraySimpleOrStruct method
|
||||
- soap_server: improve WSDL URL scheme determination
|
||||
- soap_server: only deflate/gzip payloads > 1024 bytes
|
||||
- soap_server: fix parameter order in fault method (always used as faultcode, faultstring)
|
||||
- soap_server: refactor parse_request into multiple functions (for sanity)
|
||||
- soap_server: set the namespace on the Response element to the same as the request
|
||||
- soap_server: name the return value element 'return' by default
|
||||
- soap_server: added and documented data fields, so that service programmers can use them if desired
|
||||
- soap_parser: standardize parsing error message
|
||||
- soap_parser: fix document and responseHeaders so they are the correct XML text (as documented)
|
||||
- soap_transport_http: fix read from persistent connection
|
||||
- soapclient: clean up debugging for persistent connection
|
||||
- wsdl: enforce correct naming of messages parts when an associative array is used for parameters
|
||||
- wsdl: better serialization of null values
|
||||
- wsdl: standardize parsing error message
|
||||
- xmlschema: standardize parsing error message
|
||||
|
||||
2004-03-24, version 0.6.7
|
||||
- soap_transport_http: add digest authentication (based on code by Kevin A. Miller)
|
||||
- xmlschema: improve parsing of import elements
|
||||
- wsdl: do schema imports even if there are no wsdl imports
|
||||
|
||||
2004-04-12, version 0.6.7
|
||||
- wsdl: serialize multiple elements when maxOccurs="unbounded" and value is an array
|
||||
- wsdl: serialize soapval values (used to force an XML type, e.g. when WSDL uses an abstract type)
|
||||
- nusoapmime: do not require nusoap.php (it is now the programmer's responsibility)
|
||||
|
||||
2004-04-21, version 0.6.7
|
||||
- soap_parser: parse repeated element name into an array (de-serializes doc/lit array into a PHP array when there is more than 1 array element)
|
||||
- soap_server: do not wrap response in a response element for a document style service
|
||||
|
||||
2004-04-30, version 0.6.7
|
||||
- soap_transport_http: allow digest auth params to be separated by "," as well as ", "
|
||||
- soap_transport_http: re-initialize incoming headers for each response
|
||||
- soap_server: add methodreturnisliteralxml property to allow service function to return XML as a string
|
||||
- soapclient: improve rpc/literal support
|
||||
- soapclient: allow XML string as call params in addition to array
|
||||
- soapclient: support document style and literal encoding when not using WSDL
|
||||
|
||||
2004-05-05, version 0.6.7
|
||||
- wsdl: serialize PHP objects for WSDL XML Schema complexTypes, in addition to associative arrays
|
||||
- wsdl: fix WSDL generation when there is no encodingStyle
|
||||
- soap_transport_http: suppress fsockopen warnings
|
||||
- soap_transport_http: detect socket timeouts when reading (0 bytes returned)
|
||||
- soap_transport_http: read chunked content "in-line" so it works on a persistent connection
|
||||
- nusoap_base: serialize boolean as true|false, not 1|0, to agree with XML Schema
|
||||
- nusoap_base: serialize array of struct differently than array of array
|
||||
|
||||
2004-06-25, version 0.6.8
|
||||
- soap_server: prefer gzip to deflate, since IE does not like our deflate
|
||||
- soap_server: move webDescription to the wsdl class
|
||||
- soap_server: allow class and instance method calls for service (thanks Ingo Fischer and Roland Knall)
|
||||
- wsdl: get webDescription from the soap_server class
|
||||
- wsdl: allow compression from the server
|
||||
- wsdl: fix serialization of soapval without a type
|
||||
- wsdl: propagate debug value from query string to SOAP endpoint in programmatic WSDL generation
|
||||
- nusoap_base: add anyType, anySimpleType for 2001 XML Schema
|
||||
- nusoap_base: provide additional debug functions
|
||||
- soap_transport_http: ignore Content-Length when chunked encoding is used
|
||||
- soap_transport_http: remove ':' from username for Basic authentication (cf. RFC 2617)
|
||||
- soap_transport_http: urldecode username and password taken from URL
|
||||
- soap_transport_http: use raw inflate/deflate for IE/IIS compatibility, rather than having Zlib headers according to HTTP 1.1 spec
|
||||
- soap_transport_http: attempt to handle the case when both the service application and Web server compress the response
|
||||
- soapclient: when creating proxy methods, replace '.' in operation name with '__' in function name
|
||||
- soapclient: initialize requestHeaders in proxy
|
||||
- general: use new debug methods; never access debug_str directly
|
||||
|
||||
2004-09-30, version 0.6.8
|
||||
- soapclient: do not allow getProxy call when WSDL is not used
|
||||
- soapclient: use ISO-8859-1 as the charset if not specified in the Content-Type header
|
||||
- soapclient: when an empty string is specified for the call namespace, do not put the method element in a namespace
|
||||
- soapclient: let soap_transport_http check for SSL support
|
||||
- soapclient: have proxy inherit soap_defencoding from the client from which it is generated
|
||||
- soapclient: do not assume that 'ns1' is an unused namespace prefix; always generate namespace prefixes randomly
|
||||
- soap_parser: compare any encoding in the XML declaration to the charset from the HTTP Content-Type header (thanks Ingo Fischer)
|
||||
- soap_parser: improve parse repeated element name into an array (de-serializes doc/lit array into a PHP array when there is more than 1 array element)
|
||||
- soap_server: use ISO-8859-1 as the charset if not specified in the Content-Type header
|
||||
- soap_server: allow suppression of automatic UTF-8 decoding
|
||||
- soap_server: fix a bug when call_user_func_array() is used
|
||||
- soap_transport_http: correct digest authentication through a proxy
|
||||
- wsdl: serialize SOAP-ENC types similarly to XSD types
|
||||
- xmlschema: force unprefixed type into default namespace
|
||||
- xmlschema: fix serialization of definition of simple types
|
||||
|
||||
2004-10-01, version 0.6.8
|
||||
- soap_parser: handle default namespace attributes
|
||||
- soap_server: add default_utf8 field
|
||||
- soap_server: support literal encoding (with RPC style)
|
||||
- soap_transport_http: parse HTTP status and generate error for 300, 302-307, 400, 401-417, 501-505 (thanks for the idea Ghislain)
|
||||
- soap_transport_http: follow HTTP redirection (HTTP status 301 and Location header) (thanks for the idea Ghislain)
|
||||
- xmlschema: allow any attributes to be specified in an element of a complexType, e.g., abstract, default, form, minOccurs, maxOccurs, nillable (thanks Jirka Pech for the original patch)
|
||||
|
||||
2004-10-02, version 0.6.8
|
||||
- soapclient: read/write cookies (thanks Ingo)
|
||||
- soap_server: change faultcode on non-resendable faults to Client
|
||||
- soap_transport_http: read/write cookies (thanks Ingo)
|
||||
|
||||
2004-10-05, version 0.6.8
|
||||
- wsdl: add addElement method
|
||||
- wsdl: support the document style in the register method
|
||||
- xmlschema: parse unnamed simpleTypes, rather than ignoring them
|
||||
- xmlschema: include untyped elements when parsing a complexType
|
||||
- xmlschema: add addElement method
|
||||
|
||||
2004-10-14, version 0.6.8
|
||||
- soapclient: support client certificates
|
||||
- soap_parser: deserialize attributes, prefixing names with "!"
|
||||
- soap_server: notify the client with HTML when WSDL is requested but not supported by service
|
||||
- soap_transport_http: support client certificates
|
||||
- wsdl: support defaults for elements of a complexType
|
||||
- wsdl: serialize elements from complexType extension base
|
||||
- wsdl: serialize data (associative array elements) as attributes according to XML Schema
|
||||
- xmlschema: record extension base if present for a complexType
|
||||
|
||||
2004-12-15, version 0.6.8
|
||||
- nusoap_base: add 2000 XML Schema (rare, but used by Akamai)
|
||||
- soap_parser: avoid deserializing more common attributes that are not data
|
||||
- soap_parser: be lax when HTTP specifies ISO-8859-1 (the default) and XML specifies UTF-8 (the norm)
|
||||
- soap_server: account for the fact that get_class_methods returns methods in all lower case (thanks Steve Haldane)
|
||||
- soap_transport_http: parse digest info that includes '=' in the data (thanks Jinsuk Kim)
|
||||
- wsdl: feably handle some cases for literal serialization of form="unqualified" elements
|
||||
- wsdl: don't serialize the decimal portion of a PHP double when the XML type is long
|
||||
- wsdl: fix serialization of attributes for complexType that is an extension
|
||||
- wsdlcache: enhance diagnostics
|
||||
- xmlschema: handle untyped elements
|
||||
- xmlschema: handle WSDL for SOAP Array that uses the base attribute plus a sequence of element
|
||||
|
||||
2005-01-22, version 0.6.8
|
||||
- wsdl: allow an element in one schema to have a type from another schema
|
||||
|
||||
2005-01-24, version 0.6.8
|
||||
- xmlschema: correctly parse nested complexType definitions
|
||||
|
||||
2005-02-14, version 0.6.8
|
||||
- nusoap_base: fix a bug in which attributes were sometimes not serialized with a value
|
||||
- nusoap_base: improve serialization of null values (thanks Dominique Stender)
|
||||
- soap_parser: parse null values by handling the nil attribute (thanks Dominique Stender)
|
||||
- soap_server: set character encoding for a fault to be the same as for the server (thanks Mark Scott)
|
||||
- soap_server: correctly check for null value returned from method when WSDL is used (without WSDL, cannot distinguish whether NULL or void return is desired)
|
||||
- soapclient: for document style, call should always return an array rooted at the response part (all bets are off when there are multiple parts)
|
||||
- xmlschema: save enumeration values parsed from WSDL
|
||||
|
||||
2005-02-10, version 0.6.9
|
||||
- soapclient: only set SOAP headers when they are specified in call params (so setHeaders still works)
|
||||
|
||||
2005-04-04, version 0.6.9
|
||||
- soap_server: use get_class instead of is_a (thanks Thomas Noel)
|
||||
- soapclient: use get_class instead of is_a (thanks Thomas Noel)
|
||||
- soapclient: add setEndpoint method
|
||||
- soap_transport_http: fix client certificates (thanks Doug Anarino and Eryan Eriobowo)
|
||||
|
||||
2005-04-29, version 0.6.9
|
||||
- nusoap_base: add global variable and methods for setting debug level
|
||||
- nusoap_base: use xsd:anyType instead of xsd:ur-type to serialize arrays with multiple element types (thanks Ingo Fischer)
|
||||
- nusoap_base: expand entities in attributes (thanks Gaetano Giunta)
|
||||
- soapclient: call parent constructor
|
||||
- soapval: call parent constructor
|
||||
- soap_fault: call parent constructor
|
||||
- soap_parser: call parent constructor
|
||||
- soap_server: assume get_class_methods always returns lower case for PHP 4.x only
|
||||
- soap_server: call parent constructor
|
||||
- soap_transport_http: do nothing in setEncoding if gzdeflate is not present (thanks Franck Touanen for pointing this out)
|
||||
- soap_transport_http: fix check for server request for digest authentication (thanks Mark Spavin)
|
||||
- soap_transport_http: call parent constructor
|
||||
- wsdl: fix documentation page popup of one method after another (thanks Owen)
|
||||
- wsdl: call parent constructor
|
||||
- wsdl: expand entities in attributes (thanks Gaetano Giunta)
|
||||
- xmlschema: call parent constructor
|
||||
|
||||
2005-06-03, version 0.6.9
|
||||
- nusoap_base: serialize empty arrays as having elements xsd:anyType[0]
|
||||
- nusoap_base: add encodingStyle parameter to serializeEnvelope
|
||||
- nusoap_base: serialize xsi:type with nil values
|
||||
- nusoap_base: improve debug and comments
|
||||
- soap_parser: correctly parse an empty array to an empty array, not an empty string
|
||||
- soap_parser: improve debug and comments
|
||||
- soap_server: specify encodingStyle for envelope when WSDL is used
|
||||
- soapclient: factor out new getProxyClassCode method
|
||||
- soapclient: specify encodingStyle for envelope
|
||||
- soapclient: improve debug and comments
|
||||
- wsdl: add namespace for Apache SOAP types if a variable of such type is serialized
|
||||
- wsdl: serialize nil value for nillable elements when no value is provided
|
||||
- wsdl: serialize xsi:type with nil values
|
||||
- wsdl: copy attributes as well as elements to an element from its complexType
|
||||
- wsdl: specify encodingStyle for operations
|
||||
- wsdl: improve debug and comments
|
||||
- xmlschema: improve debug and comments
|
||||
|
||||
2005-06-03, version 0.7.0
|
||||
- nusoap_base: improve debug and comments
|
||||
- nusoap_base: fix version, which should have been 0.7.0 since 2005-03-04
|
||||
|
||||
2005-06-06, version 0.7.1
|
||||
- nusoap_base: adjust numeric element names for serialization, instead of forcing them to 'soapVal'
|
||||
- nusoapmime: add type=text/xml to multipart/related (thanks Emmanuel Cordonnier)
|
||||
- soap_fault: fix serialization of detail
|
||||
- soap_server: check required parameters for register method
|
||||
- soap_server: when getallheaders is used, massage header names
|
||||
- soap_server: use SOAPAction to determine operation when doc/lit service does not wrap parameters in an element with the method name (thanks Peter Hrastnik)
|
||||
- soap_transport_http: correctly handle multiple HTTP/1.1 100 responses for https (thanks Jan Slabon)
|
||||
- wsdl: fixed documentation for addComplexType (thanks Csintalan Ádám)
|
||||
- wsdl: serialize array data when maxOccurs = 'unbounded' OR maxOccurs > 1 (thanks Dominique Schreckling)
|
||||
- wsdl: when serializing a string == 'false' as a boolean, set the value to false
|
||||
- wsdl: when serializing a complexType, require the PHP value supplied to be an array
|
||||
|
||||
2005-07-01, version 0.7.1
|
||||
- nusoap_base: Allow SOAP headers to be supplied as an array like parameters
|
||||
- soap_parser: de-serialize simpleContent that accompanies complexContent
|
||||
- soap_server: append debug information when programmatically-defined WSDL is returned
|
||||
- soap_transport_http: Add debug when an outgoing header is set
|
||||
- soapclient: Allow SOAP headers to be supplied as an array like parameters
|
||||
- xmlschema: serialize attributes more generally, rather than assuming they are for SOAP 1.1 Array
|
||||
- wsdl: when serializing, look up types by namespace, not prefix (simple programmatic doc/lit WSDL now seems to work)
|
||||
- wsdl: process namespace declarations first when parsing an element
|
||||
|
||||
2005-07-27, version 0.7.1
|
||||
- nusoap_base: do not override supplied element name with class name when serializing an object in serialize_val
|
||||
- nusoap_base: remove http://soapinterop.org/xsd (si) from namespaces array
|
||||
- nusoapmime: add nusoapservermime class to implement MIME attachments on the server
|
||||
- soap_fault: improve documentation
|
||||
- soap_server: improve documentation
|
||||
- soap_server: make consistent use of _SERVER and HTTP_SERVER_VARS
|
||||
- soap_server: make all incoming HTTP header keys lower case
|
||||
- soap_server: add hook functions to support subclassing for MIME attachments
|
||||
- soap_transport_http: remove an unnecessary global statement
|
||||
- soapclient: when creating a proxy, make $params within each function an associative array
|
||||
- soapval: improve documentation
|
||||
- wsdl: when serializing complexType elements, used typed serialization if there is either a type or a reference for the element
|
||||
- wsdl: allow PHP objects to be serialized as SOAP structs in serializeType
|
||||
- wsdl: for WSDL and XML Schema imports, don't forget to use the TCP port number (thanks Luca GIOPPO)
|
||||
- wsdl: make consistent use of _SERVER and HTTP_SERVER_VARS
|
||||
- xmlschema: improve documentation
|
||||
|
||||
2005-07-31, version 0.7.2
|
||||
- nusoap_base: correctly serialize attributes in serialize_val (thanks Hidran Arias)
|
||||
- soap_parser: when resolving references, do not assume that buildVal returns an array (thanks Akshell)
|
||||
- soap_parser: removed decode_entities, which does not work (thanks Martin Sarsale)
|
||||
- soap_server: fix a bug parsing headers from _SERVER and HTTP_SERVER_VARS (thanks Bert Catsburg)
|
||||
- soap_server: parse all "headers" from HTTP_SERVER_VARS (not just HTTP_*)
|
||||
- soap_server: use PHP_SELF instead of SCRIPT_NAME for WSDL endpoint
|
||||
- soap_server: when generating a fault while debug_flag is true, put debug into faultdetail
|
||||
- wsdl: add enumeration parameter to addSimpleType
|
||||
- xmlschema: add enumeration parameter to addSimpleType
|
||||
2003-07-21, version 0.6.5
|
||||
- soap_transport_http: SOAPAction header is quoted again, fixes problem w/ Weblogic Server
|
||||
- applied Jason Levitt patch for proper array serialization, fixes problem w/ Amazon shopping cart services
|
||||
- fixed null value serialization
|
||||
- applied patch from "BZC ToOn'S" - fixes wsdl serialization when no parameters
|
||||
- applied John's patch, implementing compression for the server
|
||||
|
||||
2003-07-22, version 0.6.5
|
||||
- soap_server: fixed bug causing charset encoding not to be passed to the parser
|
||||
- soap_fault: added default encoding to the fault serialization
|
||||
- soap_parser: changed the parser to pre-load the parent's result array when processing scalar values. This increases parsing speed.
|
||||
|
||||
2003-07-23, version 0.6.5
|
||||
- soap_base: fix code that overwrites user-supplied attributes in serialize_val
|
||||
- soap_base: use arrays-of-arrays rather than attempting multi-dimensional in serialize_val
|
||||
- xmlschema: emit import statements and qualify all elements with prefix in serializeSchema (better interop with validation tools)
|
||||
- soapclient: get xml character encoding from HTTP Content-Type header if provided, e.g. text/xml;charset="UTF-8"
|
||||
- soapclient: use headers in call if provided (previously ignored this parameter)
|
||||
- soap_server: in parse_request, if neither getallheaders nor $_SERVER are available, use $HTTP_SERVER_VARS to get SOAPAction and xml encoding
|
||||
|
||||
2003-07-24, version 0.6.5
|
||||
- soap_transport_http: apply patch from Steven Brown "if the server closes connection prematurely, nusoap would spin trying to read data that isn't there"
|
||||
|
||||
2003-07-25, version 0.6.5
|
||||
- wsdl: apply patch from Sven to workaround single schema limitation
|
||||
- wsdl: apply a variant of the patch from Holger to handle empty values for array by serializing an array with 0 elements
|
||||
- xmlschema: remove the redundant default namespace attribute on the schema element; everything in xsd is explicitly specified as being from xsd
|
||||
- soap_transport_http: fix setCredentials and add TODO comments in sendHTTPS about what to change if this setCredentials stays
|
||||
|
||||
2003-07-30, version 0.6.5
|
||||
- nusoap_base: change documentation of soap_defencoding to specify it is the encoding for outgoing messages
|
||||
- nusoap_base: only change &, <, > to entities, not all HTML entities
|
||||
- soap_transport_http: update the Content-Type header in sendRequest, since soap_defencoding could be changed after ctor is called
|
||||
- soap_server: use soap_defencoding instead of charset_encoding
|
||||
- soap_server: read encoding from _SERVER if available
|
||||
- nusoap_base: do entity translation for string parameters with an xsd type specified (thanks David Derr)
|
||||
|
||||
2003-07-31, version 0.6.5
|
||||
- soap_transport_http: add proxy authentication
|
||||
- soap_transport_http: build payload the same way for http and https
|
||||
- wsdl: add proxy authentication
|
||||
- soapclient: add proxy authentication
|
||||
- soapclient: allow proxy information in ctor, so that it can be used for wsdl
|
||||
|
||||
2003-08-01, version 0.6.5
|
||||
- soap_transport_http: close a persistent connection that's at EOF
|
||||
- soap_transport_http: prevent conflicts between setEncoding and usePersistentConnection
|
||||
- soap_transport_http: fix use of $headers instead of $this->incoming_headers in getResponse
|
||||
- soapclient: improve handling of persistent connections
|
||||
- soapclient: force xml_encoding to upper case
|
||||
- soap_server: let the Web server decide whether to close the connection (no Connection: close header)
|
||||
- soap_server: force xml_encoding to upper case
|
||||
|
||||
2003-08-04, version 0.6.5
|
||||
- soap_parser: use XML type information to pick a PHP data type; also decode base64
|
||||
- soap_server: read all HTTP headers when using _SERVER or HTTP_SERVER_VARS
|
||||
- soap_server: add gzip encoding support for outgoing messages
|
||||
- soap_transport_http: deflate is gzcompress/gzuncompress (cf. http://archive.develooper.com/libwww@perl.org/msg04650.html)
|
||||
- soap_transport_http: clean use of persistentConnection so it's always a set boolean
|
||||
- soapclient: add responseData member to access deflated/gunzipped payload
|
||||
|
||||
2003-08-05, version 0.6.5
|
||||
- soap_server: look multiple places when setting debug_flag
|
||||
|
||||
2003-08-07, version 0.6.5
|
||||
- nusoap_base: serialize specified type (e.g. ArrayOfString) even for simple array
|
||||
- wsdl: only specify encodingStyle in the input/output soap bindings when it is not empty (thanks Guillaume)
|
||||
|
||||
2003-08-15, version 0.6.5
|
||||
- soap_parser: fix parsing of elements with no XSD type specified
|
||||
- soap_parser: use PHP string type for XSD long and unsignedLong types
|
||||
|
||||
2003-08-16, version 0.6.5
|
||||
- soap_parser: fix code generating warning (thanks Torsten)
|
||||
|
||||
2003-08-19, version 0.6.5
|
||||
- soap_parser: fix another line of code generating a warning (thanks Torsten)
|
||||
|
||||
2003-08-22, version 0.6.5
|
||||
- soap_server: remove all '--' from debug_str; previous code changed '---' to '- --'
|
||||
- wsdl, soapclient, soap_parser: patch submitted by Mark Spavin as described by
|
||||
the following...
|
||||
> Changes for the multiple/nested imports from the wsdl file. This builds an
|
||||
> array of files not just the last one and also checks for relative paths to
|
||||
> the parent. This will then get the imported files from the remote site
|
||||
> instead of your local disk. Local wsdl files should still work (untested).
|
||||
>
|
||||
> Changes for multiple encoding sytles as previously posted
|
||||
|
||||
2003-08-24, version 0.6.5
|
||||
- wsdl, soapclient: fix some PHP notices from previous update
|
||||
|
||||
2003-08-26, version 0.6.5
|
||||
- wsdl: support multiple SOAP ports
|
||||
- soapclient, soap_server: when no charset is specified, use UTF-8, even though HTTP specifies US-ASCII.
|
||||
- soap_transport_http: do not prepend $host with 'ssl://' for https (is this required for older cURL versions?)
|
||||
|
||||
2003-08-27, version 0.6.5
|
||||
- soap_server: support compressed request messages (thanks John Huong)
|
||||
- soap_parser: deserialize Apache Vector as an array
|
||||
- xmlschema: use $this->typemap in getPHPType (which is not used)
|
||||
- soapclient, wsdl: check for WSDL errors after serializing parameters
|
||||
- nusoap_base: add serialization of Apache Map (when not using WSDL)
|
||||
- wsdl: add serialization of Apache Map (when using WSDL)
|
||||
- wsdl: only change &, <, > to entities, not all HTML entities
|
||||
|
||||
2003-08-28, version 0.6.5
|
||||
- soap_transport_http: disable cURL verification of peer and server (formerly the cURL default)
|
||||
- soap_transport_http: mingle cURL code with straight http, so sendHTTP is no longer needed
|
||||
|
||||
2003-08-29, version 0.6.6
|
||||
- soap_transport_http: add setContentType
|
||||
- soapclient: call setContentType using new getHTTPContentType and getHTTPContentTypeCharset
|
||||
|
||||
2003-09-05, version 0.6.6
|
||||
- wsdl: add some more code to handle null/nil values (but there's still a way to go)
|
||||
|
||||
2003-10-21, version 0.6.6
|
||||
- soap_transport_http: only include port in Host header if it was specified in the URL
|
||||
- soap_transport_http: add some code to use OpenSSL for PHP ssl:// scheme, but comment out since it's not ready
|
||||
- soap_server: use $_SERVER['PHP_SELF'] if $GLOBALS['PHP_SELF'] is not set
|
||||
- wsdl: add WSDL request and response and transport debug to debug
|
||||
- wsdl: handle custom type extending xmlschema namespace (GLUE ... Thanks Matt)
|
||||
- soap_parser: add param to docs
|
||||
- soapclient: add getHTTPBody, getHTTPContentType, getHTTPContentTypeCharset (anticipating MIME subclass)
|
||||
|
||||
2003-10-28, version 0.6.6
|
||||
- nusoap_base: add expandEntities method
|
||||
- wsdl: use expandEntities
|
||||
- soap_fault: use expandEntities
|
||||
- soap_transport_http: Allow credentials to be included in URL, rather than requiring setCredentials
|
||||
- soap_transport_http: Merge HTTP headers that span multiple lines
|
||||
- soap_parser: Properly set errors in ctor
|
||||
- soapclient: Pass headers to parseResponse and parse them in that method
|
||||
|
||||
2003-10-30, version 0.6.6
|
||||
- xmlschema: Add some information for the related type to an element
|
||||
|
||||
2003-12-09, version 0.6.6
|
||||
- nusoap_base: Add some namespace methods previously in xmlschema
|
||||
- xmlschema: Improve parsing of complexType, element and simpleType
|
||||
- xmlschema: Improve serialization
|
||||
- xmlschema: Track imports
|
||||
- xmlschema: Track elementFormDefault and form attributes
|
||||
- wsdl: Support multiple <schema> (note that setting $server->wsdl->schemaTargetNamespace no longer does anything! Use configureWSDL instead.)
|
||||
- wsdl: Use form attribute of element to control namespace specification
|
||||
- wsdl: Support chained imports (A imports B which imports C)
|
||||
- wsdl: Include port in endpoint address when serializing
|
||||
- soap_server: Fix use of style (rpc|document) and use (encoded|literal)
|
||||
- soap_server: Support _SERVER[CONTENT_TYPE] in addition to _SERVER[HTTP_CONTENT_TYPE]
|
||||
- soap_server: Support wsdl with multiple <schema>
|
||||
- soap_client: Remove a var_dump
|
||||
- soap_client: Add style and use parameters to call method to support doc/lit without WSDL
|
||||
- soap_transport_http: Check that $this->fp exists when doing persistent connections
|
||||
|
||||
2003-12-17, version 0.6.6
|
||||
- soap_server: pass namespaces to xmlschema constructor
|
||||
- wsdl: post-process after all imports
|
||||
- wsdl: remove some debug, add some error handling
|
||||
- xmlschema: allow enclosing namespaces to be specified in constructor
|
||||
- xmlschema: improve handling of compositors and simple types
|
||||
|
||||
2004-01-08, version 0.6.6
|
||||
- soap_server: when requested WSDL is in a file, return to client using passthru (thanks Ingo Fischer)
|
||||
- soapclient: have proxy inherit more client state
|
||||
- soapclient: allow timeout and response timeout to be specified in the constructor
|
||||
- wsdl: allow timeout and response timeout to be specified in the constructor
|
||||
- soap_transport_http: allow response timeout to be specified in send and sendHTTPS
|
||||
|
||||
2004-01-28, version 0.6.6
|
||||
- wsdl: add namespace for array and scalar when form is qualified
|
||||
- wsdl: fix a bug in which data type of complexType elements were ignored in serialization
|
||||
- wsdl: enhance handling of URLs with file scheme
|
||||
- wsdl: add addSimpleType
|
||||
- xmlschema: add addSimpleType
|
||||
- xmlschema: always set phpType elements
|
||||
- soapclient: allow a wsdl instance to be specified in constructor
|
||||
- soap_server: allow a wsdl instance to be specified in constructor (not tested!)
|
||||
- soap_server: fix default SOAPAction created in register method
|
||||
- soap_transport_http: accept chunking with LF separators in addition to CRLF.
|
||||
- wsdlcache: added class
|
||||
- nusoapmime: fix comments
|
||||
|
||||
2004-02-23, version 0.6.6
|
||||
- soap_transport_http: don't try to unchunk cURL data, since cURL already does it
|
||||
- soap_transport_http: append CVS revision to version in User-Agent
|
||||
- wsdl: serialize boolean as true|false, not 1|0, to agree with XML Schema
|
||||
- soap_server: always exit() after returning WSDL
|
||||
- soap_server: use the WSDL URL scheme as the default endpoint URL scheme
|
||||
- soap_server: append CVS revision to version in X-SOAP-Server
|
||||
- nusoap_base: add (CVS) revision
|
||||
- wsdlcache: synchronize using a per-WSDL lock file (Thanks Ingo)
|
||||
- wsdlcache: add cache lifetime, after which cache contents are invalidated (Thanks Ingo)
|
||||
|
||||
2004-03-15, version 0.6.6
|
||||
- nusoap_base: add isArraySimpleOrStruct method
|
||||
- soap_server: improve WSDL URL scheme determination
|
||||
- soap_server: only deflate/gzip payloads > 1024 bytes
|
||||
- soap_server: fix parameter order in fault method (always used as faultcode, faultstring)
|
||||
- soap_server: refactor parse_request into multiple functions (for sanity)
|
||||
- soap_server: set the namespace on the Response element to the same as the request
|
||||
- soap_server: name the return value element 'return' by default
|
||||
- soap_server: added and documented data fields, so that service programmers can use them if desired
|
||||
- soap_parser: standardize parsing error message
|
||||
- soap_parser: fix document and responseHeaders so they are the correct XML text (as documented)
|
||||
- soap_transport_http: fix read from persistent connection
|
||||
- soapclient: clean up debugging for persistent connection
|
||||
- wsdl: enforce correct naming of messages parts when an associative array is used for parameters
|
||||
- wsdl: better serialization of null values
|
||||
- wsdl: standardize parsing error message
|
||||
- xmlschema: standardize parsing error message
|
||||
|
||||
2004-03-24, version 0.6.7
|
||||
- soap_transport_http: add digest authentication (based on code by Kevin A. Miller)
|
||||
- xmlschema: improve parsing of import elements
|
||||
- wsdl: do schema imports even if there are no wsdl imports
|
||||
|
||||
2004-04-12, version 0.6.7
|
||||
- wsdl: serialize multiple elements when maxOccurs="unbounded" and value is an array
|
||||
- wsdl: serialize soapval values (used to force an XML type, e.g. when WSDL uses an abstract type)
|
||||
- nusoapmime: do not require nusoap.php (it is now the programmer's responsibility)
|
||||
|
||||
2004-04-21, version 0.6.7
|
||||
- soap_parser: parse repeated element name into an array (de-serializes doc/lit array into a PHP array when there is more than 1 array element)
|
||||
- soap_server: do not wrap response in a response element for a document style service
|
||||
|
||||
2004-04-30, version 0.6.7
|
||||
- soap_transport_http: allow digest auth params to be separated by "," as well as ", "
|
||||
- soap_transport_http: re-initialize incoming headers for each response
|
||||
- soap_server: add methodreturnisliteralxml property to allow service function to return XML as a string
|
||||
- soapclient: improve rpc/literal support
|
||||
- soapclient: allow XML string as call params in addition to array
|
||||
- soapclient: support document style and literal encoding when not using WSDL
|
||||
|
||||
2004-05-05, version 0.6.7
|
||||
- wsdl: serialize PHP objects for WSDL XML Schema complexTypes, in addition to associative arrays
|
||||
- wsdl: fix WSDL generation when there is no encodingStyle
|
||||
- soap_transport_http: suppress fsockopen warnings
|
||||
- soap_transport_http: detect socket timeouts when reading (0 bytes returned)
|
||||
- soap_transport_http: read chunked content "in-line" so it works on a persistent connection
|
||||
- nusoap_base: serialize boolean as true|false, not 1|0, to agree with XML Schema
|
||||
- nusoap_base: serialize array of struct differently than array of array
|
||||
|
||||
2004-06-25, version 0.6.8
|
||||
- soap_server: prefer gzip to deflate, since IE does not like our deflate
|
||||
- soap_server: move webDescription to the wsdl class
|
||||
- soap_server: allow class and instance method calls for service (thanks Ingo Fischer and Roland Knall)
|
||||
- wsdl: get webDescription from the soap_server class
|
||||
- wsdl: allow compression from the server
|
||||
- wsdl: fix serialization of soapval without a type
|
||||
- wsdl: propagate debug value from query string to SOAP endpoint in programmatic WSDL generation
|
||||
- nusoap_base: add anyType, anySimpleType for 2001 XML Schema
|
||||
- nusoap_base: provide additional debug functions
|
||||
- soap_transport_http: ignore Content-Length when chunked encoding is used
|
||||
- soap_transport_http: remove ':' from username for Basic authentication (cf. RFC 2617)
|
||||
- soap_transport_http: urldecode username and password taken from URL
|
||||
- soap_transport_http: use raw inflate/deflate for IE/IIS compatibility, rather than having Zlib headers according to HTTP 1.1 spec
|
||||
- soap_transport_http: attempt to handle the case when both the service application and Web server compress the response
|
||||
- soapclient: when creating proxy methods, replace '.' in operation name with '__' in function name
|
||||
- soapclient: initialize requestHeaders in proxy
|
||||
- general: use new debug methods; never access debug_str directly
|
||||
|
||||
2004-09-30, version 0.6.8
|
||||
- soapclient: do not allow getProxy call when WSDL is not used
|
||||
- soapclient: use ISO-8859-1 as the charset if not specified in the Content-Type header
|
||||
- soapclient: when an empty string is specified for the call namespace, do not put the method element in a namespace
|
||||
- soapclient: let soap_transport_http check for SSL support
|
||||
- soapclient: have proxy inherit soap_defencoding from the client from which it is generated
|
||||
- soapclient: do not assume that 'ns1' is an unused namespace prefix; always generate namespace prefixes randomly
|
||||
- soap_parser: compare any encoding in the XML declaration to the charset from the HTTP Content-Type header (thanks Ingo Fischer)
|
||||
- soap_parser: improve parse repeated element name into an array (de-serializes doc/lit array into a PHP array when there is more than 1 array element)
|
||||
- soap_server: use ISO-8859-1 as the charset if not specified in the Content-Type header
|
||||
- soap_server: allow suppression of automatic UTF-8 decoding
|
||||
- soap_server: fix a bug when call_user_func_array() is used
|
||||
- soap_transport_http: correct digest authentication through a proxy
|
||||
- wsdl: serialize SOAP-ENC types similarly to XSD types
|
||||
- xmlschema: force unprefixed type into default namespace
|
||||
- xmlschema: fix serialization of definition of simple types
|
||||
|
||||
2004-10-01, version 0.6.8
|
||||
- soap_parser: handle default namespace attributes
|
||||
- soap_server: add default_utf8 field
|
||||
- soap_server: support literal encoding (with RPC style)
|
||||
- soap_transport_http: parse HTTP status and generate error for 300, 302-307, 400, 401-417, 501-505 (thanks for the idea Ghislain)
|
||||
- soap_transport_http: follow HTTP redirection (HTTP status 301 and Location header) (thanks for the idea Ghislain)
|
||||
- xmlschema: allow any attributes to be specified in an element of a complexType, e.g., abstract, default, form, minOccurs, maxOccurs, nillable (thanks Jirka Pech for the original patch)
|
||||
|
||||
2004-10-02, version 0.6.8
|
||||
- soapclient: read/write cookies (thanks Ingo)
|
||||
- soap_server: change faultcode on non-resendable faults to Client
|
||||
- soap_transport_http: read/write cookies (thanks Ingo)
|
||||
|
||||
2004-10-05, version 0.6.8
|
||||
- wsdl: add addElement method
|
||||
- wsdl: support the document style in the register method
|
||||
- xmlschema: parse unnamed simpleTypes, rather than ignoring them
|
||||
- xmlschema: include untyped elements when parsing a complexType
|
||||
- xmlschema: add addElement method
|
||||
|
||||
2004-10-14, version 0.6.8
|
||||
- soapclient: support client certificates
|
||||
- soap_parser: deserialize attributes, prefixing names with "!"
|
||||
- soap_server: notify the client with HTML when WSDL is requested but not supported by service
|
||||
- soap_transport_http: support client certificates
|
||||
- wsdl: support defaults for elements of a complexType
|
||||
- wsdl: serialize elements from complexType extension base
|
||||
- wsdl: serialize data (associative array elements) as attributes according to XML Schema
|
||||
- xmlschema: record extension base if present for a complexType
|
||||
|
||||
2004-12-15, version 0.6.8
|
||||
- nusoap_base: add 2000 XML Schema (rare, but used by Akamai)
|
||||
- soap_parser: avoid deserializing more common attributes that are not data
|
||||
- soap_parser: be lax when HTTP specifies ISO-8859-1 (the default) and XML specifies UTF-8 (the norm)
|
||||
- soap_server: account for the fact that get_class_methods returns methods in all lower case (thanks Steve Haldane)
|
||||
- soap_transport_http: parse digest info that includes '=' in the data (thanks Jinsuk Kim)
|
||||
- wsdl: feably handle some cases for literal serialization of form="unqualified" elements
|
||||
- wsdl: don't serialize the decimal portion of a PHP double when the XML type is long
|
||||
- wsdl: fix serialization of attributes for complexType that is an extension
|
||||
- wsdlcache: enhance diagnostics
|
||||
- xmlschema: handle untyped elements
|
||||
- xmlschema: handle WSDL for SOAP Array that uses the base attribute plus a sequence of element
|
||||
|
||||
2005-01-22, version 0.6.8
|
||||
- wsdl: allow an element in one schema to have a type from another schema
|
||||
|
||||
2005-01-24, version 0.6.8
|
||||
- xmlschema: correctly parse nested complexType definitions
|
||||
|
||||
2005-02-14, version 0.6.8
|
||||
- nusoap_base: fix a bug in which attributes were sometimes not serialized with a value
|
||||
- nusoap_base: improve serialization of null values (thanks Dominique Stender)
|
||||
- soap_parser: parse null values by handling the nil attribute (thanks Dominique Stender)
|
||||
- soap_server: set character encoding for a fault to be the same as for the server (thanks Mark Scott)
|
||||
- soap_server: correctly check for null value returned from method when WSDL is used (without WSDL, cannot distinguish whether NULL or void return is desired)
|
||||
- soapclient: for document style, call should always return an array rooted at the response part (all bets are off when there are multiple parts)
|
||||
- xmlschema: save enumeration values parsed from WSDL
|
||||
|
||||
2005-02-10, version 0.6.9
|
||||
- soapclient: only set SOAP headers when they are specified in call params (so setHeaders still works)
|
||||
|
||||
2005-04-04, version 0.6.9
|
||||
- soap_server: use get_class instead of is_a (thanks Thomas Noel)
|
||||
- soapclient: use get_class instead of is_a (thanks Thomas Noel)
|
||||
- soapclient: add setEndpoint method
|
||||
- soap_transport_http: fix client certificates (thanks Doug Anarino and Eryan Eriobowo)
|
||||
|
||||
2005-04-29, version 0.6.9
|
||||
- nusoap_base: add global variable and methods for setting debug level
|
||||
- nusoap_base: use xsd:anyType instead of xsd:ur-type to serialize arrays with multiple element types (thanks Ingo Fischer)
|
||||
- nusoap_base: expand entities in attributes (thanks Gaetano Giunta)
|
||||
- soapclient: call parent constructor
|
||||
- soapval: call parent constructor
|
||||
- soap_fault: call parent constructor
|
||||
- soap_parser: call parent constructor
|
||||
- soap_server: assume get_class_methods always returns lower case for PHP 4.x only
|
||||
- soap_server: call parent constructor
|
||||
- soap_transport_http: do nothing in setEncoding if gzdeflate is not present (thanks Franck Touanen for pointing this out)
|
||||
- soap_transport_http: fix check for server request for digest authentication (thanks Mark Spavin)
|
||||
- soap_transport_http: call parent constructor
|
||||
- wsdl: fix documentation page popup of one method after another (thanks Owen)
|
||||
- wsdl: call parent constructor
|
||||
- wsdl: expand entities in attributes (thanks Gaetano Giunta)
|
||||
- xmlschema: call parent constructor
|
||||
|
||||
2005-06-03, version 0.6.9
|
||||
- nusoap_base: serialize empty arrays as having elements xsd:anyType[0]
|
||||
- nusoap_base: add encodingStyle parameter to serializeEnvelope
|
||||
- nusoap_base: serialize xsi:type with nil values
|
||||
- nusoap_base: improve debug and comments
|
||||
- soap_parser: correctly parse an empty array to an empty array, not an empty string
|
||||
- soap_parser: improve debug and comments
|
||||
- soap_server: specify encodingStyle for envelope when WSDL is used
|
||||
- soapclient: factor out new getProxyClassCode method
|
||||
- soapclient: specify encodingStyle for envelope
|
||||
- soapclient: improve debug and comments
|
||||
- wsdl: add namespace for Apache SOAP types if a variable of such type is serialized
|
||||
- wsdl: serialize nil value for nillable elements when no value is provided
|
||||
- wsdl: serialize xsi:type with nil values
|
||||
- wsdl: copy attributes as well as elements to an element from its complexType
|
||||
- wsdl: specify encodingStyle for operations
|
||||
- wsdl: improve debug and comments
|
||||
- xmlschema: improve debug and comments
|
||||
|
||||
2005-06-03, version 0.7.0
|
||||
- nusoap_base: improve debug and comments
|
||||
- nusoap_base: fix version, which should have been 0.7.0 since 2005-03-04
|
||||
|
||||
2005-06-06, version 0.7.1
|
||||
- nusoap_base: adjust numeric element names for serialization, instead of forcing them to 'soapVal'
|
||||
- nusoapmime: add type=text/xml to multipart/related (thanks Emmanuel Cordonnier)
|
||||
- soap_fault: fix serialization of detail
|
||||
- soap_server: check required parameters for register method
|
||||
- soap_server: when getallheaders is used, massage header names
|
||||
- soap_server: use SOAPAction to determine operation when doc/lit service does not wrap parameters in an element with the method name (thanks Peter Hrastnik)
|
||||
- soap_transport_http: correctly handle multiple HTTP/1.1 100 responses for https (thanks Jan Slabon)
|
||||
- wsdl: fixed documentation for addComplexType (thanks Csintalan Ádám)
|
||||
- wsdl: serialize array data when maxOccurs = 'unbounded' OR maxOccurs > 1 (thanks Dominique Schreckling)
|
||||
- wsdl: when serializing a string == 'false' as a boolean, set the value to false
|
||||
- wsdl: when serializing a complexType, require the PHP value supplied to be an array
|
||||
|
||||
2005-07-01, version 0.7.1
|
||||
- nusoap_base: Allow SOAP headers to be supplied as an array like parameters
|
||||
- soap_parser: de-serialize simpleContent that accompanies complexContent
|
||||
- soap_server: append debug information when programmatically-defined WSDL is returned
|
||||
- soap_transport_http: Add debug when an outgoing header is set
|
||||
- soapclient: Allow SOAP headers to be supplied as an array like parameters
|
||||
- xmlschema: serialize attributes more generally, rather than assuming they are for SOAP 1.1 Array
|
||||
- wsdl: when serializing, look up types by namespace, not prefix (simple programmatic doc/lit WSDL now seems to work)
|
||||
- wsdl: process namespace declarations first when parsing an element
|
||||
|
||||
2005-07-27, version 0.7.1
|
||||
- nusoap_base: do not override supplied element name with class name when serializing an object in serialize_val
|
||||
- nusoap_base: remove http://soapinterop.org/xsd (si) from namespaces array
|
||||
- nusoapmime: add nusoapservermime class to implement MIME attachments on the server
|
||||
- soap_fault: improve documentation
|
||||
- soap_server: improve documentation
|
||||
- soap_server: make consistent use of _SERVER and HTTP_SERVER_VARS
|
||||
- soap_server: make all incoming HTTP header keys lower case
|
||||
- soap_server: add hook functions to support subclassing for MIME attachments
|
||||
- soap_transport_http: remove an unnecessary global statement
|
||||
- soapclient: when creating a proxy, make $params within each function an associative array
|
||||
- soapval: improve documentation
|
||||
- wsdl: when serializing complexType elements, used typed serialization if there is either a type or a reference for the element
|
||||
- wsdl: allow PHP objects to be serialized as SOAP structs in serializeType
|
||||
- wsdl: for WSDL and XML Schema imports, don't forget to use the TCP port number (thanks Luca GIOPPO)
|
||||
- wsdl: make consistent use of _SERVER and HTTP_SERVER_VARS
|
||||
- xmlschema: improve documentation
|
||||
|
||||
2005-07-31, version 0.7.2
|
||||
- nusoap_base: correctly serialize attributes in serialize_val (thanks Hidran Arias)
|
||||
- soap_parser: when resolving references, do not assume that buildVal returns an array (thanks Akshell)
|
||||
- soap_parser: removed decode_entities, which does not work (thanks Martin Sarsale)
|
||||
- soap_server: fix a bug parsing headers from _SERVER and HTTP_SERVER_VARS (thanks Bert Catsburg)
|
||||
- soap_server: parse all "headers" from HTTP_SERVER_VARS (not just HTTP_*)
|
||||
- soap_server: use PHP_SELF instead of SCRIPT_NAME for WSDL endpoint
|
||||
- soap_server: when generating a fault while debug_flag is true, put debug into faultdetail
|
||||
- wsdl: add enumeration parameter to addSimpleType
|
||||
- xmlschema: add enumeration parameter to addSimpleType
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,86 +1,86 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Contains information for a SOAP fault.
|
||||
* Mainly used for returning faults from deployed functions
|
||||
* in a server instance.
|
||||
* @author Dietrich Ayala <dietrich@ganx4.com>
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class soap_fault extends nusoap_base {
|
||||
/**
|
||||
* The fault code (client|server)
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $faultcode;
|
||||
/**
|
||||
* The fault actor
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $faultactor;
|
||||
/**
|
||||
* The fault string, a description of the fault
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $faultstring;
|
||||
/**
|
||||
* The fault detail, typically a string or array of string
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $faultdetail;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $faultcode (client | server)
|
||||
* @param string $faultactor only used when msg routed between multiple actors
|
||||
* @param string $faultstring human readable error message
|
||||
* @param mixed $faultdetail detail, typically a string or array of string
|
||||
*/
|
||||
function soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
|
||||
parent::nusoap_base();
|
||||
$this->faultcode = $faultcode;
|
||||
$this->faultactor = $faultactor;
|
||||
$this->faultstring = $faultstring;
|
||||
$this->faultdetail = $faultdetail;
|
||||
}
|
||||
|
||||
/**
|
||||
* serialize a fault
|
||||
*
|
||||
* @return string The serialization of the fault instance.
|
||||
* @access public
|
||||
*/
|
||||
function serialize(){
|
||||
$ns_string = '';
|
||||
foreach($this->namespaces as $k => $v){
|
||||
$ns_string .= "\n xmlns:$k=\"$v\"";
|
||||
}
|
||||
$return_msg =
|
||||
'<?xml version="1.0" encoding="'.$this->soap_defencoding.'"?>'.
|
||||
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n".
|
||||
'<SOAP-ENV:Body>'.
|
||||
'<SOAP-ENV:Fault>'.
|
||||
$this->serialize_val($this->faultcode, 'faultcode').
|
||||
$this->serialize_val($this->faultactor, 'faultactor').
|
||||
$this->serialize_val($this->faultstring, 'faultstring').
|
||||
$this->serialize_val($this->faultdetail, 'detail').
|
||||
'</SOAP-ENV:Fault>'.
|
||||
'</SOAP-ENV:Body>'.
|
||||
'</SOAP-ENV:Envelope>';
|
||||
return $return_msg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Contains information for a SOAP fault.
|
||||
* Mainly used for returning faults from deployed functions
|
||||
* in a server instance.
|
||||
* @author Dietrich Ayala <dietrich@ganx4.com>
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class soap_fault extends nusoap_base {
|
||||
/**
|
||||
* The fault code (client|server)
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $faultcode;
|
||||
/**
|
||||
* The fault actor
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $faultactor;
|
||||
/**
|
||||
* The fault string, a description of the fault
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $faultstring;
|
||||
/**
|
||||
* The fault detail, typically a string or array of string
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $faultdetail;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $faultcode (client | server)
|
||||
* @param string $faultactor only used when msg routed between multiple actors
|
||||
* @param string $faultstring human readable error message
|
||||
* @param mixed $faultdetail detail, typically a string or array of string
|
||||
*/
|
||||
function soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
|
||||
parent::nusoap_base();
|
||||
$this->faultcode = $faultcode;
|
||||
$this->faultactor = $faultactor;
|
||||
$this->faultstring = $faultstring;
|
||||
$this->faultdetail = $faultdetail;
|
||||
}
|
||||
|
||||
/**
|
||||
* serialize a fault
|
||||
*
|
||||
* @return string The serialization of the fault instance.
|
||||
* @access public
|
||||
*/
|
||||
function serialize(){
|
||||
$ns_string = '';
|
||||
foreach($this->namespaces as $k => $v){
|
||||
$ns_string .= "\n xmlns:$k=\"$v\"";
|
||||
}
|
||||
$return_msg =
|
||||
'<?xml version="1.0" encoding="'.$this->soap_defencoding.'"?>'.
|
||||
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n".
|
||||
'<SOAP-ENV:Body>'.
|
||||
'<SOAP-ENV:Fault>'.
|
||||
$this->serialize_val($this->faultcode, 'faultcode').
|
||||
$this->serialize_val($this->faultactor, 'faultactor').
|
||||
$this->serialize_val($this->faultstring, 'faultstring').
|
||||
$this->serialize_val($this->faultdetail, 'detail').
|
||||
'</SOAP-ENV:Fault>'.
|
||||
'</SOAP-ENV:Body>'.
|
||||
'</SOAP-ENV:Envelope>';
|
||||
return $return_msg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,107 +1,107 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* For creating serializable abstractions of native PHP types. This class
|
||||
* allows element name/namespace, XSD type, and XML attributes to be
|
||||
* associated with a value. This is extremely useful when WSDL is not
|
||||
* used, but is also useful when WSDL is used with polymorphic types, including
|
||||
* xsd:anyType and user-defined types.
|
||||
*
|
||||
* @author Dietrich Ayala <dietrich@ganx4.com>
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class soapval extends nusoap_base {
|
||||
/**
|
||||
* The XML element name
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $name;
|
||||
/**
|
||||
* The XML type name (string or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $type;
|
||||
/**
|
||||
* The PHP value
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $value;
|
||||
/**
|
||||
* The XML element namespace (string or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $element_ns;
|
||||
/**
|
||||
* The XML type namespace (string or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $type_ns;
|
||||
/**
|
||||
* The XML element attributes (array or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $attributes;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $name optional name
|
||||
* @param mixed $type optional type name
|
||||
* @param mixed $value optional value
|
||||
* @param mixed $element_ns optional namespace of value
|
||||
* @param mixed $type_ns optional namespace of type
|
||||
* @param mixed $attributes associative array of attributes to add to element serialization
|
||||
* @access public
|
||||
*/
|
||||
function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
|
||||
parent::nusoap_base();
|
||||
$this->name = $name;
|
||||
$this->type = $type;
|
||||
$this->value = $value;
|
||||
$this->element_ns = $element_ns;
|
||||
$this->type_ns = $type_ns;
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* return serialized value
|
||||
*
|
||||
* @param string $use The WSDL use value (encoded|literal)
|
||||
* @return string XML data
|
||||
* @access public
|
||||
*/
|
||||
function serialize($use='encoded') {
|
||||
return $this->serialize_val($this->value,$this->name,$this->type,$this->element_ns,$this->type_ns,$this->attributes,$use);
|
||||
}
|
||||
|
||||
/**
|
||||
* decodes a soapval object into a PHP native type
|
||||
*
|
||||
* @return mixed
|
||||
* @access public
|
||||
*/
|
||||
function decode(){
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* For creating serializable abstractions of native PHP types. This class
|
||||
* allows element name/namespace, XSD type, and XML attributes to be
|
||||
* associated with a value. This is extremely useful when WSDL is not
|
||||
* used, but is also useful when WSDL is used with polymorphic types, including
|
||||
* xsd:anyType and user-defined types.
|
||||
*
|
||||
* @author Dietrich Ayala <dietrich@ganx4.com>
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class soapval extends nusoap_base {
|
||||
/**
|
||||
* The XML element name
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $name;
|
||||
/**
|
||||
* The XML type name (string or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $type;
|
||||
/**
|
||||
* The PHP value
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $value;
|
||||
/**
|
||||
* The XML element namespace (string or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $element_ns;
|
||||
/**
|
||||
* The XML type namespace (string or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $type_ns;
|
||||
/**
|
||||
* The XML element attributes (array or false)
|
||||
*
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $attributes;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $name optional name
|
||||
* @param mixed $type optional type name
|
||||
* @param mixed $value optional value
|
||||
* @param mixed $element_ns optional namespace of value
|
||||
* @param mixed $type_ns optional namespace of type
|
||||
* @param mixed $attributes associative array of attributes to add to element serialization
|
||||
* @access public
|
||||
*/
|
||||
function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
|
||||
parent::nusoap_base();
|
||||
$this->name = $name;
|
||||
$this->type = $type;
|
||||
$this->value = $value;
|
||||
$this->element_ns = $element_ns;
|
||||
$this->type_ns = $type_ns;
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* return serialized value
|
||||
*
|
||||
* @param string $use The WSDL use value (encoded|literal)
|
||||
* @return string XML data
|
||||
* @access public
|
||||
*/
|
||||
function serialize($use='encoded') {
|
||||
return $this->serialize_val($this->value,$this->name,$this->type,$this->element_ns,$this->type_ns,$this->attributes,$use);
|
||||
}
|
||||
|
||||
/**
|
||||
* decodes a soapval object into a PHP native type
|
||||
*
|
||||
* @return mixed
|
||||
* @access public
|
||||
*/
|
||||
function decode(){
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,184 +1,184 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* caches instances of the wsdl class
|
||||
*
|
||||
* @author Scott Nichol <snichol@computer.org>
|
||||
* @author Ingo Fischer <ingo@apollon.de>
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class wsdlcache {
|
||||
/**
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
var $fplock;
|
||||
/**
|
||||
* @var integer
|
||||
* @access private
|
||||
*/
|
||||
var $cache_lifetime;
|
||||
/**
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $cache_dir;
|
||||
/**
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $debug_str = '';
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $cache_dir directory for cache-files
|
||||
* @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited
|
||||
* @access public
|
||||
*/
|
||||
function wsdlcache($cache_dir='.', $cache_lifetime=0) {
|
||||
$this->fplock = array();
|
||||
$this->cache_dir = $cache_dir != '' ? $cache_dir : '.';
|
||||
$this->cache_lifetime = $cache_lifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* creates the filename used to cache a wsdl instance
|
||||
*
|
||||
* @param string $wsdl The URL of the wsdl instance
|
||||
* @return string The filename used to cache the instance
|
||||
* @access private
|
||||
*/
|
||||
function createFilename($wsdl) {
|
||||
return $this->cache_dir.'/wsdlcache-' . md5($wsdl);
|
||||
}
|
||||
|
||||
/**
|
||||
* adds debug data to the class level debug string
|
||||
*
|
||||
* @param string $string debug data
|
||||
* @access private
|
||||
*/
|
||||
function debug($string){
|
||||
$this->debug_str .= get_class($this).": $string\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a wsdl instance from the cache
|
||||
*
|
||||
* @param string $wsdl The URL of the wsdl instance
|
||||
* @return object wsdl The cached wsdl instance, null if the instance is not in the cache
|
||||
* @access public
|
||||
*/
|
||||
function get($wsdl) {
|
||||
$filename = $this->createFilename($wsdl);
|
||||
if ($this->obtainMutex($filename, "r")) {
|
||||
// check for expired WSDL that must be removed from the cache
|
||||
if ($this->cache_lifetime > 0) {
|
||||
if (file_exists($filename) && (time() - filemtime($filename) > $this->cache_lifetime)) {
|
||||
unlink($filename);
|
||||
$this->debug("Expired $wsdl ($filename) from cache");
|
||||
$this->releaseMutex($filename);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// see what there is to return
|
||||
$fp = @fopen($filename, "r");
|
||||
if ($fp) {
|
||||
$s = implode("", @file($filename));
|
||||
fclose($fp);
|
||||
$this->debug("Got $wsdl ($filename) from cache");
|
||||
} else {
|
||||
$s = null;
|
||||
$this->debug("$wsdl ($filename) not in cache");
|
||||
}
|
||||
$this->releaseMutex($filename);
|
||||
return (!is_null($s)) ? unserialize($s) : null;
|
||||
} else {
|
||||
$this->debug("Unable to obtain mutex for $filename in get");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* obtains the local mutex
|
||||
*
|
||||
* @param string $filename The Filename of the Cache to lock
|
||||
* @param string $mode The open-mode ("r" or "w") or the file - affects lock-mode
|
||||
* @return boolean Lock successfully obtained ?!
|
||||
* @access private
|
||||
*/
|
||||
function obtainMutex($filename, $mode) {
|
||||
if (isset($this->fplock[md5($filename)])) {
|
||||
$this->debug("Lock for $filename already exists");
|
||||
return false;
|
||||
}
|
||||
$this->fplock[md5($filename)] = fopen($filename.".lock", "w");
|
||||
if ($mode == "r") {
|
||||
return flock($this->fplock[md5($filename)], LOCK_SH);
|
||||
} else {
|
||||
return flock($this->fplock[md5($filename)], LOCK_EX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a wsdl instance to the cache
|
||||
*
|
||||
* @param object wsdl $wsdl_instance The wsdl instance to add
|
||||
* @return boolean WSDL successfully cached
|
||||
* @access public
|
||||
*/
|
||||
function put($wsdl_instance) {
|
||||
$filename = $this->createFilename($wsdl_instance->wsdl);
|
||||
$s = serialize($wsdl_instance);
|
||||
if ($this->obtainMutex($filename, "w")) {
|
||||
$fp = fopen($filename, "w");
|
||||
fputs($fp, $s);
|
||||
fclose($fp);
|
||||
$this->debug("Put $wsdl_instance->wsdl ($filename) in cache");
|
||||
$this->releaseMutex($filename);
|
||||
return true;
|
||||
} else {
|
||||
$this->debug("Unable to obtain mutex for $filename in put");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* releases the local mutex
|
||||
*
|
||||
* @param string $filename The Filename of the Cache to lock
|
||||
* @return boolean Lock successfully released
|
||||
* @access private
|
||||
*/
|
||||
function releaseMutex($filename) {
|
||||
$ret = flock($this->fplock[md5($filename)], LOCK_UN);
|
||||
fclose($this->fplock[md5($filename)]);
|
||||
unset($this->fplock[md5($filename)]);
|
||||
if (! $ret) {
|
||||
$this->debug("Not able to release lock for $filename");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* removes a wsdl instance from the cache
|
||||
*
|
||||
* @param string $wsdl The URL of the wsdl instance
|
||||
* @return boolean Whether there was an instance to remove
|
||||
* @access public
|
||||
*/
|
||||
function remove($wsdl) {
|
||||
$filename = $this->createFilename($wsdl);
|
||||
// ignore errors obtaining mutex
|
||||
$this->obtainMutex($filename, "w");
|
||||
$ret = unlink($filename);
|
||||
$this->debug("Removed ($ret) $wsdl ($filename) from cache");
|
||||
$this->releaseMutex($filename);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* caches instances of the wsdl class
|
||||
*
|
||||
* @author Scott Nichol <snichol@computer.org>
|
||||
* @author Ingo Fischer <ingo@apollon.de>
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class wsdlcache {
|
||||
/**
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
var $fplock;
|
||||
/**
|
||||
* @var integer
|
||||
* @access private
|
||||
*/
|
||||
var $cache_lifetime;
|
||||
/**
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $cache_dir;
|
||||
/**
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $debug_str = '';
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $cache_dir directory for cache-files
|
||||
* @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited
|
||||
* @access public
|
||||
*/
|
||||
function wsdlcache($cache_dir='.', $cache_lifetime=0) {
|
||||
$this->fplock = array();
|
||||
$this->cache_dir = $cache_dir != '' ? $cache_dir : '.';
|
||||
$this->cache_lifetime = $cache_lifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* creates the filename used to cache a wsdl instance
|
||||
*
|
||||
* @param string $wsdl The URL of the wsdl instance
|
||||
* @return string The filename used to cache the instance
|
||||
* @access private
|
||||
*/
|
||||
function createFilename($wsdl) {
|
||||
return $this->cache_dir.'/wsdlcache-' . md5($wsdl);
|
||||
}
|
||||
|
||||
/**
|
||||
* adds debug data to the class level debug string
|
||||
*
|
||||
* @param string $string debug data
|
||||
* @access private
|
||||
*/
|
||||
function debug($string){
|
||||
$this->debug_str .= get_class($this).": $string\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a wsdl instance from the cache
|
||||
*
|
||||
* @param string $wsdl The URL of the wsdl instance
|
||||
* @return object wsdl The cached wsdl instance, null if the instance is not in the cache
|
||||
* @access public
|
||||
*/
|
||||
function get($wsdl) {
|
||||
$filename = $this->createFilename($wsdl);
|
||||
if ($this->obtainMutex($filename, "r")) {
|
||||
// check for expired WSDL that must be removed from the cache
|
||||
if ($this->cache_lifetime > 0) {
|
||||
if (file_exists($filename) && (time() - filemtime($filename) > $this->cache_lifetime)) {
|
||||
unlink($filename);
|
||||
$this->debug("Expired $wsdl ($filename) from cache");
|
||||
$this->releaseMutex($filename);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// see what there is to return
|
||||
$fp = @fopen($filename, "r");
|
||||
if ($fp) {
|
||||
$s = implode("", @file($filename));
|
||||
fclose($fp);
|
||||
$this->debug("Got $wsdl ($filename) from cache");
|
||||
} else {
|
||||
$s = null;
|
||||
$this->debug("$wsdl ($filename) not in cache");
|
||||
}
|
||||
$this->releaseMutex($filename);
|
||||
return (!is_null($s)) ? unserialize($s) : null;
|
||||
} else {
|
||||
$this->debug("Unable to obtain mutex for $filename in get");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* obtains the local mutex
|
||||
*
|
||||
* @param string $filename The Filename of the Cache to lock
|
||||
* @param string $mode The open-mode ("r" or "w") or the file - affects lock-mode
|
||||
* @return boolean Lock successfully obtained ?!
|
||||
* @access private
|
||||
*/
|
||||
function obtainMutex($filename, $mode) {
|
||||
if (isset($this->fplock[md5($filename)])) {
|
||||
$this->debug("Lock for $filename already exists");
|
||||
return false;
|
||||
}
|
||||
$this->fplock[md5($filename)] = fopen($filename.".lock", "w");
|
||||
if ($mode == "r") {
|
||||
return flock($this->fplock[md5($filename)], LOCK_SH);
|
||||
} else {
|
||||
return flock($this->fplock[md5($filename)], LOCK_EX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a wsdl instance to the cache
|
||||
*
|
||||
* @param object wsdl $wsdl_instance The wsdl instance to add
|
||||
* @return boolean WSDL successfully cached
|
||||
* @access public
|
||||
*/
|
||||
function put($wsdl_instance) {
|
||||
$filename = $this->createFilename($wsdl_instance->wsdl);
|
||||
$s = serialize($wsdl_instance);
|
||||
if ($this->obtainMutex($filename, "w")) {
|
||||
$fp = fopen($filename, "w");
|
||||
fputs($fp, $s);
|
||||
fclose($fp);
|
||||
$this->debug("Put $wsdl_instance->wsdl ($filename) in cache");
|
||||
$this->releaseMutex($filename);
|
||||
return true;
|
||||
} else {
|
||||
$this->debug("Unable to obtain mutex for $filename in put");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* releases the local mutex
|
||||
*
|
||||
* @param string $filename The Filename of the Cache to lock
|
||||
* @return boolean Lock successfully released
|
||||
* @access private
|
||||
*/
|
||||
function releaseMutex($filename) {
|
||||
$ret = flock($this->fplock[md5($filename)], LOCK_UN);
|
||||
fclose($this->fplock[md5($filename)]);
|
||||
unset($this->fplock[md5($filename)]);
|
||||
if (! $ret) {
|
||||
$this->debug("Not able to release lock for $filename");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* removes a wsdl instance from the cache
|
||||
*
|
||||
* @param string $wsdl The URL of the wsdl instance
|
||||
* @return boolean Whether there was an instance to remove
|
||||
* @access public
|
||||
*/
|
||||
function remove($wsdl) {
|
||||
$filename = $this->createFilename($wsdl);
|
||||
// ignore errors obtaining mutex
|
||||
$this->obtainMutex($filename, "w");
|
||||
$ret = unlink($filename);
|
||||
$this->debug("Removed ($ret) $wsdl ($filename) from cache");
|
||||
$this->releaseMutex($filename);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,478 +1,478 @@
|
||||
<?php
|
||||
/*
|
||||
$Id$
|
||||
|
||||
NuSOAP - Web Services Toolkit for PHP
|
||||
|
||||
Copyright (c) 2002 NuSphere Corporation
|
||||
|
||||
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
|
||||
|
||||
If you have any questions or comments, please email:
|
||||
|
||||
Dietrich Ayala
|
||||
dietrich@ganx4.com
|
||||
http://dietrich.ganx4.com/nusoap
|
||||
|
||||
NuSphere Corporation
|
||||
http://www.nusphere.com
|
||||
|
||||
*/
|
||||
|
||||
/*require_once('nusoap.php');*/
|
||||
/* PEAR Mail_MIME library */
|
||||
require_once('Mail/mimeDecode.php');
|
||||
require_once('Mail/mimePart.php');
|
||||
|
||||
/**
|
||||
* soapclientmime client supporting MIME attachments defined at
|
||||
* http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
|
||||
*
|
||||
* @author Scott Nichol <snichol@sourceforge.net>
|
||||
* @author Thanks to Guillaume and Henning Reich for posting great attachment code to the mail list
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class soapclientmime extends soapclient_nusoap {
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $requestAttachments = array();
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $responseAttachments;
|
||||
/**
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $mimeContentType;
|
||||
|
||||
/**
|
||||
* adds a MIME attachment to the current request.
|
||||
*
|
||||
* If the $data parameter contains an empty string, this method will read
|
||||
* the contents of the file named by the $filename parameter.
|
||||
*
|
||||
* If the $cid parameter is false, this method will generate the cid.
|
||||
*
|
||||
* @param string $data The data of the attachment
|
||||
* @param string $filename The filename of the attachment (default is empty string)
|
||||
* @param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream)
|
||||
* @param string $cid The content-id (cid) of the attachment (default is false)
|
||||
* @return string The content-id (cid) of the attachment
|
||||
* @access public
|
||||
*/
|
||||
function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) {
|
||||
if (! $cid) {
|
||||
$cid = md5(uniqid(time()));
|
||||
}
|
||||
|
||||
$info['data'] = $data;
|
||||
$info['filename'] = $filename;
|
||||
$info['contenttype'] = $contenttype;
|
||||
$info['cid'] = $cid;
|
||||
|
||||
$this->requestAttachments[] = $info;
|
||||
|
||||
return $cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* clears the MIME attachments for the current request.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function clearAttachments() {
|
||||
$this->requestAttachments = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the MIME attachments from the current response.
|
||||
*
|
||||
* Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid. These keys correspond to the parameters
|
||||
* for addAttachment.
|
||||
*
|
||||
* @return array The attachments.
|
||||
* @access public
|
||||
*/
|
||||
function getAttachments() {
|
||||
return $this->responseAttachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP body for the current request.
|
||||
*
|
||||
* @param string $soapmsg The SOAP payload
|
||||
* @return string The HTTP body, which includes the SOAP payload
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPBody($soapmsg) {
|
||||
if (count($this->requestAttachments) > 0) {
|
||||
$params['content_type'] = 'multipart/related; type=text/xml';
|
||||
$mimeMessage =& new Mail_mimePart('', $params);
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = 'text/xml';
|
||||
$params['encoding'] = '8bit';
|
||||
$params['charset'] = $this->soap_defencoding;
|
||||
$mimeMessage->addSubpart($soapmsg, $params);
|
||||
|
||||
foreach ($this->requestAttachments as $att) {
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = $att['contenttype'];
|
||||
$params['encoding'] = 'base64';
|
||||
$params['disposition'] = 'attachment';
|
||||
$params['dfilename'] = $att['filename'];
|
||||
$params['cid'] = $att['cid'];
|
||||
|
||||
if ($att['data'] == '' && $att['filename'] <> '') {
|
||||
if ($fd = fopen($att['filename'], 'rb')) {
|
||||
$data = fread($fd, filesize($att['filename']));
|
||||
fclose($fd);
|
||||
} else {
|
||||
$data = '';
|
||||
}
|
||||
$mimeMessage->addSubpart($data, $params);
|
||||
} else {
|
||||
$mimeMessage->addSubpart($att['data'], $params);
|
||||
}
|
||||
}
|
||||
|
||||
$output = $mimeMessage->encode();
|
||||
$mimeHeaders = $output['headers'];
|
||||
|
||||
foreach ($mimeHeaders as $k => $v) {
|
||||
$this->debug("MIME header $k: $v");
|
||||
if (strtolower($k) == 'content-type') {
|
||||
// PHP header() seems to strip leading whitespace starting
|
||||
// the second line, so force everything to one line
|
||||
$this->mimeContentType = str_replace("\r\n", " ", $v);
|
||||
}
|
||||
}
|
||||
|
||||
return $output['body'];
|
||||
}
|
||||
|
||||
return parent::getHTTPBody($soapmsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type for the current request.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type for the current request.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentType() {
|
||||
if (count($this->requestAttachments) > 0) {
|
||||
return $this->mimeContentType;
|
||||
}
|
||||
return parent::getHTTPContentType();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type charset for the current request.
|
||||
* returns false for non-text content types.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type charset for the current request.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentTypeCharset() {
|
||||
if (count($this->requestAttachments) > 0) {
|
||||
return false;
|
||||
}
|
||||
return parent::getHTTPContentTypeCharset();
|
||||
}
|
||||
|
||||
/**
|
||||
* processes SOAP message returned from server
|
||||
*
|
||||
* @param array $headers The HTTP headers
|
||||
* @param string $data unprocessed response data from server
|
||||
* @return mixed value of the message, decoded into a PHP type
|
||||
* @access private
|
||||
*/
|
||||
function parseResponse($headers, $data) {
|
||||
$this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
|
||||
$this->responseAttachments = array();
|
||||
if (strstr($headers['content-type'], 'multipart/related')) {
|
||||
$this->debug('Decode multipart/related');
|
||||
$input = '';
|
||||
foreach ($headers as $k => $v) {
|
||||
$input .= "$k: $v\r\n";
|
||||
}
|
||||
$params['input'] = $input . "\r\n" . $data;
|
||||
$params['include_bodies'] = true;
|
||||
$params['decode_bodies'] = true;
|
||||
$params['decode_headers'] = true;
|
||||
|
||||
$structure = Mail_mimeDecode::decode($params);
|
||||
|
||||
foreach ($structure->parts as $part) {
|
||||
if (!isset($part->disposition)) {
|
||||
$this->debug('Have root part of type ' . $part->headers['content-type']);
|
||||
$return = parent::parseResponse($part->headers, $part->body);
|
||||
} else {
|
||||
$this->debug('Have an attachment of type ' . $part->headers['content-type']);
|
||||
$info['data'] = $part->body;
|
||||
$info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
|
||||
$info['contenttype'] = $part->headers['content-type'];
|
||||
$info['cid'] = $part->headers['content-id'];
|
||||
$this->responseAttachments[] = $info;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($return)) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
$this->setError('No root part found in multipart/related content');
|
||||
return;
|
||||
}
|
||||
$this->debug('Not multipart/related');
|
||||
return parent::parseResponse($headers, $data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nusoapservermime server supporting MIME attachments defined at
|
||||
* http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
|
||||
*
|
||||
* @author Scott Nichol <snichol@sourceforge.net>
|
||||
* @author Thanks to Guillaume and Henning Reich for posting great attachment code to the mail list
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class nusoapservermime extends soap_server {
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $requestAttachments = array();
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $responseAttachments;
|
||||
/**
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $mimeContentType;
|
||||
|
||||
/**
|
||||
* adds a MIME attachment to the current response.
|
||||
*
|
||||
* If the $data parameter contains an empty string, this method will read
|
||||
* the contents of the file named by the $filename parameter.
|
||||
*
|
||||
* If the $cid parameter is false, this method will generate the cid.
|
||||
*
|
||||
* @param string $data The data of the attachment
|
||||
* @param string $filename The filename of the attachment (default is empty string)
|
||||
* @param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream)
|
||||
* @param string $cid The content-id (cid) of the attachment (default is false)
|
||||
* @return string The content-id (cid) of the attachment
|
||||
* @access public
|
||||
*/
|
||||
function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) {
|
||||
if (! $cid) {
|
||||
$cid = md5(uniqid(time()));
|
||||
}
|
||||
|
||||
$info['data'] = $data;
|
||||
$info['filename'] = $filename;
|
||||
$info['contenttype'] = $contenttype;
|
||||
$info['cid'] = $cid;
|
||||
|
||||
$this->responseAttachments[] = $info;
|
||||
|
||||
return $cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* clears the MIME attachments for the current response.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function clearAttachments() {
|
||||
$this->responseAttachments = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the MIME attachments from the current request.
|
||||
*
|
||||
* Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid. These keys correspond to the parameters
|
||||
* for addAttachment.
|
||||
*
|
||||
* @return array The attachments.
|
||||
* @access public
|
||||
*/
|
||||
function getAttachments() {
|
||||
return $this->requestAttachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP body for the current response.
|
||||
*
|
||||
* @param string $soapmsg The SOAP payload
|
||||
* @return string The HTTP body, which includes the SOAP payload
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPBody($soapmsg) {
|
||||
if (count($this->responseAttachments) > 0) {
|
||||
$params['content_type'] = 'multipart/related; type=text/xml';
|
||||
$mimeMessage =& new Mail_mimePart('', $params);
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = 'text/xml';
|
||||
$params['encoding'] = '8bit';
|
||||
$params['charset'] = $this->soap_defencoding;
|
||||
$mimeMessage->addSubpart($soapmsg, $params);
|
||||
|
||||
foreach ($this->responseAttachments as $att) {
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = $att['contenttype'];
|
||||
$params['encoding'] = 'base64';
|
||||
$params['disposition'] = 'attachment';
|
||||
$params['dfilename'] = $att['filename'];
|
||||
$params['cid'] = $att['cid'];
|
||||
|
||||
if ($att['data'] == '' && $att['filename'] <> '') {
|
||||
if ($fd = fopen($att['filename'], 'rb')) {
|
||||
$data = fread($fd, filesize($att['filename']));
|
||||
fclose($fd);
|
||||
} else {
|
||||
$data = '';
|
||||
}
|
||||
$mimeMessage->addSubpart($data, $params);
|
||||
} else {
|
||||
$mimeMessage->addSubpart($att['data'], $params);
|
||||
}
|
||||
}
|
||||
|
||||
$output = $mimeMessage->encode();
|
||||
$mimeHeaders = $output['headers'];
|
||||
|
||||
foreach ($mimeHeaders as $k => $v) {
|
||||
$this->debug("MIME header $k: $v");
|
||||
if (strtolower($k) == 'content-type') {
|
||||
// PHP header() seems to strip leading whitespace starting
|
||||
// the second line, so force everything to one line
|
||||
$this->mimeContentType = str_replace("\r\n", " ", $v);
|
||||
}
|
||||
}
|
||||
|
||||
return $output['body'];
|
||||
}
|
||||
|
||||
return parent::getHTTPBody($soapmsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type for the current response.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type for the current response.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentType() {
|
||||
if (count($this->responseAttachments) > 0) {
|
||||
return $this->mimeContentType;
|
||||
}
|
||||
return parent::getHTTPContentType();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type charset for the current response.
|
||||
* returns false for non-text content types.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type charset for the current response.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentTypeCharset() {
|
||||
if (count($this->responseAttachments) > 0) {
|
||||
return false;
|
||||
}
|
||||
return parent::getHTTPContentTypeCharset();
|
||||
}
|
||||
|
||||
/**
|
||||
* processes SOAP message received from client
|
||||
*
|
||||
* @param array $headers The HTTP headers
|
||||
* @param string $data unprocessed request data from client
|
||||
* @return mixed value of the message, decoded into a PHP type
|
||||
* @access private
|
||||
*/
|
||||
function parseRequest($headers, $data) {
|
||||
$this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
|
||||
$this->requestAttachments = array();
|
||||
if (strstr($headers['content-type'], 'multipart/related')) {
|
||||
$this->debug('Decode multipart/related');
|
||||
$input = '';
|
||||
foreach ($headers as $k => $v) {
|
||||
$input .= "$k: $v\r\n";
|
||||
}
|
||||
$params['input'] = $input . "\r\n" . $data;
|
||||
$params['include_bodies'] = true;
|
||||
$params['decode_bodies'] = true;
|
||||
$params['decode_headers'] = true;
|
||||
|
||||
$structure = Mail_mimeDecode::decode($params);
|
||||
|
||||
foreach ($structure->parts as $part) {
|
||||
if (!isset($part->disposition)) {
|
||||
$this->debug('Have root part of type ' . $part->headers['content-type']);
|
||||
$return = parent::parseRequest($part->headers, $part->body);
|
||||
} else {
|
||||
$this->debug('Have an attachment of type ' . $part->headers['content-type']);
|
||||
$info['data'] = $part->body;
|
||||
$info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
|
||||
$info['contenttype'] = $part->headers['content-type'];
|
||||
$info['cid'] = $part->headers['content-id'];
|
||||
$this->requestAttachments[] = $info;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($return)) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
$this->setError('No root part found in multipart/related content');
|
||||
return;
|
||||
}
|
||||
$this->debug('Not multipart/related');
|
||||
return parent::parseRequest($headers, $data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/*
|
||||
$Id$
|
||||
|
||||
NuSOAP - Web Services Toolkit for PHP
|
||||
|
||||
Copyright (c) 2002 NuSphere Corporation
|
||||
|
||||
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
|
||||
|
||||
If you have any questions or comments, please email:
|
||||
|
||||
Dietrich Ayala
|
||||
dietrich@ganx4.com
|
||||
http://dietrich.ganx4.com/nusoap
|
||||
|
||||
NuSphere Corporation
|
||||
http://www.nusphere.com
|
||||
|
||||
*/
|
||||
|
||||
/*require_once('nusoap.php');*/
|
||||
/* PEAR Mail_MIME library */
|
||||
require_once('Mail/mimeDecode.php');
|
||||
require_once('Mail/mimePart.php');
|
||||
|
||||
/**
|
||||
* soapclientmime client supporting MIME attachments defined at
|
||||
* http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
|
||||
*
|
||||
* @author Scott Nichol <snichol@sourceforge.net>
|
||||
* @author Thanks to Guillaume and Henning Reich for posting great attachment code to the mail list
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class soapclientmime extends soapclient_nusoap {
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $requestAttachments = array();
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $responseAttachments;
|
||||
/**
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $mimeContentType;
|
||||
|
||||
/**
|
||||
* adds a MIME attachment to the current request.
|
||||
*
|
||||
* If the $data parameter contains an empty string, this method will read
|
||||
* the contents of the file named by the $filename parameter.
|
||||
*
|
||||
* If the $cid parameter is false, this method will generate the cid.
|
||||
*
|
||||
* @param string $data The data of the attachment
|
||||
* @param string $filename The filename of the attachment (default is empty string)
|
||||
* @param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream)
|
||||
* @param string $cid The content-id (cid) of the attachment (default is false)
|
||||
* @return string The content-id (cid) of the attachment
|
||||
* @access public
|
||||
*/
|
||||
function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) {
|
||||
if (! $cid) {
|
||||
$cid = md5(uniqid(time()));
|
||||
}
|
||||
|
||||
$info['data'] = $data;
|
||||
$info['filename'] = $filename;
|
||||
$info['contenttype'] = $contenttype;
|
||||
$info['cid'] = $cid;
|
||||
|
||||
$this->requestAttachments[] = $info;
|
||||
|
||||
return $cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* clears the MIME attachments for the current request.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function clearAttachments() {
|
||||
$this->requestAttachments = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the MIME attachments from the current response.
|
||||
*
|
||||
* Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid. These keys correspond to the parameters
|
||||
* for addAttachment.
|
||||
*
|
||||
* @return array The attachments.
|
||||
* @access public
|
||||
*/
|
||||
function getAttachments() {
|
||||
return $this->responseAttachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP body for the current request.
|
||||
*
|
||||
* @param string $soapmsg The SOAP payload
|
||||
* @return string The HTTP body, which includes the SOAP payload
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPBody($soapmsg) {
|
||||
if (count($this->requestAttachments) > 0) {
|
||||
$params['content_type'] = 'multipart/related; type=text/xml';
|
||||
$mimeMessage =& new Mail_mimePart('', $params);
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = 'text/xml';
|
||||
$params['encoding'] = '8bit';
|
||||
$params['charset'] = $this->soap_defencoding;
|
||||
$mimeMessage->addSubpart($soapmsg, $params);
|
||||
|
||||
foreach ($this->requestAttachments as $att) {
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = $att['contenttype'];
|
||||
$params['encoding'] = 'base64';
|
||||
$params['disposition'] = 'attachment';
|
||||
$params['dfilename'] = $att['filename'];
|
||||
$params['cid'] = $att['cid'];
|
||||
|
||||
if ($att['data'] == '' && $att['filename'] <> '') {
|
||||
if ($fd = fopen($att['filename'], 'rb')) {
|
||||
$data = fread($fd, filesize($att['filename']));
|
||||
fclose($fd);
|
||||
} else {
|
||||
$data = '';
|
||||
}
|
||||
$mimeMessage->addSubpart($data, $params);
|
||||
} else {
|
||||
$mimeMessage->addSubpart($att['data'], $params);
|
||||
}
|
||||
}
|
||||
|
||||
$output = $mimeMessage->encode();
|
||||
$mimeHeaders = $output['headers'];
|
||||
|
||||
foreach ($mimeHeaders as $k => $v) {
|
||||
$this->debug("MIME header $k: $v");
|
||||
if (strtolower($k) == 'content-type') {
|
||||
// PHP header() seems to strip leading whitespace starting
|
||||
// the second line, so force everything to one line
|
||||
$this->mimeContentType = str_replace("\r\n", " ", $v);
|
||||
}
|
||||
}
|
||||
|
||||
return $output['body'];
|
||||
}
|
||||
|
||||
return parent::getHTTPBody($soapmsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type for the current request.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type for the current request.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentType() {
|
||||
if (count($this->requestAttachments) > 0) {
|
||||
return $this->mimeContentType;
|
||||
}
|
||||
return parent::getHTTPContentType();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type charset for the current request.
|
||||
* returns false for non-text content types.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type charset for the current request.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentTypeCharset() {
|
||||
if (count($this->requestAttachments) > 0) {
|
||||
return false;
|
||||
}
|
||||
return parent::getHTTPContentTypeCharset();
|
||||
}
|
||||
|
||||
/**
|
||||
* processes SOAP message returned from server
|
||||
*
|
||||
* @param array $headers The HTTP headers
|
||||
* @param string $data unprocessed response data from server
|
||||
* @return mixed value of the message, decoded into a PHP type
|
||||
* @access private
|
||||
*/
|
||||
function parseResponse($headers, $data) {
|
||||
$this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
|
||||
$this->responseAttachments = array();
|
||||
if (strstr($headers['content-type'], 'multipart/related')) {
|
||||
$this->debug('Decode multipart/related');
|
||||
$input = '';
|
||||
foreach ($headers as $k => $v) {
|
||||
$input .= "$k: $v\r\n";
|
||||
}
|
||||
$params['input'] = $input . "\r\n" . $data;
|
||||
$params['include_bodies'] = true;
|
||||
$params['decode_bodies'] = true;
|
||||
$params['decode_headers'] = true;
|
||||
|
||||
$structure = Mail_mimeDecode::decode($params);
|
||||
|
||||
foreach ($structure->parts as $part) {
|
||||
if (!isset($part->disposition)) {
|
||||
$this->debug('Have root part of type ' . $part->headers['content-type']);
|
||||
$return = parent::parseResponse($part->headers, $part->body);
|
||||
} else {
|
||||
$this->debug('Have an attachment of type ' . $part->headers['content-type']);
|
||||
$info['data'] = $part->body;
|
||||
$info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
|
||||
$info['contenttype'] = $part->headers['content-type'];
|
||||
$info['cid'] = $part->headers['content-id'];
|
||||
$this->responseAttachments[] = $info;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($return)) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
$this->setError('No root part found in multipart/related content');
|
||||
return;
|
||||
}
|
||||
$this->debug('Not multipart/related');
|
||||
return parent::parseResponse($headers, $data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nusoapservermime server supporting MIME attachments defined at
|
||||
* http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
|
||||
*
|
||||
* @author Scott Nichol <snichol@sourceforge.net>
|
||||
* @author Thanks to Guillaume and Henning Reich for posting great attachment code to the mail list
|
||||
* @version $Id$
|
||||
* @access public
|
||||
*/
|
||||
class nusoapservermime extends soap_server {
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $requestAttachments = array();
|
||||
/**
|
||||
* @var array Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid
|
||||
* @access private
|
||||
*/
|
||||
var $responseAttachments;
|
||||
/**
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $mimeContentType;
|
||||
|
||||
/**
|
||||
* adds a MIME attachment to the current response.
|
||||
*
|
||||
* If the $data parameter contains an empty string, this method will read
|
||||
* the contents of the file named by the $filename parameter.
|
||||
*
|
||||
* If the $cid parameter is false, this method will generate the cid.
|
||||
*
|
||||
* @param string $data The data of the attachment
|
||||
* @param string $filename The filename of the attachment (default is empty string)
|
||||
* @param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream)
|
||||
* @param string $cid The content-id (cid) of the attachment (default is false)
|
||||
* @return string The content-id (cid) of the attachment
|
||||
* @access public
|
||||
*/
|
||||
function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) {
|
||||
if (! $cid) {
|
||||
$cid = md5(uniqid(time()));
|
||||
}
|
||||
|
||||
$info['data'] = $data;
|
||||
$info['filename'] = $filename;
|
||||
$info['contenttype'] = $contenttype;
|
||||
$info['cid'] = $cid;
|
||||
|
||||
$this->responseAttachments[] = $info;
|
||||
|
||||
return $cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* clears the MIME attachments for the current response.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function clearAttachments() {
|
||||
$this->responseAttachments = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the MIME attachments from the current request.
|
||||
*
|
||||
* Each array element in the return is an associative array with keys
|
||||
* data, filename, contenttype, cid. These keys correspond to the parameters
|
||||
* for addAttachment.
|
||||
*
|
||||
* @return array The attachments.
|
||||
* @access public
|
||||
*/
|
||||
function getAttachments() {
|
||||
return $this->requestAttachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP body for the current response.
|
||||
*
|
||||
* @param string $soapmsg The SOAP payload
|
||||
* @return string The HTTP body, which includes the SOAP payload
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPBody($soapmsg) {
|
||||
if (count($this->responseAttachments) > 0) {
|
||||
$params['content_type'] = 'multipart/related; type=text/xml';
|
||||
$mimeMessage =& new Mail_mimePart('', $params);
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = 'text/xml';
|
||||
$params['encoding'] = '8bit';
|
||||
$params['charset'] = $this->soap_defencoding;
|
||||
$mimeMessage->addSubpart($soapmsg, $params);
|
||||
|
||||
foreach ($this->responseAttachments as $att) {
|
||||
unset($params);
|
||||
|
||||
$params['content_type'] = $att['contenttype'];
|
||||
$params['encoding'] = 'base64';
|
||||
$params['disposition'] = 'attachment';
|
||||
$params['dfilename'] = $att['filename'];
|
||||
$params['cid'] = $att['cid'];
|
||||
|
||||
if ($att['data'] == '' && $att['filename'] <> '') {
|
||||
if ($fd = fopen($att['filename'], 'rb')) {
|
||||
$data = fread($fd, filesize($att['filename']));
|
||||
fclose($fd);
|
||||
} else {
|
||||
$data = '';
|
||||
}
|
||||
$mimeMessage->addSubpart($data, $params);
|
||||
} else {
|
||||
$mimeMessage->addSubpart($att['data'], $params);
|
||||
}
|
||||
}
|
||||
|
||||
$output = $mimeMessage->encode();
|
||||
$mimeHeaders = $output['headers'];
|
||||
|
||||
foreach ($mimeHeaders as $k => $v) {
|
||||
$this->debug("MIME header $k: $v");
|
||||
if (strtolower($k) == 'content-type') {
|
||||
// PHP header() seems to strip leading whitespace starting
|
||||
// the second line, so force everything to one line
|
||||
$this->mimeContentType = str_replace("\r\n", " ", $v);
|
||||
}
|
||||
}
|
||||
|
||||
return $output['body'];
|
||||
}
|
||||
|
||||
return parent::getHTTPBody($soapmsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type for the current response.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type for the current response.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentType() {
|
||||
if (count($this->responseAttachments) > 0) {
|
||||
return $this->mimeContentType;
|
||||
}
|
||||
return parent::getHTTPContentType();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the HTTP content type charset for the current response.
|
||||
* returns false for non-text content types.
|
||||
*
|
||||
* Note: getHTTPBody must be called before this.
|
||||
*
|
||||
* @return string the HTTP content type charset for the current response.
|
||||
* @access private
|
||||
*/
|
||||
function getHTTPContentTypeCharset() {
|
||||
if (count($this->responseAttachments) > 0) {
|
||||
return false;
|
||||
}
|
||||
return parent::getHTTPContentTypeCharset();
|
||||
}
|
||||
|
||||
/**
|
||||
* processes SOAP message received from client
|
||||
*
|
||||
* @param array $headers The HTTP headers
|
||||
* @param string $data unprocessed request data from client
|
||||
* @return mixed value of the message, decoded into a PHP type
|
||||
* @access private
|
||||
*/
|
||||
function parseRequest($headers, $data) {
|
||||
$this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
|
||||
$this->requestAttachments = array();
|
||||
if (strstr($headers['content-type'], 'multipart/related')) {
|
||||
$this->debug('Decode multipart/related');
|
||||
$input = '';
|
||||
foreach ($headers as $k => $v) {
|
||||
$input .= "$k: $v\r\n";
|
||||
}
|
||||
$params['input'] = $input . "\r\n" . $data;
|
||||
$params['include_bodies'] = true;
|
||||
$params['decode_bodies'] = true;
|
||||
$params['decode_headers'] = true;
|
||||
|
||||
$structure = Mail_mimeDecode::decode($params);
|
||||
|
||||
foreach ($structure->parts as $part) {
|
||||
if (!isset($part->disposition)) {
|
||||
$this->debug('Have root part of type ' . $part->headers['content-type']);
|
||||
$return = parent::parseRequest($part->headers, $part->body);
|
||||
} else {
|
||||
$this->debug('Have an attachment of type ' . $part->headers['content-type']);
|
||||
$info['data'] = $part->body;
|
||||
$info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
|
||||
$info['contenttype'] = $part->headers['content-type'];
|
||||
$info['cid'] = $part->headers['content-id'];
|
||||
$this->requestAttachments[] = $info;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($return)) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
$this->setError('No root part found in multipart/related content');
|
||||
return;
|
||||
}
|
||||
$this->debug('Not multipart/related');
|
||||
return parent::parseRequest($headers, $data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
*.db
|
||||
*.db
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
*.db
|
||||
*.db
|
||||
*.db
|
||||
*.db
|
||||
|
||||
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
||||
Loading…
Reference in New Issue
Block a user