mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Add support for PHP7, update ADODB
This commit is contained in:
@@ -268,7 +268,7 @@ if (!defined('DB_USER')) define('DB_USER', 'quexs');
|
||||
if (!defined('DB_PASS')) define('DB_PASS', 'quexs');
|
||||
if (!defined('DB_HOST')) define('DB_HOST', 'localhost');
|
||||
if (!defined('DB_NAME')) define('DB_NAME', 'quexs');
|
||||
if (!defined('DB_TYPE')) define('DB_TYPE', 'mysqlt');
|
||||
if (!defined('DB_TYPE')) define('DB_TYPE', 'mysqli');
|
||||
|
||||
/**
|
||||
* The prefix for the limesurvey database
|
||||
|
||||
@@ -31,7 +31,7 @@ function injectglobalsettings()
|
||||
{
|
||||
foreach ($dbvaluearray as $setting)
|
||||
{
|
||||
global $$setting['stg_name'];
|
||||
global ${$setting['stg_name']};
|
||||
if (isset($$setting['stg_name']))
|
||||
{
|
||||
$$setting['stg_name']=$setting['stg_value'];
|
||||
|
||||
10
include/limesurvey/classes/adodb/.idea/adodb.iml
generated
Normal file
10
include/limesurvey/classes/adodb/.idea/adodb.iml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
3
include/limesurvey/classes/adodb/.idea/copyright/profiles_settings.xml
generated
Normal file
3
include/limesurvey/classes/adodb/.idea/copyright/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="" />
|
||||
</component>
|
||||
9
include/limesurvey/classes/adodb/.idea/dictionaries/dregad.xml
generated
Normal file
9
include/limesurvey/classes/adodb/.idea/dictionaries/dregad.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="dregad">
|
||||
<words>
|
||||
<w>adodb</w>
|
||||
<w>mssql</w>
|
||||
<w>mssqlnative</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
6
include/limesurvey/classes/adodb/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
6
include/limesurvey/classes/adodb/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
7
include/limesurvey/classes/adodb/.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
7
include/limesurvey/classes/adodb/.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="Project Default" />
|
||||
<option name="USE_PROJECT_PROFILE" value="true" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
8
include/limesurvey/classes/adodb/.idea/modules.xml
generated
Normal file
8
include/limesurvey/classes/adodb/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/adodb.iml" filepath="$PROJECT_DIR$/.idea/adodb.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
include/limesurvey/classes/adodb/.idea/vcs.xml
generated
Normal file
6
include/limesurvey/classes/adodb/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
450
include/limesurvey/classes/adodb/.idea/workspace.xml
generated
Normal file
450
include/limesurvey/classes/adodb/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,450 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ac81baa3-c781-40ee-8180-55d5a33882b9" name="Default" comment="" />
|
||||
<ignored path="adodb.iws" />
|
||||
<ignored path=".idea/" />
|
||||
<ignored path=".idea/dataSources.local.xml" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="DatabaseView">
|
||||
<option name="GROUP_SCHEMA" value="true" />
|
||||
<option name="GROUP_CONTENTS" value="false" />
|
||||
<option name="SORT_POSITIONED" value="false" />
|
||||
<option name="SHOW_TABLE_DETAILS" value="true" />
|
||||
<option name="SHOW_EMPTY_GROUPS" value="false" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FavoritesManager">
|
||||
<favorites_list name="adodb" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file leaf-file-name="adodb-mysqli.inc.php" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/drivers/adodb-mysqli.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="201">
|
||||
<caret line="39" column="23" selection-start-line="39" selection-start-column="23" selection-end-line="39" selection-end-column="23" />
|
||||
<folding>
|
||||
<marker date="1459409495629" expanded="true" signature="1434:1565" placeholder="SELECT TABLE... TABLES" />
|
||||
<marker date="1459409495629" expanded="true" signature="6578:6620" placeholder="select ${$co... ${$tables}" />
|
||||
<marker date="1459409495629" expanded="true" signature="8554:8601" placeholder="create table... if" />
|
||||
<marker date="1459409495629" expanded="true" signature="8629:8652" placeholder="select count... " />
|
||||
<marker date="1459409495629" expanded="true" signature="8676:8702" placeholder="insert into " />
|
||||
<marker date="1459409495629" expanded="true" signature="8726:8749" placeholder="drop table i... " />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="changelog.md" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/docs/changelog.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="FIRST">
|
||||
<first_editor relative-caret-position="150">
|
||||
<caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://$PROJECT_DIR$/adodb.inc.php" root0="FORCE_HIGHLIGHTING" root1="FORCE_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/adodb.inc.php" />
|
||||
<option value="$PROJECT_DIR$/drivers/adodb-mysqli.inc.php" />
|
||||
<option value="$PROJECT_DIR$/docs/changelog.md" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
</component>
|
||||
<component name="PhpServers">
|
||||
<servers />
|
||||
</component>
|
||||
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="PHP 5.6" />
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="65" />
|
||||
<option name="y" value="24" />
|
||||
<option name="width" value="1855" />
|
||||
<option name="height" value="1056" />
|
||||
</component>
|
||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||
<entry key="Project Default">
|
||||
<profile-state>
|
||||
<expanded-state>
|
||||
<State>
|
||||
<id />
|
||||
</State>
|
||||
<State>
|
||||
<id>SQL</id>
|
||||
</State>
|
||||
</expanded-state>
|
||||
<selected-state>
|
||||
<State>
|
||||
<id>SqlNoDataSourceInspection</id>
|
||||
</State>
|
||||
</selected-state>
|
||||
</profile-state>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="1" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="drivers" />
|
||||
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="adodb" />
|
||||
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="docs" />
|
||||
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scratches" />
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/.idea" />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.sourceCode" />
|
||||
<property name="settings.editor.splitter.proportion" value="0.2" />
|
||||
<property name="ChangesBrowser.SHOW_FLATTEN" value="true" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
|
||||
<TestRunner />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
|
||||
<BehatRunner />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
||||
<node-interpreter>project</node-interpreter>
|
||||
<node-options />
|
||||
<gulpfile />
|
||||
<tasks />
|
||||
<arguments />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
|
||||
<command value="run-script" />
|
||||
<scripts />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="ac81baa3-c781-40ee-8180-55d5a33882b9" name="Default" comment="" />
|
||||
<created>1459369231815</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1459369231815</updated>
|
||||
<workItem from="1459369233886" duration="33000" />
|
||||
<workItem from="1459369287408" duration="889000" />
|
||||
<workItem from="1459370209069" duration="3711000" />
|
||||
<workItem from="1459527565905" duration="26000" />
|
||||
<workItem from="1459409039393" duration="9000" />
|
||||
<workItem from="1459409291197" duration="1460000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Update changelog ">
|
||||
<created>1459370567207</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1459370567207</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="Fix PHP warning in ADORecordset_mysqli::__close() PHP Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, integer given Fixes #217 ">
|
||||
<created>1459411447176</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1459411447176</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="6128000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="65" y="24" width="1855" height="1056" extended-state="6" />
|
||||
<editor active="false" />
|
||||
<layout>
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Messages" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32960325" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39979655" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32901832" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18867925" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="Vcs.Log.UiProperties">
|
||||
<option name="RECENTLY_FILTERED_USER_GROUPS">
|
||||
<collection />
|
||||
</option>
|
||||
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
|
||||
<collection />
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Update changelog " />
|
||||
<MESSAGE value="Fix PHP warning in ADORecordset_mysqli::__close() PHP Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, integer given Fixes #217 " />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Fix PHP warning in ADORecordset_mysqli::__close() PHP Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, integer given Fixes #217 " />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/drivers/adodb-mysqli.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1125">
|
||||
<caret line="93" column="9" selection-start-line="93" selection-start-column="9" selection-end-line="93" selection-end-column="9" />
|
||||
<folding>
|
||||
<marker date="1459409495629" expanded="true" signature="1434:1565" placeholder="SELECT TABLE... TABLES" />
|
||||
<marker date="1459409495629" expanded="true" signature="6578:6620" placeholder="select ${$co... ${$tables}" />
|
||||
<marker date="1459409495629" expanded="true" signature="8554:8601" placeholder="create table... if" />
|
||||
<marker date="1459409495629" expanded="true" signature="8629:8652" placeholder="select count... " />
|
||||
<marker date="1459409495629" expanded="true" signature="8676:8702" placeholder="insert into " />
|
||||
<marker date="1459409495629" expanded="true" signature="8726:8749" placeholder="drop table i... " />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/docs/changelog.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="870">
|
||||
<caret line="58" column="6" selection-start-line="58" selection-start-column="6" selection-end-line="58" selection-end-column="6" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/drivers/adodb-mysqli.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1230">
|
||||
<caret line="100" column="9" selection-start-line="100" selection-start-column="9" selection-end-line="100" selection-end-column="9" />
|
||||
<folding>
|
||||
<marker date="1459409495629" expanded="true" signature="1434:1565" placeholder="SELECT TABLE... TABLES" />
|
||||
<marker date="1459409495629" expanded="true" signature="6578:6620" placeholder="select ${$co... ${$tables}" />
|
||||
<marker date="1459409495629" expanded="true" signature="8554:8601" placeholder="create table... if" />
|
||||
<marker date="1459409495629" expanded="true" signature="8629:8652" placeholder="select count... " />
|
||||
<marker date="1459409495629" expanded="true" signature="8676:8702" placeholder="insert into " />
|
||||
<marker date="1459409495629" expanded="true" signature="8726:8749" placeholder="drop table i... " />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/docs/changelog.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="0">
|
||||
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/drivers/adodb-mysqli.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1215">
|
||||
<caret line="99" column="9" selection-start-line="99" selection-start-column="9" selection-end-line="99" selection-end-column="9" />
|
||||
<folding>
|
||||
<marker date="1459409495629" expanded="true" signature="1434:1565" placeholder="SELECT TABLE... TABLES" />
|
||||
<marker date="1459409495629" expanded="true" signature="6578:6620" placeholder="select ${$co... ${$tables}" />
|
||||
<marker date="1459409495629" expanded="true" signature="8554:8601" placeholder="create table... if" />
|
||||
<marker date="1459409495629" expanded="true" signature="8629:8652" placeholder="select count... " />
|
||||
<marker date="1459409495629" expanded="true" signature="8676:8702" placeholder="insert into " />
|
||||
<marker date="1459409495629" expanded="true" signature="8726:8749" placeholder="drop table i... " />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/docs/changelog.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="0">
|
||||
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/adodb.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="30720">
|
||||
<caret line="2058" column="30" selection-start-line="2058" selection-start-column="30" selection-end-line="2058" selection-end-column="30" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/docs/changelog.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="0">
|
||||
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/adodb.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="843">
|
||||
<caret line="2058" column="30" selection-start-line="2058" selection-start-column="30" selection-end-line="2058" selection-end-column="30" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/docs/changelog.md">
|
||||
<provider editor-type-id="text-editor">
|
||||
<state relative-caret-position="135">
|
||||
<caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="FIRST">
|
||||
<first_editor relative-caret-position="150">
|
||||
<caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/drivers/adodb-mysqli.inc.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="201">
|
||||
<caret line="39" column="23" selection-start-line="39" selection-start-column="23" selection-end-line="39" selection-end-column="23" />
|
||||
<folding>
|
||||
<marker date="1459409495629" expanded="true" signature="1434:1565" placeholder="SELECT TABLE... TABLES" />
|
||||
<marker date="1459409495629" expanded="true" signature="6578:6620" placeholder="select ${$co... ${$tables}" />
|
||||
<marker date="1459409495629" expanded="true" signature="8554:8601" placeholder="create table... if" />
|
||||
<marker date="1459409495629" expanded="true" signature="8629:8652" placeholder="select count... " />
|
||||
<marker date="1459409495629" expanded="true" signature="8676:8702" placeholder="insert into " />
|
||||
<marker date="1459409495629" expanded="true" signature="8726:8749" placeholder="drop table i... " />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
4
include/limesurvey/classes/adodb/.mailmap
Normal file
4
include/limesurvey/classes/adodb/.mailmap
Normal file
@@ -0,0 +1,4 @@
|
||||
Andreas Fernandez <a.fernandez@scripting-base.de> <andreas.fernandez@aspedia.de>
|
||||
Mike Benoit <mikeb@timetrex.com> MikeB <ipso@snappymail.ca>
|
||||
Mike Benoit <mikeb@timetrex.com> mike.benoit
|
||||
|
||||
496
include/limesurvey/classes/adodb/LICENSE.md
Normal file
496
include/limesurvey/classes/adodb/LICENSE.md
Normal file
@@ -0,0 +1,496 @@
|
||||
ADOdb License
|
||||
=============
|
||||
|
||||
ADOdb is dual licensed under BSD and LGPL.
|
||||
|
||||
In plain English, you do not need to distribute your application in source code form,
|
||||
nor do you need to distribute ADOdb source code, provided you follow the rest of
|
||||
terms of the BSD license.
|
||||
|
||||
For more info about ADOdb, visit http://adodb.sourceforge.net/
|
||||
|
||||
BSD 3-Clause License
|
||||
--------------------
|
||||
|
||||
(c) 2000-2013 John Lim (jlim@natsoft.com)
|
||||
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
### DISCLAIMER
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
---------------------------------
|
||||
|
||||
_Version 2.1, February 1999_
|
||||
_Copyright © 1991, 1999 Free Software Foundation, Inc._
|
||||
_51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
_This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1._
|
||||
|
||||
### Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: **(1)** we copyright the
|
||||
library, and **(2)** we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the “Lesser” General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
“work based on the library” and a “work that uses the library”. The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
**0.** This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called “this License”).
|
||||
Each licensee is addressed as “you”.
|
||||
|
||||
A “library” means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The “Library”, below, refers to any such software library or work
|
||||
which has been distributed under these terms. A “work based on the
|
||||
Library” means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term “modification”.)
|
||||
|
||||
“Source code” for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
**1.** You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
**2.** You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
* **a)** The modified work must itself be a software library.
|
||||
* **b)** You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
* **c)** You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
* **d)** If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
**3.** You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
**4.** You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
**5.** A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a “work that uses the Library”. Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a “work that uses the Library” with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a “work that uses the
|
||||
library”. The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a “work that uses the Library” uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
**6.** As an exception to the Sections above, you may also combine or
|
||||
link a “work that uses the Library” with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
* **a)** Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable “work that
|
||||
uses the Library”, as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
* **b)** Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
* **c)** Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
* **d)** If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
* **e)** Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the “work that uses the
|
||||
Library” must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
**7.** You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
* **a)** Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
* **b)** Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
**8.** You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
**9.** You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
**10.** Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
**11.** If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
**12.** If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
**13.** The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
“any later version”, you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
**14.** If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
### NO WARRANTY
|
||||
|
||||
**15.** BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY “AS IS” WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
**16.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
_END OF TERMS AND CONDITIONS_
|
||||
109
include/limesurvey/classes/adodb/README.md
Normal file
109
include/limesurvey/classes/adodb/README.md
Normal file
@@ -0,0 +1,109 @@
|
||||
ADOdb Library for PHP5
|
||||
======================
|
||||
|
||||
[](https://gitter.im/adodb/adodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://sourceforge.net/projects/adodb/files/latest/download)
|
||||
|
||||
(c) 2000-2013 John Lim (jlim@natsoft.com)
|
||||
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
Released under both [BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license)
|
||||
and [GNU Lesser GPL library 2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license)
|
||||
licenses.
|
||||
This means you can use it in proprietary products;
|
||||
see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details.
|
||||
|
||||
Home page: http://adodb.org/
|
||||
|
||||
> **WARNING: known issue with Associative Fetch Mode in ADOdb v5.19
|
||||
-- PLEASE UPGRADE TO v5.20 !**
|
||||
> When fetching data in Associative mode (i.e. when `$ADODB_FETCH_MODE` is
|
||||
> set to *ADODB_FETCH_ASSOC*), recordsets do not return any data (empty strings)
|
||||
> when using some database drivers. The problem has been reported on MSSQL,
|
||||
> Interbase and Foxpro, but possibly affects other drivers as well; all drivers
|
||||
> derived from the above are also impacted.
|
||||
> For further details, please refer to [Issue #20](https://github.com/ADOdb/ADOdb/issues/20).
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
PHP's database access functions are not standardized. This creates a
|
||||
need for a database class library to hide the differences between the
|
||||
different databases (encapsulate the differences) so we can easily
|
||||
switch databases.
|
||||
|
||||
The library currently supports MySQL, Interbase, Sybase, PostgreSQL, Oracle,
|
||||
Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2,
|
||||
Sybase SQL Anywhere, generic ODBC and Microsoft's ADO.
|
||||
|
||||
We hope more people will contribute drivers to support other databases.
|
||||
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Unpack all the files into a directory accessible by your web server.
|
||||
|
||||
To test, try modifying some of the tutorial examples.
|
||||
Make sure you customize the connection settings correctly.
|
||||
|
||||
You can debug using:
|
||||
|
||||
``` php
|
||||
<?php
|
||||
include('adodb/adodb.inc.php');
|
||||
|
||||
$db = ADONewConnection($driver); # eg. 'mysql' or 'oci8'
|
||||
$db->debug = true;
|
||||
$db->Connect($server, $user, $password, $database);
|
||||
$rs = $db->Execute('select * from some_small_table');
|
||||
print "<pre>";
|
||||
print_r($rs->GetRows());
|
||||
print "</pre>";
|
||||
```
|
||||
|
||||
|
||||
Documentation and Examples
|
||||
==========================
|
||||
|
||||
Refer to the [ADOdb website](http://adodb.org/) for library documentation and examples. The documentation can also be [downloaded for offline viewing](https://sourceforge.net/projects/adodb/files/Documentation/).
|
||||
|
||||
- [Main documentation](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:userguide_index): Query, update and insert records using a portable API.
|
||||
- [Data dictionary](http://adodb.org/dokuwiki/doku.php?id=v5:dictionary:dictionary_index) describes how to create database tables and indexes in a portable manner.
|
||||
- [Database performance monitoring](http://adodb.org/dokuwiki/doku.php?id=v5:performance:performance_index) allows you to perform health checks, tune and monitor your database.
|
||||
- [Database-backed sessions](http://adodb.org/dokuwiki/doku.php?id=v5:session:session_index).
|
||||
|
||||
There is also a [tutorial](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:mysql_tutorial) that contrasts ADOdb code with PHP native MySQL code.
|
||||
|
||||
|
||||
Files
|
||||
=====
|
||||
|
||||
- `adodb.inc.php` is the library's main file. You only need to include this file.
|
||||
- `adodb-*.inc.php` are the database specific driver code.
|
||||
- `adodb-session.php` is the PHP4 session handling code.
|
||||
- `test.php` contains a list of test commands to exercise the class library.
|
||||
- `testdatabases.inc.php` contains the list of databases to apply the tests on.
|
||||
- `Benchmark.php` is a simple benchmark to test the throughput of a SELECT
|
||||
statement for databases described in testdatabases.inc.php. The benchmark
|
||||
tables are created in test.php.
|
||||
|
||||
|
||||
Support
|
||||
=======
|
||||
|
||||
To discuss with the ADOdb development team and users, connect to our
|
||||
[Gitter chatroom](https://gitter.im/adodb/adodb) using your Github credentials.
|
||||
|
||||
Please report bugs, issues and feature requests on Github:
|
||||
|
||||
https://github.com/ADOdb/ADOdb/issues
|
||||
|
||||
You may also find legacy issues in
|
||||
|
||||
- the old [ADOdb forums](http://phplens.com/lens/lensforum/topics.php?id=4) on phplens.com
|
||||
- the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets)
|
||||
|
||||
However, please note that they are not actively monitored and should
|
||||
only be used as reference.
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@@ -52,19 +54,23 @@ function ADODB_SetDatabaseAdapter(&$db, $index=false)
|
||||
|
||||
foreach($_ADODB_ACTIVE_DBS as $k => $d) {
|
||||
if (PHP_VERSION >= 5) {
|
||||
if ($d->db === $db) return $k;
|
||||
} else {
|
||||
if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database)
|
||||
if ($d->db === $db) {
|
||||
return $k;
|
||||
}
|
||||
} else {
|
||||
if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database) {
|
||||
return $k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new ADODB_Active_DB();
|
||||
$obj->db = $db;
|
||||
$obj->tables = array();
|
||||
|
||||
if ($index == false) $index = sizeof($_ADODB_ACTIVE_DBS);
|
||||
|
||||
if ($index == false) {
|
||||
$index = sizeof($_ADODB_ACTIVE_DBS);
|
||||
}
|
||||
|
||||
$_ADODB_ACTIVE_DBS[$index] = $obj;
|
||||
|
||||
@@ -87,10 +93,14 @@ class ADODB_Active_Record {
|
||||
|
||||
var $foreignName; // CFR: class name when in a relationship
|
||||
|
||||
var $lockMode = ' for update '; // you might want to change to
|
||||
|
||||
static function UseDefaultValues($bool=null)
|
||||
{
|
||||
global $ADODB_ACTIVE_DEFVALS;
|
||||
if (isset($bool)) $ADODB_ACTIVE_DEFVALS = $bool;
|
||||
if (isset($bool)) {
|
||||
$ADODB_ACTIVE_DEFVALS = $bool;
|
||||
}
|
||||
return $ADODB_ACTIVE_DEFVALS;
|
||||
}
|
||||
|
||||
@@ -118,14 +128,21 @@ class ADODB_Active_Record {
|
||||
}
|
||||
|
||||
if (!$table) {
|
||||
if (!empty($this->_table)) $table = $this->_table;
|
||||
if (!empty($this->_table)) {
|
||||
$table = $this->_table;
|
||||
}
|
||||
else $table = $this->_pluralize(get_class($this));
|
||||
}
|
||||
$this->foreignName = strtolower(get_class($this)); // CFR: default foreign name
|
||||
if ($db) {
|
||||
$this->_dbat = ADODB_Active_Record::SetDatabaseAdapter($db);
|
||||
} else if (!isset($this->_dbat)) {
|
||||
if (sizeof($_ADODB_ACTIVE_DBS) == 0) $this->Error("No database connection set; use ADOdb_Active_Record::SetDatabaseAdapter(\$db)",'ADODB_Active_Record::__constructor');
|
||||
if (sizeof($_ADODB_ACTIVE_DBS) == 0) {
|
||||
$this->Error(
|
||||
"No database connection set; use ADOdb_Active_Record::SetDatabaseAdapter(\$db)",
|
||||
'ADODB_Active_Record::__constructor'
|
||||
);
|
||||
}
|
||||
end($_ADODB_ACTIVE_DBS);
|
||||
$this->_dbat = key($_ADODB_ACTIVE_DBS);
|
||||
}
|
||||
@@ -144,7 +161,9 @@ class ADODB_Active_Record {
|
||||
|
||||
function _pluralize($table)
|
||||
{
|
||||
if (!ADODB_Active_Record::$_changeNames) return $table;
|
||||
if (!ADODB_Active_Record::$_changeNames) {
|
||||
return $table;
|
||||
}
|
||||
|
||||
$ut = strtoupper($table);
|
||||
$len = strlen($table);
|
||||
@@ -158,8 +177,9 @@ class ADODB_Active_Record {
|
||||
case 'X':
|
||||
return $table.'es';
|
||||
case 'H':
|
||||
if ($lastc2 == 'CH' || $lastc2 == 'SH')
|
||||
if ($lastc2 == 'CH' || $lastc2 == 'SH') {
|
||||
return $table.'es';
|
||||
}
|
||||
default:
|
||||
return $table.'s';
|
||||
}
|
||||
@@ -170,24 +190,28 @@ class ADODB_Active_Record {
|
||||
function _singularize($tables)
|
||||
{
|
||||
|
||||
if (!ADODB_Active_Record::$_changeNames) return $table;
|
||||
if (!ADODB_Active_Record::$_changeNames) {
|
||||
return $table;
|
||||
}
|
||||
|
||||
$ut = strtoupper($tables);
|
||||
$len = strlen($tables);
|
||||
if($ut[$len-1] != 'S')
|
||||
if($ut[$len-1] != 'S') {
|
||||
return $tables; // I know...forget oxen
|
||||
if($ut[$len-2] != 'E')
|
||||
}
|
||||
if($ut[$len-2] != 'E') {
|
||||
return substr($tables, 0, $len-1);
|
||||
switch($ut[$len-3])
|
||||
{
|
||||
}
|
||||
switch($ut[$len-3]) {
|
||||
case 'S':
|
||||
case 'X':
|
||||
return substr($tables, 0, $len-2);
|
||||
case 'I':
|
||||
return substr($tables, 0, $len-3) . 'y';
|
||||
case 'H';
|
||||
if($ut[$len-4] == 'C' || $ut[$len-4] == 'S')
|
||||
if($ut[$len-4] == 'C' || $ut[$len-4] == 'S') {
|
||||
return substr($tables, 0, $len-2);
|
||||
}
|
||||
default:
|
||||
return substr($tables, 0, $len-1); // ?
|
||||
}
|
||||
@@ -214,7 +238,9 @@ class ADODB_Active_Record {
|
||||
// use when you don't want ADOdb to auto-pluralize tablename
|
||||
static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
|
||||
{
|
||||
if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
|
||||
if (!is_array($tablePKey)) {
|
||||
$tablePKey = array($tablePKey);
|
||||
}
|
||||
$ar = new ADODB_Active_Record($table,$tablePKey);
|
||||
$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
|
||||
}
|
||||
@@ -258,7 +284,9 @@ class ADODB_Active_Record {
|
||||
|
||||
static function TableKeyBelongsTo($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
|
||||
{
|
||||
if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
|
||||
if (!is_array($tablePKey)) {
|
||||
$tablePKey = array($tablePKey);
|
||||
}
|
||||
$ar = new ADOdb_Active_Record($table, $tablePKey);
|
||||
$ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
|
||||
}
|
||||
@@ -287,24 +315,34 @@ class ADODB_Active_Record {
|
||||
{
|
||||
$extras = array();
|
||||
$table = $this->TableInfo();
|
||||
if ($limit >= 0) $extras['limit'] = $limit;
|
||||
if ($offset >= 0) $extras['offset'] = $offset;
|
||||
if ($limit >= 0) {
|
||||
$extras['limit'] = $limit;
|
||||
}
|
||||
if ($offset >= 0) {
|
||||
$extras['offset'] = $offset;
|
||||
}
|
||||
|
||||
if (strlen($whereOrderBy))
|
||||
if (!preg_match('/^[ \n\r]*AND/i',$whereOrderBy))
|
||||
if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i',$whereOrderBy))
|
||||
if (strlen($whereOrderBy)) {
|
||||
if (!preg_match('/^[ \n\r]*AND/i', $whereOrderBy)) {
|
||||
if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i', $whereOrderBy)) {
|
||||
$whereOrderBy = 'AND ' . $whereOrderBy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($table->_belongsTo[$name]))
|
||||
{
|
||||
if(!empty($table->_belongsTo[$name])) {
|
||||
$obj = $table->_belongsTo[$name];
|
||||
$columnName = $obj->foreignKey;
|
||||
if(empty($this->$columnName))
|
||||
if(empty($this->$columnName)) {
|
||||
$this->$name = null;
|
||||
else
|
||||
{
|
||||
if ($obj->parentKey) $key = $obj->parentKey;
|
||||
else $key = reset($table->keys);
|
||||
}
|
||||
else {
|
||||
if ($obj->parentKey) {
|
||||
$key = $obj->parentKey;
|
||||
}
|
||||
else {
|
||||
$key = reset($table->keys);
|
||||
}
|
||||
|
||||
$arrayOfOne = $obj->Find($key.'='.$this->$columnName.' '.$whereOrderBy,false,false,$extras);
|
||||
if ($arrayOfOne) {
|
||||
@@ -313,8 +351,7 @@ class ADODB_Active_Record {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($table->_hasMany[$name]))
|
||||
{
|
||||
if(!empty($table->_hasMany[$name])) {
|
||||
$obj = $table->_hasMany[$name];
|
||||
$key = reset($table->keys);
|
||||
$id = @$this->$key;
|
||||
@@ -323,7 +360,9 @@ class ADODB_Active_Record {
|
||||
$id = $db->qstr($id);
|
||||
}
|
||||
$objs = $obj->Find($obj->foreignKey.'='.$id. ' '.$whereOrderBy,false,false,$extras);
|
||||
if (!$objs) $objs = array();
|
||||
if (!$objs) {
|
||||
$objs = array();
|
||||
}
|
||||
$this->$name = $objs;
|
||||
return $objs;
|
||||
}
|
||||
@@ -345,13 +384,15 @@ class ADODB_Active_Record {
|
||||
$tableat = $this->_tableat;
|
||||
if (!$forceUpdate && !empty($tables[$tableat])) {
|
||||
|
||||
$tobj = $tables[$tableat];
|
||||
foreach($tobj->flds as $name => $fld) {
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
|
||||
$acttab = $tables[$tableat];
|
||||
foreach($acttab->flds as $name => $fld) {
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) {
|
||||
$this->$name = $fld->default_value;
|
||||
else
|
||||
}
|
||||
else {
|
||||
$this->$name = null;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
$db = $activedb->db;
|
||||
@@ -364,6 +405,16 @@ class ADODB_Active_Record {
|
||||
if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) {
|
||||
// abs(rand()) randomizes deletion, reducing contention to delete/refresh file
|
||||
// ideally, you should cache at least 32 secs
|
||||
|
||||
foreach($acttab->flds as $name => $fld) {
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) {
|
||||
$this->$name = $fld->default_value;
|
||||
}
|
||||
else {
|
||||
$this->$name = null;
|
||||
}
|
||||
}
|
||||
|
||||
$activedb->tables[$table] = $acttab;
|
||||
|
||||
//if ($db->debug) ADOConnection::outp("Reading cached active record file: $fname");
|
||||
@@ -377,11 +428,15 @@ class ADODB_Active_Record {
|
||||
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
|
||||
if ($db->fetchMode !== false) $savem = $db->SetFetchMode(false);
|
||||
if ($db->fetchMode !== false) {
|
||||
$savem = $db->SetFetchMode(false);
|
||||
}
|
||||
|
||||
$cols = $db->MetaColumns($table);
|
||||
|
||||
if (isset($savem)) $db->SetFetchMode($savem);
|
||||
if (isset($savem)) {
|
||||
$db->SetFetchMode($savem);
|
||||
}
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
if (!$cols) {
|
||||
@@ -393,7 +448,9 @@ class ADODB_Active_Record {
|
||||
if (isset($fld->primary_key)) {
|
||||
$pkeys = array();
|
||||
foreach($cols as $name => $fld) {
|
||||
if (!empty($fld->primary_key)) $pkeys[] = $name;
|
||||
if (!empty($fld->primary_key)) {
|
||||
$pkeys[] = $name;
|
||||
}
|
||||
}
|
||||
} else
|
||||
$pkeys = $this->GetPrimaryKeys($db, $table);
|
||||
@@ -410,10 +467,12 @@ class ADODB_Active_Record {
|
||||
case 0:
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = strtolower($name);
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
|
||||
$this->$name = $fldobj->default_value;
|
||||
else
|
||||
}
|
||||
else {
|
||||
$this->$name = null;
|
||||
}
|
||||
$attr[$name] = $fldobj;
|
||||
}
|
||||
foreach($pkeys as $k => $name) {
|
||||
@@ -425,10 +484,12 @@ class ADODB_Active_Record {
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = strtoupper($name);
|
||||
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
|
||||
$this->$name = $fldobj->default_value;
|
||||
else
|
||||
}
|
||||
else {
|
||||
$this->$name = null;
|
||||
}
|
||||
$attr[$name] = $fldobj;
|
||||
}
|
||||
|
||||
@@ -440,10 +501,12 @@ class ADODB_Active_Record {
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = ($fldobj->name);
|
||||
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
|
||||
$this->$name = $fldobj->default_value;
|
||||
else
|
||||
}
|
||||
else {
|
||||
$this->$name = null;
|
||||
}
|
||||
$attr[$name] = $fldobj;
|
||||
}
|
||||
foreach($pkeys as $k => $name) {
|
||||
@@ -458,14 +521,18 @@ class ADODB_Active_Record {
|
||||
if ($ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR) {
|
||||
$activetab->_created = time();
|
||||
$s = serialize($activetab);
|
||||
if (!function_exists('adodb_write_file')) include(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
if (!function_exists('adodb_write_file')) {
|
||||
include(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
}
|
||||
adodb_write_file($fname,$s);
|
||||
}
|
||||
if (isset($activedb->tables[$table])) {
|
||||
$oldtab = $activedb->tables[$table];
|
||||
|
||||
if ($oldtab) $activetab->_belongsTo = $oldtab->_belongsTo;
|
||||
if ($oldtab) $activetab->_hasMany = $oldtab->_hasMany;
|
||||
if ($oldtab) {
|
||||
$activetab->_belongsTo = $oldtab->_belongsTo;
|
||||
$activetab->_hasMany = $oldtab->_hasMany;
|
||||
}
|
||||
}
|
||||
$activedb->tables[$table] = $activetab;
|
||||
}
|
||||
@@ -483,17 +550,26 @@ class ADODB_Active_Record {
|
||||
$fn = get_class($this).'::'.$fn;
|
||||
$this->_lasterr = $fn.': '.$err;
|
||||
|
||||
if ($this->_dbat < 0) $db = false;
|
||||
if ($this->_dbat < 0) {
|
||||
$db = false;
|
||||
}
|
||||
else {
|
||||
$activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
|
||||
$db = $activedb->db;
|
||||
}
|
||||
|
||||
if (function_exists('adodb_throw')) {
|
||||
if (!$db) adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
|
||||
else adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
|
||||
} else
|
||||
if (!$db || $db->debug) ADOConnection::outp($this->_lasterr);
|
||||
if (!$db) {
|
||||
adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
|
||||
}
|
||||
else {
|
||||
adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
|
||||
}
|
||||
} else {
|
||||
if (!$db || $db->debug) {
|
||||
ADOConnection::outp($this->_lasterr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -501,18 +577,26 @@ class ADODB_Active_Record {
|
||||
function ErrorMsg()
|
||||
{
|
||||
if (!function_exists('adodb_throw')) {
|
||||
if ($this->_dbat < 0) $db = false;
|
||||
else $db = $this->DB();
|
||||
if ($this->_dbat < 0) {
|
||||
$db = false;
|
||||
}
|
||||
else {
|
||||
$db = $this->DB();
|
||||
}
|
||||
|
||||
// last error could be database error too
|
||||
if ($db && $db->ErrorMsg()) return $db->ErrorMsg();
|
||||
if ($db && $db->ErrorMsg()) {
|
||||
return $db->ErrorMsg();
|
||||
}
|
||||
}
|
||||
return $this->_lasterr;
|
||||
}
|
||||
|
||||
function ErrorNo()
|
||||
{
|
||||
if ($this->_dbat < 0) return -9999; // no database connection...
|
||||
if ($this->_dbat < 0) {
|
||||
return -9999; // no database connection...
|
||||
}
|
||||
$db = $this->DB();
|
||||
|
||||
return (int) $db->ErrorNo();
|
||||
@@ -548,8 +632,11 @@ class ADODB_Active_Record {
|
||||
// So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook
|
||||
function Reload()
|
||||
{
|
||||
$db =& $this->DB(); if (!$db) return false;
|
||||
$table =& $this->TableInfo();
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
$table = $this->TableInfo();
|
||||
$where = $this->GenWhere($db, $table);
|
||||
return($this->Load($where));
|
||||
}
|
||||
@@ -576,9 +663,10 @@ class ADODB_Active_Record {
|
||||
if (sizeof($row) == 2 * sizeof($table->flds)) {
|
||||
// Only keep string keys
|
||||
$keys = array_filter(array_keys($row), 'is_string');
|
||||
if (sizeof($keys) == sizeof($table->flds))
|
||||
if (sizeof($keys) == sizeof($table->flds)) {
|
||||
$bad_size = FALSE;
|
||||
}
|
||||
}
|
||||
if ($bad_size) {
|
||||
$this->Error("Table structure of $this->_table has changed","Load");
|
||||
return false;
|
||||
@@ -605,10 +693,12 @@ class ADODB_Active_Record {
|
||||
// get last inserted id for INSERT
|
||||
function LastInsertID(&$db,$fieldname)
|
||||
{
|
||||
if ($db->hasInsertID)
|
||||
if ($db->hasInsertID) {
|
||||
$val = $db->Insert_ID($this->_table,$fieldname);
|
||||
else
|
||||
}
|
||||
else {
|
||||
$val = false;
|
||||
}
|
||||
|
||||
if (is_null($val) || $val === false) {
|
||||
// this might not work reliably in multi-user environment
|
||||
@@ -621,18 +711,26 @@ class ADODB_Active_Record {
|
||||
function doquote(&$db, $val,$t)
|
||||
{
|
||||
switch($t) {
|
||||
case 'L':
|
||||
if (strpos($db->databaseType,'postgres') !== false) {
|
||||
return $db->qstr($val);
|
||||
}
|
||||
case 'D':
|
||||
case 'T':
|
||||
if (empty($val)) return 'null';
|
||||
|
||||
if (empty($val)) {
|
||||
return 'null';
|
||||
}
|
||||
case 'B':
|
||||
case 'N':
|
||||
case 'C':
|
||||
case 'X':
|
||||
if (is_null($val)) return 'null';
|
||||
if (is_null($val)) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
if (strlen($val)>1 &&
|
||||
(strncmp($val,"'",1) != 0 || substr($val,strlen($val)-1,1) != "'")) {
|
||||
if (strlen($val)>0 &&
|
||||
(strncmp($val,"'",1) != 0 || substr($val,strlen($val)-1,1) != "'")
|
||||
) {
|
||||
return $db->qstr($val);
|
||||
break;
|
||||
}
|
||||
@@ -660,37 +758,60 @@ class ADODB_Active_Record {
|
||||
|
||||
function _QName($n,$db=false)
|
||||
{
|
||||
if (!ADODB_Active_Record::$_quoteNames) return $n;
|
||||
if (!$db) $db = $this->DB(); if (!$db) return false;
|
||||
if (!ADODB_Active_Record::$_quoteNames) {
|
||||
return $n;
|
||||
}
|
||||
if (!$db) {
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $db->nameQuote.$n.$db->nameQuote;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------ Public functions below
|
||||
|
||||
function Load($where=null,$bindarr=false)
|
||||
function Load($where=null,$bindarr=false, $lock = false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
$db = $this->DB(); if (!$db) return false;
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
$this->_where = $where;
|
||||
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
if ($db->fetchMode !== false) $savem = $db->SetFetchMode(false);
|
||||
if ($db->fetchMode !== false) {
|
||||
$savem = $db->SetFetchMode(false);
|
||||
}
|
||||
|
||||
$qry = "select * from ".$this->_table;
|
||||
|
||||
if($where) {
|
||||
$qry .= ' WHERE '.$where;
|
||||
}
|
||||
if ($lock) {
|
||||
$qry .= $this->lockMode;
|
||||
}
|
||||
|
||||
$row = $db->GetRow($qry,$bindarr);
|
||||
|
||||
if (isset($savem)) $db->SetFetchMode($savem);
|
||||
if (isset($savem)) {
|
||||
$db->SetFetchMode($savem);
|
||||
}
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
return $this->Set($row);
|
||||
}
|
||||
|
||||
function LoadLocked($where=null, $bindarr=false)
|
||||
{
|
||||
$this->Load($where,$bindarr,true);
|
||||
}
|
||||
|
||||
# useful for multiple record inserts
|
||||
# see http://phplens.com/lens/lensforum/msgs.php?id=17795
|
||||
function Reset()
|
||||
@@ -712,8 +833,12 @@ class ADODB_Active_Record {
|
||||
// false on error
|
||||
function Save()
|
||||
{
|
||||
if ($this->_saved) $ok = $this->Update();
|
||||
else $ok = $this->Insert();
|
||||
if ($this->_saved) {
|
||||
$ok = $this->Update();
|
||||
}
|
||||
else {
|
||||
$ok = $this->Insert();
|
||||
}
|
||||
|
||||
return $ok;
|
||||
}
|
||||
@@ -722,7 +847,10 @@ class ADODB_Active_Record {
|
||||
// false on error
|
||||
function Insert()
|
||||
{
|
||||
$db = $this->DB(); if (!$db) return false;
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
$cnt = 0;
|
||||
$table = $this->TableInfo();
|
||||
|
||||
@@ -772,7 +900,10 @@ class ADODB_Active_Record {
|
||||
|
||||
function Delete()
|
||||
{
|
||||
$db = $this->DB(); if (!$db) return false;
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
$table = $this->TableInfo();
|
||||
|
||||
$where = $this->GenWhere($db,$table);
|
||||
@@ -785,7 +916,10 @@ class ADODB_Active_Record {
|
||||
// returns an array of active record objects
|
||||
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array())
|
||||
{
|
||||
$db = $this->DB(); if (!$db || empty($this->_table)) return false;
|
||||
$db = $this->DB();
|
||||
if (!$db || empty($this->_table)) {
|
||||
return false;
|
||||
}
|
||||
$arr = $db->GetActiveRecordsClass(get_class($this),$this->_table, $whereOrderBy,$bindarr,$pkeysArr,$extra);
|
||||
return $arr;
|
||||
}
|
||||
@@ -795,7 +929,10 @@ class ADODB_Active_Record {
|
||||
{
|
||||
global $ADODB_ASSOC_CASE;
|
||||
|
||||
$db = $this->DB(); if (!$db) return false;
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
$table = $this->TableInfo();
|
||||
|
||||
$pkey = $table->keys;
|
||||
@@ -805,7 +942,9 @@ class ADODB_Active_Record {
|
||||
/*
|
||||
if (is_null($val)) {
|
||||
if (isset($fld->not_null) && $fld->not_null) {
|
||||
if (isset($fld->default_value) && strlen($fld->default_value)) continue;
|
||||
if (isset($fld->default_value) && strlen($fld->default_value)) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
$this->Error("Cannot update null into $name","Replace");
|
||||
return false;
|
||||
@@ -816,22 +955,28 @@ class ADODB_Active_Record {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($val)) continue;
|
||||
if (is_array($val)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$t = $db->MetaType($fld->type);
|
||||
$arr[$name] = $this->doquote($db,$val,$t);
|
||||
$valarr[] = $val;
|
||||
}
|
||||
|
||||
if (!is_array($pkey)) $pkey = array($pkey);
|
||||
if (!is_array($pkey)) {
|
||||
$pkey = array($pkey);
|
||||
}
|
||||
|
||||
|
||||
if ($ADODB_ASSOC_CASE == 0)
|
||||
if ($ADODB_ASSOC_CASE == 0) {
|
||||
foreach($pkey as $k => $v)
|
||||
$pkey[$k] = strtolower($v);
|
||||
elseif ($ADODB_ASSOC_CASE == 1)
|
||||
foreach($pkey as $k => $v)
|
||||
}
|
||||
elseif ($ADODB_ASSOC_CASE == 1) {
|
||||
foreach($pkey as $k => $v) {
|
||||
$pkey[$k] = strtoupper($v);
|
||||
}
|
||||
}
|
||||
|
||||
$ok = $db->Replace($this->_table,$arr,$pkey);
|
||||
if ($ok) {
|
||||
@@ -858,7 +1003,10 @@ class ADODB_Active_Record {
|
||||
// returns 0 on error, 1 on update, -1 if no change in data (no update)
|
||||
function Update()
|
||||
{
|
||||
$db = $this->DB(); if (!$db) return false;
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
}
|
||||
$table = $this->TableInfo();
|
||||
|
||||
$where = $this->GenWhere($db, $table);
|
||||
@@ -877,12 +1025,15 @@ class ADODB_Active_Record {
|
||||
$val = $this->$name;
|
||||
$neworig[] = $val;
|
||||
|
||||
if (isset($table->keys[$name]) || is_array($val))
|
||||
if (isset($table->keys[$name]) || is_array($val)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_null($val)) {
|
||||
if (isset($fld->not_null) && $fld->not_null) {
|
||||
if (isset($fld->default_value) && strlen($fld->default_value)) continue;
|
||||
if (isset($fld->default_value) && strlen($fld->default_value)) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
$this->Error("Cannot set field $name to NULL","Update");
|
||||
return false;
|
||||
@@ -890,16 +1041,24 @@ class ADODB_Active_Record {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->_original[$i]) && $val == $this->_original[$i]) {
|
||||
if (isset($this->_original[$i]) && strcmp($val,$this->_original[$i]) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_null($this->_original[$i]) && is_null($val)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$valarr[] = $val;
|
||||
$pairs[] = $this->_QName($name,$db).'='.$db->Param($cnt);
|
||||
$cnt += 1;
|
||||
}
|
||||
|
||||
|
||||
if (!$cnt) return -1;
|
||||
if (!$cnt) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.$this->_table." SET ".implode(",",$pairs)." WHERE ".$where;
|
||||
$ok = $db->Execute($sql,$valarr);
|
||||
if ($ok) {
|
||||
@@ -912,7 +1071,9 @@ class ADODB_Active_Record {
|
||||
function GetAttributeNames()
|
||||
{
|
||||
$table = $this->TableInfo();
|
||||
if (!$table) return false;
|
||||
if (!$table) {
|
||||
return false;
|
||||
}
|
||||
return array_keys($table->flds);
|
||||
}
|
||||
|
||||
@@ -927,10 +1088,10 @@ $extra)
|
||||
$save = $db->SetFetchMode(ADODB_FETCH_NUM);
|
||||
$qry = "select * from ".$table;
|
||||
|
||||
if (!empty($whereOrderBy))
|
||||
if (!empty($whereOrderBy)) {
|
||||
$qry .= ' WHERE '.$whereOrderBy;
|
||||
if(isset($extra['limit']))
|
||||
{
|
||||
}
|
||||
if(isset($extra['limit'])) {
|
||||
$rows = false;
|
||||
if(isset($extra['offset'])) {
|
||||
$rs = $db->SelectLimit($qry, $extra['limit'], $extra['offset'],$bindarr);
|
||||
@@ -979,4 +1140,3 @@ $extra)
|
||||
|
||||
return $arr;
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,9 @@ $ADODB_INCLUDED_CSV = 1;
|
||||
|
||||
/*
|
||||
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -292,7 +294,7 @@ function adodb_write_file($filename, $contents,$debug=false)
|
||||
// the tricky moment
|
||||
@unlink($filename);
|
||||
if (!@rename($tmpname,$filename)) {
|
||||
unlink($tmpname);
|
||||
@unlink($tmpname);
|
||||
$ok = 0;
|
||||
}
|
||||
if (!$ok) {
|
||||
@@ -315,4 +317,3 @@ function adodb_write_file($filename, $contents,$debug=false)
|
||||
|
||||
return $ok;
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -590,6 +592,8 @@ class ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function _GenFields($flds,$widespacing=false)
|
||||
{
|
||||
if (is_string($flds)) {
|
||||
@@ -913,6 +917,21 @@ class ADODB_DataDict {
|
||||
return $newopts;
|
||||
}
|
||||
|
||||
|
||||
function _getSizePrec($size)
|
||||
{
|
||||
$fsize = false;
|
||||
$fprec = false;
|
||||
$dotat = strpos($size,'.');
|
||||
if ($dotat === false) $dotat = strpos($size,',');
|
||||
if ($dotat === false) $fsize = $size;
|
||||
else {
|
||||
$fsize = substr($size,0,$dotat);
|
||||
$fprec = substr($size,$dotat+1);
|
||||
}
|
||||
return array($fsize, $fprec);
|
||||
}
|
||||
|
||||
/**
|
||||
"Florian Buzin [ easywe ]" <florian.buzin#easywe.de>
|
||||
|
||||
@@ -958,9 +977,16 @@ class ADODB_DataDict {
|
||||
$c = $cols[$k];
|
||||
$ml = $c->max_length;
|
||||
$mt = $this->MetaType($c->type,$ml);
|
||||
|
||||
if (isset($c->scale)) $sc = $c->scale;
|
||||
else $sc = 99; // always force change if scale not known.
|
||||
|
||||
if ($sc == -1) $sc = false;
|
||||
list($fsize, $fprec) = $this->_getSizePrec($v['SIZE']);
|
||||
|
||||
if ($ml == -1) $ml = '';
|
||||
if ($mt == 'X') $ml = $v['SIZE'];
|
||||
if (($mt != $v['TYPE']) || $ml != $v['SIZE'] || (isset($v['AUTOINCREMENT']) && $v['AUTOINCREMENT'] != $obj->auto_increment)) {
|
||||
if (($mt != $v['TYPE']) || ($ml != $fsize || $sc != $fprec) || (isset($v['AUTOINCREMENT']) && $v['AUTOINCREMENT'] != $obj->auto_increment)) {
|
||||
$holdflds[$k] = $v;
|
||||
}
|
||||
} else {
|
||||
@@ -1005,4 +1031,3 @@ class ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
} // class
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -41,6 +43,9 @@ if (!defined("DB_ERROR_SYNTAX")) {
|
||||
define("DB_ERROR_EXTENSION_NOT_FOUND",-25);
|
||||
define("DB_ERROR_NOSUCHDB", -25);
|
||||
define("DB_ERROR_ACCESS_VIOLATION", -26);
|
||||
define("DB_ERROR_DEADLOCK", -27);
|
||||
define("DB_ERROR_STATEMENT_TIMEOUT", -28);
|
||||
define("DB_ERROR_SERIALIZATION_FAILURE", -29);
|
||||
}
|
||||
|
||||
function adodb_errormsg($value)
|
||||
@@ -91,20 +96,23 @@ function adodb_error($provider,$dbType,$errno)
|
||||
function adodb_error_pg($errormsg)
|
||||
{
|
||||
if (is_numeric($errormsg)) return (integer) $errormsg;
|
||||
// Postgres has no lock-wait timeout. The best we could do would be to set a statement timeout.
|
||||
static $error_regexps = array(
|
||||
'/(Table does not exist\.|Relation [\"\'].*[\"\'] does not exist|sequence does not exist|class ".+" not found)$/i' => DB_ERROR_NOSUCHTABLE,
|
||||
'/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*/i' => DB_ERROR_ALREADY_EXISTS,
|
||||
'/divide by zero$/i' => DB_ERROR_DIVZERO,
|
||||
'/pg_atoi: error in .*: can\'t parse /i' => DB_ERROR_INVALID_NUMBER,
|
||||
'/ttribute [\"\'].*[\"\'] not found|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']/i' => DB_ERROR_NOSUCHFIELD,
|
||||
'/parser: parse error at or near \"/i' => DB_ERROR_SYNTAX,
|
||||
'/referential integrity violation/i' => DB_ERROR_CONSTRAINT,
|
||||
'/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key violates unique constraint/i'
|
||||
=> DB_ERROR_ALREADY_EXISTS
|
||||
'(Table does not exist\.|Relation [\"\'].*[\"\'] does not exist|sequence does not exist|class ".+" not found)$' => DB_ERROR_NOSUCHTABLE,
|
||||
'Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key.*violates unique constraint' => DB_ERROR_ALREADY_EXISTS,
|
||||
'database ".+" does not exist$' => DB_ERROR_NOSUCHDB,
|
||||
'(divide|division) by zero$' => DB_ERROR_DIVZERO,
|
||||
'pg_atoi: error in .*: can\'t parse ' => DB_ERROR_INVALID_NUMBER,
|
||||
'ttribute [\"\'].*[\"\'] not found|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']' => DB_ERROR_NOSUCHFIELD,
|
||||
'(parser: parse|syntax) error at or near \"' => DB_ERROR_SYNTAX,
|
||||
'referential integrity violation' => DB_ERROR_CONSTRAINT,
|
||||
'deadlock detected$' => DB_ERROR_DEADLOCK,
|
||||
'canceling statement due to statement timeout$' => DB_ERROR_STATEMENT_TIMEOUT,
|
||||
'could not serialize access due to' => DB_ERROR_SERIALIZATION_FAILURE
|
||||
);
|
||||
reset($error_regexps);
|
||||
while (list($regexp,$code) = each($error_regexps)) {
|
||||
if (preg_match($regexp, $errormsg)) {
|
||||
if (preg_match("/$regexp/mi", $errormsg)) {
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
@@ -255,4 +263,3 @@ function adodb_error_mysql()
|
||||
|
||||
return $MAP;
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -76,4 +78,3 @@ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnec
|
||||
//print "<p>$s</p>";
|
||||
trigger_error($s,ADODB_ERROR_HANDLER_TYPE);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -84,5 +86,3 @@ function ADODB_PEAR_Error()
|
||||
|
||||
return $ADODB_Last_PEAR_Error;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -29,9 +31,9 @@ class ADODB_Exception extends Exception {
|
||||
{
|
||||
switch($fn) {
|
||||
case 'EXECUTE':
|
||||
$this->sql = $p1;
|
||||
$this->sql = is_array($p1) ? $p1[0] : $p1;
|
||||
$this->params = $p2;
|
||||
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$p1\")\n";
|
||||
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")\n";
|
||||
break;
|
||||
|
||||
case 'PCONNECT':
|
||||
@@ -77,6 +79,3 @@ function adodb_throw($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
|
||||
else $errfn = 'ADODB_EXCEPTION';
|
||||
throw new $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -22,9 +24,3 @@
|
||||
|
||||
Moved to adodb.inc.php to improve performance.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,8 +1,4 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
@@ -10,7 +6,9 @@ global $ADODB_INCLUDED_LIB;
|
||||
$ADODB_INCLUDED_LIB = 1;
|
||||
|
||||
/*
|
||||
@version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim\@natsoft.com.my). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -21,10 +19,10 @@ $ADODB_INCLUDED_LIB = 1;
|
||||
|
||||
function adodb_strip_order_by($sql)
|
||||
{
|
||||
$rez = preg_match('/(\sORDER\s+BY\s[^)]*)/is',$sql,$arr);
|
||||
$rez = preg_match('/(\sORDER\s+BY\s(?:[^)](?!LIMIT))*)/is', $sql, $arr);
|
||||
if ($arr)
|
||||
if (strpos($arr[0],'(') !== false) {
|
||||
$at = strpos($sql,$arr[0]);
|
||||
if (strpos($arr[1], '(') !== false) {
|
||||
$at = strpos($sql, $arr[1]);
|
||||
$cntin = 0;
|
||||
for ($i=$at, $max=strlen($sql); $i < $max; $i++) {
|
||||
$ch = $sql[$i];
|
||||
@@ -38,8 +36,9 @@ function adodb_strip_order_by($sql)
|
||||
}
|
||||
}
|
||||
$sql = substr($sql,0,$at).substr($sql,$i);
|
||||
} else
|
||||
$sql = str_replace($arr[0], '', $sql);
|
||||
} else {
|
||||
$sql = str_replace($arr[1], '', $sql);
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
|
||||
@@ -424,8 +423,11 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
|
||||
}
|
||||
} else {
|
||||
// now replace SELECT ... FROM with SELECT COUNT(*) FROM
|
||||
$rewritesql = preg_replace(
|
||||
'/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
|
||||
if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {
|
||||
$rewritesql = preg_replace('/^\s*?SELECT\s+_ADODB_COUNT(.*)_ADODB_COUNT\s/is','SELECT COUNT(*) ',$sql);
|
||||
} else {
|
||||
$rewritesql = preg_replace('/^\s*?SELECT\s.*?\s+(.*?)\s+FROM\s/is','SELECT COUNT(*) FROM ',$sql);
|
||||
}
|
||||
// fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
|
||||
// with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
|
||||
// also see http://phplens.com/lens/lensforum/msgs.php?id=12752
|
||||
@@ -455,9 +457,13 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
|
||||
|
||||
if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
|
||||
|
||||
if ($secs2cache) {
|
||||
$rstest = $zthis->CacheExecute($secs2cache,$rewritesql,$inputarr);
|
||||
if (!$rstest) $rstest = $zthis->CacheExecute($secs2cache,$sql,$inputarr);
|
||||
} else {
|
||||
$rstest = $zthis->Execute($rewritesql,$inputarr);
|
||||
if (!$rstest) $rstest = $zthis->Execute($sql,$inputarr);
|
||||
|
||||
}
|
||||
if ($rstest) {
|
||||
$qryRecs = $rstest->RecordCount();
|
||||
if ($qryRecs == -1) {
|
||||
@@ -542,46 +548,86 @@ $inputarr=false, $secs2cache=0)
|
||||
return $rsreturn;
|
||||
}
|
||||
|
||||
// Iv<EFBFBD>n Oliva version
|
||||
// Iván Oliva version
|
||||
function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0)
|
||||
{
|
||||
|
||||
$atfirstpage = false;
|
||||
$atlastpage = false;
|
||||
|
||||
if (!isset($page) || $page <= 1) { // If page number <= 1, then we are at the first page
|
||||
if (!isset($page) || $page <= 1) {
|
||||
// If page number <= 1, then we are at the first page
|
||||
$page = 1;
|
||||
$atfirstpage = true;
|
||||
}
|
||||
if ($nrows <= 0) $nrows = 10; // If an invalid nrows is supplied, we assume a default value of 10 rows per page
|
||||
if ($nrows <= 0) {
|
||||
// If an invalid nrows is supplied, we assume a default value of 10 rows per page
|
||||
$nrows = 10;
|
||||
}
|
||||
|
||||
// ***** Here we check whether $page is the last page or whether we are trying to retrieve a page number greater than
|
||||
// the last page number.
|
||||
$pagecounteroffset = ($page * $nrows) - $nrows;
|
||||
|
||||
// To find out if there are more pages of rows, simply increase the limit or
|
||||
// nrows by 1 and see if that number of records was returned. If it was,
|
||||
// then we know there is at least one more page left, otherwise we are on
|
||||
// the last page. Therefore allow non-Count() paging with single queries
|
||||
// rather than three queries as was done before.
|
||||
$test_nrows = $nrows + 1;
|
||||
if ($secs2cache > 0) {
|
||||
$rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
|
||||
} else {
|
||||
$rsreturn = $zthis->SelectLimit($sql, $test_nrows, $pagecounteroffset, $inputarr, $secs2cache);
|
||||
}
|
||||
|
||||
// Now check to see if the number of rows returned was the higher value we asked for or not.
|
||||
if ( $rsreturn->_numOfRows == $test_nrows ) {
|
||||
// Still at least 1 more row, so we are not on last page yet...
|
||||
// Remove the last row from the RS.
|
||||
$rsreturn->_numOfRows = ( $rsreturn->_numOfRows - 1 );
|
||||
} elseif ( $rsreturn->_numOfRows == 0 && $page > 1 ) {
|
||||
// Likely requested a page that doesn't exist, so need to find the last
|
||||
// page and return it. Revert to original method and loop through pages
|
||||
// until we find some data...
|
||||
$pagecounter = $page + 1;
|
||||
$pagecounteroffset = ($pagecounter * $nrows) - $nrows;
|
||||
if ($secs2cache>0) $rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
|
||||
else $rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache);
|
||||
|
||||
$rstest = $rsreturn;
|
||||
if ($rstest) {
|
||||
while ($rstest && $rstest->EOF && $pagecounter > 0) {
|
||||
$atlastpage = true;
|
||||
$pagecounter--;
|
||||
$pagecounteroffset = $nrows * ($pagecounter - 1);
|
||||
$rstest->Close();
|
||||
if ($secs2cache>0) $rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
|
||||
else $rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache);
|
||||
if ($secs2cache>0) {
|
||||
$rstest = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr);
|
||||
}
|
||||
else {
|
||||
$rstest = $zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $secs2cache);
|
||||
}
|
||||
}
|
||||
if ($rstest) $rstest->Close();
|
||||
}
|
||||
if ($atlastpage) { // If we are at the last page or beyond it, we are going to retrieve it
|
||||
if ($atlastpage) {
|
||||
// If we are at the last page or beyond it, we are going to retrieve it
|
||||
$page = $pagecounter;
|
||||
if ($page == 1) $atfirstpage = true; // We have to do this again in case the last page is the same as the first
|
||||
//... page, that is, the recordset has only 1 page.
|
||||
if ($page == 1) {
|
||||
// We have to do this again in case the last page is the same as
|
||||
// the first page, that is, the recordset has only 1 page.
|
||||
$atfirstpage = true;
|
||||
}
|
||||
}
|
||||
|
||||
// We get the data we want
|
||||
$offset = $nrows * ($page-1);
|
||||
if ($secs2cache > 0) $rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr);
|
||||
else $rsreturn = $zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
|
||||
if ($secs2cache > 0) {
|
||||
$rsreturn = $zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr);
|
||||
}
|
||||
else {
|
||||
$rsreturn = $zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
|
||||
}
|
||||
} elseif ( $rsreturn->_numOfRows < $test_nrows ) {
|
||||
// Rows is less than what we asked for, so must be at the last page.
|
||||
$atlastpage = true;
|
||||
}
|
||||
|
||||
// Before returning the RecordSet, we set the pagination properties we need
|
||||
if ($rsreturn) {
|
||||
@@ -643,13 +689,19 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
|
||||
$type = 'C';
|
||||
}
|
||||
|
||||
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES))
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
|
||||
else
|
||||
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) {
|
||||
switch ($ADODB_QUOTE_FIELDNAMES) {
|
||||
case 'LOWER':
|
||||
$fnameq = $zthis->nameQuote.strtolower($field->name).$zthis->nameQuote;break;
|
||||
case 'NATIVE':
|
||||
$fnameq = $zthis->nameQuote.$field->name.$zthis->nameQuote;break;
|
||||
case 'UPPER':
|
||||
default:
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;break;
|
||||
}
|
||||
} else
|
||||
$fnameq = $upperfname;
|
||||
|
||||
|
||||
// is_null requires php 4.0.4
|
||||
//********************************************************//
|
||||
if (is_null($arrFields[$upperfname])
|
||||
|| (empty($arrFields[$upperfname]) && strlen($arrFields[$upperfname]) == 0)
|
||||
@@ -807,9 +859,17 @@ function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false,$force=2)
|
||||
$upperfname = strtoupper($field->name);
|
||||
if (adodb_key_exists($upperfname,$arrFields,$force)) {
|
||||
$bad = false;
|
||||
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES))
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
|
||||
else
|
||||
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) {
|
||||
switch ($ADODB_QUOTE_FIELDNAMES) {
|
||||
case 'LOWER':
|
||||
$fnameq = $zthis->nameQuote.strtolower($field->name).$zthis->nameQuote;break;
|
||||
case 'NATIVE':
|
||||
$fnameq = $zthis->nameQuote.$field->name.$zthis->nameQuote;break;
|
||||
case 'UPPER':
|
||||
default:
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;break;
|
||||
}
|
||||
} else
|
||||
$fnameq = $upperfname;
|
||||
|
||||
$type = $recordSet->MetaType($field->type);
|
||||
@@ -1189,5 +1249,3 @@ function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0,$ishtml=null)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
?>
|
||||
@@ -7,11 +7,13 @@ global $ADODB_INCLUDED_MEMCACHE;
|
||||
$ADODB_INCLUDED_MEMCACHE = 1;
|
||||
|
||||
global $ADODB_INCLUDED_CSV;
|
||||
if (empty($ADODB_INCLUDED_CSV)) include(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
|
||||
/*
|
||||
|
||||
V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -48,7 +50,7 @@ class ADODB_Cache_MemCache {
|
||||
var $_connected = false;
|
||||
var $_memcache = false;
|
||||
|
||||
function ADODB_Cache_MemCache(&$obj)
|
||||
function __construct(&$obj)
|
||||
{
|
||||
$this->hosts = $obj->memCacheHost;
|
||||
$this->port = $obj->memCachePort;
|
||||
@@ -91,7 +93,7 @@ class ADODB_Cache_MemCache {
|
||||
}
|
||||
if (!$this->_memcache) return false;
|
||||
|
||||
if (!$this->_memcache->set($filename, $contents, $this->compress, $secs2cache)) {
|
||||
if (!$this->_memcache->set($filename, $contents, $this->compress ? MEMCACHE_COMPRESSED : 0, $secs2cache)) {
|
||||
if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!<br>\n");
|
||||
return false;
|
||||
}
|
||||
@@ -186,5 +188,3 @@ class ADODB_Cache_MemCache {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -55,7 +57,7 @@ class ADODB_Pager {
|
||||
// if you have multiple on 1 page.
|
||||
// $id should be only be [a-z0-9]*
|
||||
//
|
||||
function ADODB_Pager(&$db,$sql,$id = 'adodb', $showPageLinks = false)
|
||||
function __construct(&$db,$sql,$id = 'adodb', $showPageLinks = false)
|
||||
{
|
||||
global $PHP_SELF;
|
||||
|
||||
@@ -85,8 +87,7 @@ class ADODB_Pager {
|
||||
global $PHP_SELF;
|
||||
if ($anchor) {
|
||||
?>
|
||||
<a href="<?php echo $PHP_SELF,'?',$this->id;?>_next_page=1"><?php echo $this->first;?></a>
|
||||
|
||||
<a href="<?php echo $PHP_SELF,'?',$this->id;?>_next_page=1"><?php echo $this->first;?></a>
|
||||
<?php
|
||||
} else {
|
||||
print "$this->first ";
|
||||
@@ -101,9 +102,7 @@ class ADODB_Pager {
|
||||
|
||||
if ($anchor) {
|
||||
?>
|
||||
<a
|
||||
href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->AbsolutePage() + 1 ?>"><?php echo $this->next;?></a>
|
||||
|
||||
<a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->AbsolutePage() + 1 ?>"><?php echo $this->next;?></a>
|
||||
<?php
|
||||
} else {
|
||||
print "$this->next ";
|
||||
@@ -124,9 +123,7 @@ class ADODB_Pager {
|
||||
|
||||
if ($anchor) {
|
||||
?>
|
||||
<a
|
||||
href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->LastPageNo() ?>"><?php echo $this->last;?></a>
|
||||
|
||||
<a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->LastPageNo() ?>"><?php echo $this->last;?></a>
|
||||
<?php
|
||||
} else {
|
||||
print "$this->last ";
|
||||
@@ -175,9 +172,7 @@ class ADODB_Pager {
|
||||
global $PHP_SELF;
|
||||
if ($anchor) {
|
||||
?>
|
||||
<a
|
||||
href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->AbsolutePage() - 1 ?>"><?php echo $this->prev;?></a>
|
||||
|
||||
<a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->AbsolutePage() - 1 ?>"><?php echo $this->prev;?></a>
|
||||
<?php
|
||||
} else {
|
||||
print "$this->prev ";
|
||||
@@ -292,6 +287,3 @@ class ADODB_Pager {
|
||||
"</td></tr></table>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -52,10 +54,6 @@ if (!defined('DB_OK')) {
|
||||
define("DB_OK", 1);
|
||||
define("DB_ERROR",-1);
|
||||
|
||||
// autoExecute constants
|
||||
define('DB_AUTOQUERY_INSERT', 1);
|
||||
define('DB_AUTOQUERY_UPDATE', 2);
|
||||
|
||||
/**
|
||||
* This is a special constant that tells DB the user hasn't specified
|
||||
* any particular get mode, so the default should be used.
|
||||
@@ -370,5 +368,3 @@ class DB
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -224,7 +226,7 @@ class adodb_perf {
|
||||
var $cliFormat = "%32s => %s \r\n";
|
||||
var $sql1 = 'sql1'; // used for casting sql1 to text for mssql
|
||||
var $explain = true;
|
||||
var $helpurl = "<a href=http://phplens.com/adodb/reference.functions.fnexecute.and.fncacheexecute.properties.html#logsql>LogSQL help</a>";
|
||||
var $helpurl = '<a href="http://adodb.sourceforge.net/docs-adodb.htm#logsql">LogSQL help</a>';
|
||||
var $createTableSQL = false;
|
||||
var $maxLength = 2000;
|
||||
|
||||
@@ -935,16 +937,15 @@ class adodb_perf {
|
||||
?>
|
||||
|
||||
<form method="POST" action="<?php echo $PHP_SELF ?>">
|
||||
<table>
|
||||
<table><tr>
|
||||
<td> Form size: <input type="submit" value=" < " name="SMALLER"><input type="submit" value=" > > " name="BIGGER">
|
||||
</td>
|
||||
<td align=right>
|
||||
<input type="submit" value=" Run SQL Below " name="RUN"><input type=hidden name=do value=dosql>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td>Form size: <input type="submit" value=" < " name="SMALLER"><input
|
||||
type="submit" value=" > > " name="BIGGER"></td>
|
||||
<td align=right><input type="submit" value=" Run SQL Below "
|
||||
name="RUN"><input type=hidden name=do value=dosql></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2><textarea rows=<?php print $rows; ?> name="sql"
|
||||
cols="80"><?php print htmlspecialchars($sql) ?></textarea></td>
|
||||
<td colspan=2><textarea rows=<?php print $rows; ?> name="sql" cols="80"><?php print htmlspecialchars($sql) ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
@@ -1096,5 +1097,3 @@ class adodb_perf {
|
||||
}
|
||||
// end hack
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -12,5 +14,3 @@
|
||||
|
||||
class ADODB_BASE_RS {
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
/*
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
Download: http://phplens.com/phpeverywhere/
|
||||
Download: http://adodb.sourceforge.net/#download
|
||||
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
PHP native date functions use integer timestamps for computations.
|
||||
Because of this, dates are restricted to the years 1901-2038 on Unix
|
||||
@@ -57,7 +61,7 @@
|
||||
|
||||
COPYRIGHT
|
||||
|
||||
(c) 2003-2005 John Lim and released under BSD-style license except for code by
|
||||
(c) 2003-2014 John Lim and released under BSD-style license except for code by
|
||||
jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year
|
||||
and originally found at http://www.php.net/manual/en/function.mktime.php
|
||||
|
||||
@@ -73,6 +77,9 @@
|
||||
|
||||
FUNCTION DESCRIPTIONS
|
||||
|
||||
** FUNCTION adodb_time()
|
||||
|
||||
Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) as an unsigned integer.
|
||||
|
||||
** FUNCTION adodb_getdate($date=false)
|
||||
|
||||
@@ -241,6 +248,14 @@
|
||||
|
||||
|
||||
CHANGELOG
|
||||
- 16 Jan 2011 0.36
|
||||
Added adodb_time() which returns current time. If > 2038, will return as float
|
||||
|
||||
- 7 Feb 2011 0.35
|
||||
Changed adodb_date to be symmetric with adodb_mktime. See $jan1_71. fix for bc.
|
||||
|
||||
- 13 July 2010 0.34
|
||||
Changed adodb_get_gm_diff to use DateTimeZone().
|
||||
|
||||
- 11 Feb 2008 0.33
|
||||
* Bug in 0.32 fix for hour handling. Fixed.
|
||||
@@ -386,7 +401,7 @@
|
||||
/*
|
||||
Version Number
|
||||
*/
|
||||
define('ADODB_DATE_VERSION',0.33);
|
||||
define('ADODB_DATE_VERSION',0.35);
|
||||
|
||||
$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);
|
||||
|
||||
@@ -601,6 +616,12 @@ function adodb_date_test()
|
||||
else print "<p><b>Failed</b> :-(</p>";
|
||||
}
|
||||
|
||||
function adodb_time()
|
||||
{
|
||||
$d = new DateTime();
|
||||
return $d->format('U');
|
||||
}
|
||||
|
||||
/**
|
||||
Returns day of week, 0 = Sunday,... 6=Saturday.
|
||||
Algorithm from PEAR::Date_Calc
|
||||
@@ -729,9 +750,17 @@ function adodb_get_gmt_diff($y,$m,$d)
|
||||
} else {
|
||||
if (isset($TZ)) return $TZ;
|
||||
$y = date('Y');
|
||||
$TZ = @mktime(0,0,0,12,2,$y,0) - @gmmktime(0,0,0,12,2,$y,0);
|
||||
/*
|
||||
if (function_exists('date_default_timezone_get') && function_exists('timezone_offset_get')) {
|
||||
$tzonename = date_default_timezone_get();
|
||||
if ($tzonename) {
|
||||
$tobj = new DateTimeZone($tzonename);
|
||||
$TZ = -timezone_offset_get($tobj,new DateTime("now",$tzo));
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (empty($TZ)) $TZ = mktime(0,0,0,12,2,$y) - gmmktime(0,0,0,12,2,$y);
|
||||
}
|
||||
|
||||
return $TZ;
|
||||
}
|
||||
|
||||
@@ -1040,11 +1069,19 @@ function adodb_date($fmt,$d=false,$is_gmt=false)
|
||||
{
|
||||
static $daylight;
|
||||
global $ADODB_DATETIME_CLASS;
|
||||
static $jan1_1971;
|
||||
|
||||
|
||||
if (!isset($daylight)) {
|
||||
$daylight = function_exists('adodb_daylight_sv');
|
||||
if (empty($jan1_1971)) $jan1_1971 = mktime(0,0,0,1,1,1971); // we only use date() when > 1970 as adodb_mktime() only uses mktime() when > 1970
|
||||
}
|
||||
|
||||
if ($d === false) return ($is_gmt)? @gmdate($fmt): @date($fmt);
|
||||
if (!defined('ADODB_TEST_DATES')) {
|
||||
if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
|
||||
if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer
|
||||
|
||||
if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= $jan1_1971) // if windows, must be +ve integer
|
||||
return ($is_gmt)? @gmdate($fmt,$d): @date($fmt,$d);
|
||||
|
||||
}
|
||||
@@ -1053,7 +1090,6 @@ function adodb_date($fmt,$d=false,$is_gmt=false)
|
||||
|
||||
$arr = _adodb_getdate($d,true,$is_gmt);
|
||||
|
||||
if (!isset($daylight)) $daylight = function_exists('adodb_daylight_sv');
|
||||
if ($daylight) adodb_daylight_sv($arr, $is_gmt);
|
||||
|
||||
$year = $arr['year'];
|
||||
@@ -1074,6 +1110,9 @@ function adodb_date($fmt,$d=false,$is_gmt=false)
|
||||
*/
|
||||
for ($i=0; $i < $max; $i++) {
|
||||
switch($fmt[$i]) {
|
||||
case 'e':
|
||||
$dates .= date('e');
|
||||
break;
|
||||
case 'T':
|
||||
if ($ADODB_DATETIME_CLASS) {
|
||||
$dt = new DateTime();
|
||||
@@ -1421,6 +1460,3 @@ function adodb_strftime($fmt, $ts=false,$is_gmt=false)
|
||||
$ret = adodb_date($fmtdate, $ts, $is_gmt);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -118,7 +118,7 @@ class dbObject {
|
||||
/**
|
||||
* NOP
|
||||
*/
|
||||
function dbObject( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class dbObject {
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
function create(&$xmls) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ class dbTable extends dbObject {
|
||||
* @param string $prefix DB Object prefix
|
||||
* @param array $attributes Array of table attributes.
|
||||
*/
|
||||
function dbTable( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
$this->name = $this->prefix($attributes['NAME']);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ class dbIndex extends dbObject {
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
function dbIndex( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
|
||||
$this->name = $this->prefix ($attributes['NAME']);
|
||||
@@ -786,7 +786,7 @@ class dbData extends dbObject {
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
function dbData( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
@@ -985,7 +985,7 @@ class dbQuerySet extends dbObject {
|
||||
* @param object $parent Parent object
|
||||
* @param array $attributes Attributes
|
||||
*/
|
||||
function dbQuerySet( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
|
||||
// Overrides the manual prefix key
|
||||
@@ -1301,10 +1301,11 @@ class adoSchema {
|
||||
*
|
||||
* @param object $db ADOdb database connection object.
|
||||
*/
|
||||
function adoSchema( &$db ) {
|
||||
function __construct( $db ) {
|
||||
// Initialize the environment
|
||||
$this->mgq = get_magic_quotes_runtime();
|
||||
@set_magic_quotes_runtime(0);
|
||||
ini_set("magic_quotes_runtime", 0);
|
||||
#set_magic_quotes_runtime(0);
|
||||
|
||||
$this->db = $db;
|
||||
$this->debug = $this->db->debug;
|
||||
@@ -2193,7 +2194,8 @@ class adoSchema {
|
||||
* @deprecated adoSchema now cleans up automatically.
|
||||
*/
|
||||
function Destroy() {
|
||||
@set_magic_quotes_runtime( $this->mgq );
|
||||
ini_set("magic_quotes_runtime", $this->mgq );
|
||||
#set_magic_quotes_runtime( $this->mgq );
|
||||
unset( $this );
|
||||
}
|
||||
}
|
||||
@@ -2220,4 +2222,3 @@ function logMsg( $msg, $title = NULL, $force = FALSE ) {
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -136,7 +136,7 @@ class dbObject {
|
||||
/**
|
||||
* NOP
|
||||
*/
|
||||
function dbObject( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ class dbObject {
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
function create(&$xmls) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ class dbTable extends dbObject {
|
||||
* @param string $prefix DB Object prefix
|
||||
* @param array $attributes Array of table attributes.
|
||||
*/
|
||||
function dbTable( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
$this->name = $this->prefix($attributes['NAME']);
|
||||
}
|
||||
@@ -683,7 +683,7 @@ class dbIndex extends dbObject {
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
function dbIndex( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
|
||||
$this->name = $this->prefix ($attributes['NAME']);
|
||||
@@ -828,7 +828,7 @@ class dbData extends dbObject {
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
function dbData( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
@@ -1084,7 +1084,7 @@ class dbQuerySet extends dbObject {
|
||||
* @param object $parent Parent object
|
||||
* @param array $attributes Attributes
|
||||
*/
|
||||
function dbQuerySet( &$parent, $attributes = NULL ) {
|
||||
function __construct( &$parent, $attributes = NULL ) {
|
||||
$this->parent = $parent;
|
||||
|
||||
// Overrides the manual prefix key
|
||||
@@ -1405,10 +1405,11 @@ class adoSchema {
|
||||
*
|
||||
* @param object $db ADOdb database connection object.
|
||||
*/
|
||||
function adoSchema( &$db ) {
|
||||
function __construct( $db ) {
|
||||
// Initialize the environment
|
||||
$this->mgq = get_magic_quotes_runtime();
|
||||
@set_magic_quotes_runtime(0);
|
||||
#set_magic_quotes_runtime(0);
|
||||
ini_set("magic_quotes_runtime", 0);
|
||||
|
||||
$this->db = $db;
|
||||
$this->debug = $this->db->debug;
|
||||
@@ -2103,11 +2104,12 @@ class adoSchema {
|
||||
|
||||
$schema = '<?xml version="1.0"?>' . "\n"
|
||||
. '<schema version="' . $this->schemaVersion . '">' . "\n";
|
||||
|
||||
if( is_array( $tables = $this->db->MetaTables( 'TABLES' , ($prefix) ? $prefix.'%' : '') ) ) {
|
||||
if( is_array( $tables = $this->db->MetaTables( 'TABLES' ,false ,($prefix) ? str_replace('_','\_',$prefix).'%' : '') ) ) {
|
||||
foreach( $tables as $table ) {
|
||||
if ($stripprefix) $table = str_replace(str_replace('\\_', '_', $pfx ), '', $table);
|
||||
$schema .= $indent . '<table name="' . htmlentities( $table ) . '">' . "\n";
|
||||
$schema .= $indent
|
||||
. '<table name="'
|
||||
. htmlentities( $stripprefix ? str_replace($prefix, '', $table) : $table )
|
||||
. '">' . "\n";
|
||||
|
||||
// grab details from database
|
||||
$rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE -1' );
|
||||
@@ -2374,7 +2376,8 @@ class adoSchema {
|
||||
* @deprecated adoSchema now cleans up automatically.
|
||||
*/
|
||||
function Destroy() {
|
||||
@set_magic_quotes_runtime( $this->mgq );
|
||||
ini_set("magic_quotes_runtime", $this->mgq );
|
||||
#set_magic_quotes_runtime( $this->mgq );
|
||||
unset( $this );
|
||||
}
|
||||
}
|
||||
@@ -2401,4 +2404,3 @@ function logMsg( $msg, $title = NULL, $force = FALSE ) {
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
37
include/limesurvey/classes/adodb/composer.json
Normal file
37
include/limesurvey/classes/adodb/composer.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name" : "adodb/adodb-php",
|
||||
"description" : "ADOdb is a PHP database abstraction layer library",
|
||||
"license" : [ "BSD-3-Clause", "LGPL-2.1" ],
|
||||
"authors" : [
|
||||
{
|
||||
"name": "John Lim",
|
||||
"email" : "jlim@natsoft.com",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"name": "Damien Regad",
|
||||
"role": "Current maintainer"
|
||||
},
|
||||
{
|
||||
"name": "Mark Newnham",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
|
||||
"keywords" : [ "database", "abstraction", "layer", "library", "php" ],
|
||||
|
||||
"homepage": "http://adodb.sourceforge.net/",
|
||||
"support" : {
|
||||
"issues" : "https://github.com/ADOdb/ADOdb/issues",
|
||||
"source" : "https://github.com/ADOdb/ADOdb"
|
||||
},
|
||||
|
||||
"require" : {
|
||||
"php" : ">=5.3.2"
|
||||
},
|
||||
|
||||
"autoload" : {
|
||||
"files" : ["adodb.inc.php"]
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
/**
|
||||
* Include the main libraries
|
||||
*/
|
||||
@require_once('xmlrpc.inc') OR die();
|
||||
require_once('xmlrpc.inc');
|
||||
if (!defined('ADODB_DIR')) require_once('adodb.inc.php');
|
||||
|
||||
/**
|
||||
@@ -179,5 +179,3 @@ function xmlrpcval2rs (&$xmlrpcval) {
|
||||
return $rs;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
include/limesurvey/classes/adodb/cute_icons_for_site/adodb.gif
Normal file
BIN
include/limesurvey/classes/adodb/cute_icons_for_site/adodb.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
include/limesurvey/classes/adodb/cute_icons_for_site/adodb2.gif
Normal file
BIN
include/limesurvey/classes/adodb/cute_icons_for_site/adodb2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -77,20 +79,17 @@ class ADODB2_access extends ADODB_DataDict {
|
||||
{
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -58,14 +60,14 @@ class ADODB2_db2 extends ADODB_DataDict {
|
||||
return $suffix;
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
|
||||
return array();
|
||||
@@ -139,6 +141,3 @@ class ADODB2_db2 extends ADODB_DataDict {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -10,9 +12,6 @@
|
||||
|
||||
*/
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
class ADODB2_firebird extends ADODB_DataDict {
|
||||
|
||||
var $databaseType = 'firebird';
|
||||
@@ -150,6 +149,3 @@ class ADODB2_firebird extends ADODB_DataDict {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -49,14 +51,14 @@ class ADODB2_generic extends ADODB_DataDict {
|
||||
}
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
|
||||
return array();
|
||||
@@ -123,4 +125,3 @@ class ADODB2_generic extends ADODB_DataDict {
|
||||
}
|
||||
}
|
||||
*/
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -49,20 +51,17 @@ class ADODB2_ibase extends ADODB_DataDict {
|
||||
}
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -49,14 +51,14 @@ class ADODB2_informix extends ADODB_DataDict {
|
||||
}
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
|
||||
return array();
|
||||
@@ -77,5 +79,3 @@ class ADODB2_informix extends ADODB_DataDict {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -88,7 +90,7 @@ class ADODB2_mssql extends ADODB_DataDict {
|
||||
|
||||
case 'B': return 'IMAGE';
|
||||
|
||||
case 'D': return 'DATE';
|
||||
case 'D': return 'DATETIME';
|
||||
|
||||
case 'TS':
|
||||
case 'T': return 'DATETIME';
|
||||
@@ -124,7 +126,7 @@ class ADODB2_mssql extends ADODB_DataDict {
|
||||
}
|
||||
|
||||
/*
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
$sql = array();
|
||||
@@ -281,4 +283,3 @@ class ADODB2_mssql extends ADODB_DataDict {
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -43,10 +45,9 @@ if (!defined('ADODB_DIR')) die();
|
||||
|
||||
class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
var $databaseType = 'mssqlnative';
|
||||
var $dropIndex = 'DROP INDEX %2$s.%1$s';
|
||||
var $dropIndex = 'DROP INDEX %1$s ON %2$s';
|
||||
var $renameTable = "EXEC sp_rename '%s','%s'";
|
||||
var $renameColumn = "EXEC sp_rename '%s.%s','%s'";
|
||||
|
||||
var $typeX = 'TEXT'; ## Alternatively, set it to VARCHAR(4000)
|
||||
var $typeXL = 'TEXT';
|
||||
|
||||
@@ -60,24 +61,47 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
$len = $fieldobj->max_length;
|
||||
}
|
||||
|
||||
$len = -1; // mysql max_length is not accurate
|
||||
switch (strtoupper($t)) {
|
||||
case 'R':
|
||||
case 'INT':
|
||||
case 'INTEGER': return 'I';
|
||||
case 'BIT':
|
||||
case 'TINYINT': return 'I1';
|
||||
case 'SMALLINT': return 'I2';
|
||||
case 'BIGINT': return 'I8';
|
||||
$_typeConversion = array(
|
||||
-155 => 'D',
|
||||
93 => 'D',
|
||||
-154 => 'D',
|
||||
-2 => 'D',
|
||||
91 => 'D',
|
||||
|
||||
12 => 'C',
|
||||
1 => 'C',
|
||||
-9 => 'C',
|
||||
-8 => 'C',
|
||||
|
||||
-7 => 'L',
|
||||
-6 => 'I2',
|
||||
-5 => 'I8',
|
||||
-11 => 'I',
|
||||
4 => 'I',
|
||||
5 => 'I4',
|
||||
|
||||
-1 => 'X',
|
||||
-10 => 'X',
|
||||
|
||||
2 => 'N',
|
||||
3 => 'N',
|
||||
6 => 'N',
|
||||
7 => 'N',
|
||||
|
||||
-152 => 'X',
|
||||
-151 => 'X',
|
||||
-4 => 'X',
|
||||
-3 => 'X'
|
||||
);
|
||||
|
||||
return $_typeConversion($t);
|
||||
|
||||
case 'REAL':
|
||||
case 'FLOAT': return 'F';
|
||||
default: return parent::MetaType($t,$len,$fieldobj);
|
||||
}
|
||||
}
|
||||
|
||||
function ActualType($meta)
|
||||
{
|
||||
$DATE_TYPE = 'DATETIME';
|
||||
|
||||
switch(strtoupper($meta)) {
|
||||
|
||||
case 'C': return 'VARCHAR';
|
||||
@@ -88,8 +112,8 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
|
||||
case 'B': return 'IMAGE';
|
||||
|
||||
case 'D': return 'DATE';
|
||||
case 'T': return 'DATETIME';
|
||||
case 'D': return $DATE_TYPE;
|
||||
case 'T': return 'TIME';
|
||||
case 'L': return 'BIT';
|
||||
|
||||
case 'R':
|
||||
@@ -102,6 +126,7 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
case 'F': return 'REAL';
|
||||
case 'N': return 'NUMERIC';
|
||||
default:
|
||||
print "RETURN $meta";
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +147,7 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
}
|
||||
|
||||
/*
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
$sql = array();
|
||||
@@ -135,15 +160,26 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Drop a column, syntax is ALTER TABLE table DROP COLUMN column,column
|
||||
*
|
||||
* @param string $tabname Table Name
|
||||
* @param string[] $flds One, or an array of Fields To Drop
|
||||
* @param string $tableflds Throwaway value to make the function match the parent
|
||||
* @param string $tableoptions Throway value to make the function match the parent
|
||||
*
|
||||
* @return string The SQL necessary to drop the column
|
||||
*/
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
if (!is_array($flds))
|
||||
$flds = explode(',',$flds);
|
||||
$f = array();
|
||||
$s = 'ALTER TABLE ' . $tabname;
|
||||
$s = 'ALTER TABLE ' . $tabname . ' DROP COLUMN ';
|
||||
foreach($flds as $v) {
|
||||
$f[] = "\n$this->dropCol ".$this->NameQuote($v);
|
||||
//$f[] = "\n$this->dropCol ".$this->NameQuote($v);
|
||||
$f[] = $this->NameQuote($v);
|
||||
}
|
||||
$s .= implode(', ',$f);
|
||||
$sql[] = $s;
|
||||
@@ -279,4 +315,3 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -179,4 +181,3 @@ class ADODB2_mysql extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -24,7 +26,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
|
||||
var $typeX = 'VARCHAR(4000)';
|
||||
var $typeXL = 'CLOB';
|
||||
|
||||
function MetaType($t,$len=-1)
|
||||
function MetaType($t, $len=-1, $fieldobj=false)
|
||||
{
|
||||
if (is_object($t)) {
|
||||
$fieldobj = $t;
|
||||
@@ -116,6 +118,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
|
||||
|
||||
function AddColumnSQL($tabname, $flds)
|
||||
{
|
||||
$tabname = $this->TableName($tabname);
|
||||
$f = array();
|
||||
list($lines,$pkey) = $this->_GenFields($flds);
|
||||
$s = "ALTER TABLE $tabname ADD (";
|
||||
@@ -128,8 +131,9 @@ class ADODB2_oci8 extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName($tabname);
|
||||
$f = array();
|
||||
list($lines,$pkey) = $this->_GenFields($flds);
|
||||
$s = "ALTER TABLE $tabname MODIFY(";
|
||||
@@ -141,7 +145,7 @@ class ADODB2_oci8 extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if (!is_array($flds)) $flds = explode(',',$flds);
|
||||
foreach ($flds as $k => $v) $flds[$k] = $this->NameQuote($v);
|
||||
@@ -294,4 +298,3 @@ class ADODB2_oci8 extends ADODB_DataDict {
|
||||
return "COMMENT ON COLUMN $table.$col IS $cmt";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -30,8 +32,8 @@ class ADODB2_postgres extends ADODB_DataDict {
|
||||
$t = $fieldobj->type;
|
||||
$len = $fieldobj->max_length;
|
||||
}
|
||||
$is_serial = is_object($fieldobj) && $fieldobj->primary_key && $fieldobj->unique &&
|
||||
$fieldobj->has_default && substr($fieldobj->default_value,0,8) == 'nextval(';
|
||||
$is_serial = is_object($fieldobj) && !empty($fieldobj->primary_key) && !empty($fieldobj->unique) &&
|
||||
!empty($fieldobj->has_default) && substr($fieldobj->default_value,0,8) == 'nextval(';
|
||||
|
||||
switch (strtoupper($t)) {
|
||||
case 'INTERVAL':
|
||||
@@ -130,13 +132,14 @@ class ADODB2_postgres extends ADODB_DataDict {
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
$sql = array();
|
||||
$not_null = false;
|
||||
list($lines,$pkey) = $this->_GenFields($flds);
|
||||
$alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' ';
|
||||
foreach($lines as $v) {
|
||||
if (($not_null = preg_match('/NOT NULL/i',$v))) {
|
||||
$v = preg_replace('/NOT NULL/i','',$v);
|
||||
}
|
||||
if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
|
||||
if (preg_match('/^([^ ]+) .*DEFAULT (\'[^\']+\'|\"[^\"]+\"|[^ ]+)/',$v,$matches)) {
|
||||
list(,$colname,$default) = $matches;
|
||||
$sql[] = $alter . str_replace('DEFAULT '.$default,'',$v);
|
||||
$sql[] = 'UPDATE '.$tabname.' SET '.$colname.'='.$default;
|
||||
@@ -188,8 +191,9 @@ class ADODB2_postgres extends ADODB_DataDict {
|
||||
$tabname = $this->TableName($tabname);
|
||||
$sql = array();
|
||||
list($lines,$pkey) = $this->_GenFields($flds);
|
||||
$alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' ';
|
||||
$set_null = false;
|
||||
foreach($lines as $v) {
|
||||
$alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' ';
|
||||
if ($not_null = preg_match('/NOT NULL/i',$v)) {
|
||||
$v = preg_replace('/NOT NULL/i','',$v);
|
||||
}
|
||||
@@ -197,30 +201,63 @@ class ADODB2_postgres extends ADODB_DataDict {
|
||||
// explicitly ask a column to be null using $flds
|
||||
else if ($set_null = preg_match('/NULL/i',$v)) {
|
||||
// if they didn't specify not null, see if they explicitely asked for null
|
||||
$v = preg_replace('/\sNULL/i','',$v);
|
||||
// Lookbehind pattern covers the case 'fieldname NULL datatype DEFAULT NULL'
|
||||
// only the first NULL should be removed, not the one specifying
|
||||
// the default value
|
||||
$v = preg_replace('/(?<!DEFAULT)\sNULL/i','',$v);
|
||||
}
|
||||
|
||||
if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
|
||||
if (preg_match('/^([^ ]+) .*DEFAULT (\'[^\']+\'|\"[^\"]+\"|[^ ]+)/',$v,$matches)) {
|
||||
$existing = $this->MetaColumns($tabname);
|
||||
list(,$colname,$default) = $matches;
|
||||
$alter .= $colname;
|
||||
if ($this->connection) {
|
||||
$old_coltype = $this->connection->MetaType($existing[strtoupper($colname)]);
|
||||
}
|
||||
else {
|
||||
$old_coltype = $t;
|
||||
}
|
||||
$v = preg_replace('/^' . preg_quote($colname) . '\s/', '', $v);
|
||||
$sql[] = $alter . $colname . ' TYPE ' . str_replace('DEFAULT '.$default,'',$v);
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET DEFAULT ' . $default;
|
||||
$t = trim(str_replace('DEFAULT '.$default,'',$v));
|
||||
|
||||
// Type change from bool to int
|
||||
if ( $old_coltype == 'L' && $t == 'INTEGER' ) {
|
||||
$sql[] = $alter . ' DROP DEFAULT';
|
||||
$sql[] = $alter . " TYPE $t USING ($colname::BOOL)::INT";
|
||||
$sql[] = $alter . " SET DEFAULT $default";
|
||||
}
|
||||
// Type change from int to bool
|
||||
else if ( $old_coltype == 'I' && $t == 'BOOLEAN' ) {
|
||||
if( strcasecmp('NULL', trim($default)) != 0 ) {
|
||||
$default = $this->connection->qstr($default);
|
||||
}
|
||||
$sql[] = $alter . ' DROP DEFAULT';
|
||||
$sql[] = $alter . " TYPE $t USING CASE WHEN $colname = 0 THEN false ELSE true END";
|
||||
$sql[] = $alter . " SET DEFAULT $default";
|
||||
}
|
||||
// Any other column types conversion
|
||||
else {
|
||||
$sql[] = $alter . " TYPE $t";
|
||||
$sql[] = $alter . " SET DEFAULT $default";
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
// drop default?
|
||||
preg_match ('/^\s*(\S+)\s+(.*)$/',$v,$matches);
|
||||
list (,$colname,$rest) = $matches;
|
||||
$sql[] = $alter . $colname . ' TYPE ' . $rest;
|
||||
$alter .= $colname;
|
||||
$sql[] = $alter . ' TYPE ' . $rest;
|
||||
}
|
||||
|
||||
list($colname) = explode(' ',$v);
|
||||
# list($colname) = explode(' ',$v);
|
||||
if ($not_null) {
|
||||
// this does not error out if the column is already not null
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET NOT NULL';
|
||||
$sql[] = $alter . ' SET NOT NULL';
|
||||
}
|
||||
if ($set_null) {
|
||||
// this does not error out if the column is already null
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' DROP NOT NULL';
|
||||
$sql[] = $alter . ' DROP NOT NULL';
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
@@ -445,4 +482,3 @@ class ADODB2_postgres extends ADODB_DataDict {
|
||||
return $ftype;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.50 6 July 2004 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -100,7 +102,7 @@ class ADODB2_sapdb extends ADODB_DataDict {
|
||||
return array( 'ALTER TABLE ' . $tabname . ' ADD (' . implode(', ',$lines) . ')' );
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
$sql = array();
|
||||
@@ -108,7 +110,7 @@ class ADODB2_sapdb extends ADODB_DataDict {
|
||||
return array( 'ALTER TABLE ' . $tabname . ' MODIFY (' . implode(', ',$lines) . ')' );
|
||||
}
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
if (!is_array($flds)) $flds = explode(',',$flds);
|
||||
@@ -118,5 +120,3 @@ class ADODB2_sapdb extends ADODB_DataDict {
|
||||
return array( 'ALTER TABLE ' . $tabname . ' DROP (' . implode(', ',$flds) . ')' );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
SQLite datadict Andrei Besleaga
|
||||
|
||||
*/
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
class ADODB2_sqlite extends ADODB_DataDict {
|
||||
var $databaseType = 'sqlite';
|
||||
var $seqField = false;
|
||||
var $addCol=' ADD COLUMN';
|
||||
var $dropTable = 'DROP TABLE IF EXISTS %s';
|
||||
var $dropIndex = 'DROP INDEX IF EXISTS %s';
|
||||
var $renameTable = 'ALTER TABLE %s RENAME TO %s';
|
||||
|
||||
|
||||
|
||||
function ActualType($meta)
|
||||
{
|
||||
switch(strtoupper($meta)) {
|
||||
case 'C': return 'VARCHAR'; // TEXT , TEXT affinity
|
||||
case 'XL':return 'LONGTEXT'; // TEXT , TEXT affinity
|
||||
case 'X': return 'TEXT'; // TEXT , TEXT affinity
|
||||
|
||||
case 'C2': return 'VARCHAR'; // TEXT , TEXT affinity
|
||||
case 'X2': return 'LONGTEXT'; // TEXT , TEXT affinity
|
||||
|
||||
case 'B': return 'LONGBLOB'; // TEXT , NONE affinity , BLOB
|
||||
|
||||
case 'D': return 'DATE'; // NUMERIC , NUMERIC affinity
|
||||
case 'T': return 'DATETIME'; // NUMERIC , NUMERIC affinity
|
||||
case 'L': return 'TINYINT'; // NUMERIC , INTEGER affinity
|
||||
|
||||
case 'R':
|
||||
case 'I4':
|
||||
case 'I': return 'INTEGER'; // NUMERIC , INTEGER affinity
|
||||
case 'I1': return 'TINYINT'; // NUMERIC , INTEGER affinity
|
||||
case 'I2': return 'SMALLINT'; // NUMERIC , INTEGER affinity
|
||||
case 'I8': return 'BIGINT'; // NUMERIC , INTEGER affinity
|
||||
|
||||
case 'F': return 'DOUBLE'; // NUMERIC , REAL affinity
|
||||
case 'N': return 'NUMERIC'; // NUMERIC , NUMERIC affinity
|
||||
default:
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
|
||||
// return string must begin with space
|
||||
function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
|
||||
{
|
||||
$suffix = '';
|
||||
if ($funsigned) $suffix .= ' UNSIGNED';
|
||||
if ($fnotnull) $suffix .= ' NOT NULL';
|
||||
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
|
||||
if ($fautoinc) $suffix .= ' AUTOINCREMENT';
|
||||
if ($fconstraint) $suffix .= ' '.$fconstraint;
|
||||
return $suffix;
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported natively by SQLite");
|
||||
return array();
|
||||
}
|
||||
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported natively by SQLite");
|
||||
return array();
|
||||
}
|
||||
|
||||
function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')
|
||||
{
|
||||
if ($this->debug) ADOConnection::outp("RenameColumnSQL not supported natively by SQLite");
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -87,7 +89,7 @@ class ADODB2_sybase extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds)
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
$sql = array();
|
||||
@@ -99,7 +101,7 @@ class ADODB2_sybase extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function DropColumnSQL($tabname, $flds)
|
||||
function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName($tabname);
|
||||
if (!is_array($flds)) $flds = explode(',',$flds);
|
||||
@@ -226,4 +228,3 @@ class ADODB2_sybase extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
?>
|
||||
17
include/limesurvey/classes/adodb/docs/README.md
Normal file
17
include/limesurvey/classes/adodb/docs/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# ADOdb Documentation
|
||||
|
||||
ADOdb documentation is available in the following locations
|
||||
|
||||
- [Online](http://adodb.org/)
|
||||
- [Download](https://sourceforge.net/projects/adodb/files/Documentation/) for offline use
|
||||
|
||||
## Legacy documentation
|
||||
|
||||
The old HTML files are available in
|
||||
[GitHub](https://github.com/ADOdb/ADOdb/tree/8b8133771ecbe9c95e57abbe5dc3757f0226bfcd/docs),
|
||||
or in the release zip/tarballs for version 5.20 and before on
|
||||
[Sourceforge](https://sourceforge.net/projects/adodb/files/adodb-php5-only/).
|
||||
|
||||
## Changelog
|
||||
|
||||
The full historical [Changelog](changelog.md) is available on GitHub.
|
||||
BIN
include/limesurvey/classes/adodb/docs/adodb.gif
Normal file
BIN
include/limesurvey/classes/adodb/docs/adodb.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
include/limesurvey/classes/adodb/docs/adodb2.gif
Normal file
BIN
include/limesurvey/classes/adodb/docs/adodb2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
453
include/limesurvey/classes/adodb/docs/changelog.md
Normal file
453
include/limesurvey/classes/adodb/docs/changelog.md
Normal file
@@ -0,0 +1,453 @@
|
||||
# ADOdb Changelog - v5.x
|
||||
|
||||
Older changelogs:
|
||||
[v4.x](changelog_v4.x.md),
|
||||
[v3.x](changelog_v3.x.md),
|
||||
[v2.x](changelog_v2.x.md).
|
||||
|
||||
|
||||
## 5.20.4 - 30-Mar-2016
|
||||
|
||||
- adodb: Fix BulkBind() param count validation. #199
|
||||
- mysqli: fix PHP warning in recordset destructor. #217
|
||||
- mysqli: cast port number to int when connecting (PHP7 compatibility). #218
|
||||
|
||||
## 5.20.3 - 01-Jan-2016
|
||||
|
||||
- mssql: PHP warning when closing recordset from destructor not fixed in v5.20.2. #180
|
||||
|
||||
## 5.20.2 - 27-Dec-2015
|
||||
|
||||
- adodb: Remove a couple leftover PHP 4.x constructors (PHP7 compatibility). #139
|
||||
- mysql: MoveNext() now respects ADODB_ASSOC_CASE. #167
|
||||
- mssql, mysql, informix: Avoid PHP warning when closing recordset from destructor. #170
|
||||
|
||||
## 5.20.1 - 06-Dec-2015
|
||||
|
||||
- adodb: Fix regression introduced in 5.20.0, causing a PHP Warning when
|
||||
calling GetAssoc() on an empty recordset. See Github #162
|
||||
- ADOConnection::Version() now handles SemVer. See Github #164
|
||||
|
||||
## 5.20.0 - 28-Nov-2015
|
||||
|
||||
- adodb: Fix regression introduced in v5.19, causing queries to return empty rows. See Github #20, #93, #95
|
||||
- adodb: Fix regression introduced in v5.19 in GetAssoc() with ADODB_FETCH_ASSOC mode and '0' as data. See Github #102
|
||||
- adodb: AutoExecute correctly handles empty result set in case of updates. See Github #13
|
||||
- adodb: Fix regex in Version(). See Github #16
|
||||
- adodb: Align method signatures to definition in parent class ADODB_DataDict. See Github #31
|
||||
- adodb: Improve compatibility of ADORecordSet_empty, thanks to Sjan Evardsson. See Github #43
|
||||
- adodb: fix ADODB_Session::open() failing after successful ADONewConnection() call, thanks to Sjan Evardsson. See Github #44
|
||||
- adodb: Only include memcache library once for PHPUnit 4.x, thanks to Alan Farquharson. See Github #74
|
||||
- adodb: Move() returns false when given row is < 0, thanks to Mike Benoit.
|
||||
- adodb: Add support for pagination with complex queries, thanks to Mike Benoit. See Github #88
|
||||
- adodb: Parse port out of hostname if specified in connection parameters, thanks to Andy Theuninck. See Github #63
|
||||
- adodb: Fix inability to set values from 0 to null (and vice versa) with Active Record, thanks to Louis Johnson. See Github #71
|
||||
- adodb: Fix PHP strict warning in ADODB_Active_Record::Reload(), thanks to Boštjan Žokš. See Github #75
|
||||
- adodb: Add mssql's DATETIME2 type to ADOConnection::MetaType(), thanks to MarcelTO. See Github #80
|
||||
- adodb: When flushing cache, initialize it if it is not set, thanks to Paul Haggart. See Github #57
|
||||
- adodb: Define DB_AUTOQUERY_* constants in main include file. See Github #49
|
||||
- adodb: Improve documentation of fetch mode and assoc case
|
||||
- adodb: Improve logic to build the assoc case bind array
|
||||
- adodb: Strict-standards compliance for function names. See Github #18, #142
|
||||
- adodb: Remove old PHP 4.x constructors for compatibility with PHP 7. See Github #139
|
||||
- adodb: Initialize charset in ADOConnection::SetCharSet. See Github #39
|
||||
- adodb: Fix incorrect handling of input array in Execute(). See Github #146
|
||||
- adodb: Release Recordset when raising exception. See Github #143
|
||||
- adodb: Added new setConnectionParameter() method, currently implemented in mssqlnative driver only. See Github #158.
|
||||
- adodb-lib: Optimize query pagination, thanks to Mike Benoit. See Github #110
|
||||
- memcache: use include_once() to avoid issues with PHPUnit. See http://phplens.com/lens/lensforum/msgs.php?id=19489
|
||||
- mssql_n: Allow use of prepared statements with driver. See Github #22
|
||||
- mssqlnative: Use ADOConnection::outp instead of error_log. See Github #12
|
||||
- mssqlnative: fix failure on Insert_ID() if the insert statement contains a semicolon in a value string, thanks to sketule. See Github #96
|
||||
- mssqlnative: Fix "invalid parameter was passed to sqlsrv_configure" error, thanks to Ray Morris. See Github #103
|
||||
- mssqlnative: Fix insert_ID() failing if server returns more than 1 row, thanks to gitjti. See Github #41
|
||||
- mysql: prevent race conditions when creating/dropping sequences, thanks to MikeB. See Github #28
|
||||
- mysql: Fix adodb_strip_order_by() bug causing SQL error for subqueries with order/limit clause, thanks to MikeB.
|
||||
- mysql: workaround for HHVM behavior, thanks to Mike Benoit.
|
||||
- mysqli: Fix qstr() when called without an active connection. See Github #11
|
||||
- oci8: Fix broken quoting of table name in AddColumnSQL and AlterColumnSQL, thanks to Andreas Fernandez. see Github #67
|
||||
- oci8: Allow oci8 driver to use lowercase field names in assoc mode. See Github #21
|
||||
- oci8po: Prevent replacement of '?' within strings, thanks to Mark Newnham. See Github #132
|
||||
- pdo: Added missing property (fixes PHP notices). see Github #56
|
||||
- pdo: Align method signatures with parent class, thanks to Andy Theuninck. see Github #62
|
||||
- pdo: new sqlsrv driver, thanks to MarcelTO. See Github #81
|
||||
- pdo/mysql: New methods to make the driver behave more like mysql/mysqli, thanks to Andy Theuninck. see Github #40
|
||||
- postgres: Stop using legacy function aliases
|
||||
- postgres: Fix AlterColumnSQL when updating multiple columns, thanks to Jouni Ahto. See Github #72
|
||||
- postgres: Fix support for HHVM 3.6, thanks to Mike Benoit. See Github #87
|
||||
- postgres: Noblob optimization, thanks to Mike Benoit. See Github #112
|
||||
- postgres7: fix system warning in MetaColumns() with schema. See http://phplens.com/lens/lensforum/msgs.php?id=19481
|
||||
- sqlite3: ServerInfo() now returns driver's version
|
||||
- sqlite3: Fix wrong connection parameter in _connect(), thanks to diogotoscano. See Github #51
|
||||
- sqlite3: Fix FetchField, thanks to diogotoscano. See Github #53
|
||||
- sqlite3: Fix result-less SQL statements executed twice. See Github #99
|
||||
- sqlite3: use -1 for _numOfRows. See Github #151
|
||||
- xmlschema: Fix ExtractSchema() when given $prefix and $stripprefix parameters, thanks to peterdd. See Github #92
|
||||
- Convert languages files to UTF-8, thanks to Marc-Etienne Vargenau. See Github #32.
|
||||
|
||||
## 5.19 - 23-Apr-2014
|
||||
|
||||
**NOTE:**
|
||||
This release suffers from a [known issue with Associative Fetch Mode](https://github.com/ADOdb/ADOdb/issues/20)
|
||||
(i.e. when $ADODB_FETCH_MODE is set to ADODB_FETCH_ASSOC).
|
||||
It causes recordsets to return empty strings (no data) when using some database drivers.
|
||||
The problem has been reported on MSSQL, Interbase and Foxpro, but possibly affects
|
||||
other database types as well; all drivers derived from the above are also impacted.
|
||||
|
||||
- adodb: GetRowAssoc will return null as required. See http://phplens.com/lens/lensforum/msgs.php?id=19289
|
||||
- adodb: Fix GetRowAssoc bug introduced in 5.17, causing function to return data from previous fetch for NULL fields. See http://phplens.com/lens/lensforum/msgs.php?id=17539
|
||||
- adodb: GetAssoc will return a zero-based array when 2nd column is null. See https://sourceforge.net/p/adodb/bugs/130/
|
||||
- adodb: Execute no longer ignores single parameters evaluating to false. See https://sourceforge.net/p/adodb/patches/32/
|
||||
- adodb: Fix LIMIT 1 clause in subquery gets stripped off. See http://phplens.com/lens/lensforum/msgs.php?id=17813
|
||||
- adodb-lib: Fix columns quoting bug. See https://sourceforge.net/p/adodb/bugs/127/
|
||||
- Added new ADODB_ASSOC_CASE_* constants. Thx to Damien Regad.
|
||||
- sessions: changed lob handling to detect all variations of oci8 driver.
|
||||
- ads: clear fields before fetching. See http://phplens.com/lens/lensforum/msgs.php?id=17539
|
||||
- mssqlnative: fixed many FetchField compat issues. See http://phplens.com/lens/lensforum/msgs.php?id=18464. Also date format changed to remove timezone.
|
||||
- mssqlnative: Numerous fixes and improvements by Mark Newnham
|
||||
- Driver supports SQL Server 2005, 2008 and 2012
|
||||
- Bigint data types mapped to I8 instead of I
|
||||
- Reintroduced MetaColumns function
|
||||
- On SQL Server 2012, makes use of new CREATE SEQUENCE statement
|
||||
- FetchField caches metadata at initialization to improve performance
|
||||
- etc.
|
||||
- mssqlnative: Fix Insert ID on prepared statement, thanks to Mike Parks. See http://phplens.com/lens/lensforum/msgs.php?id=19079
|
||||
- mssql: timestamp format changed to `Y-m-d\TH:i:s` (ISO 8601) to make them independent from DATEFORMAT setting, as recommended on
|
||||
[Microsoft TechNet](http://technet.microsoft.com/en-us/library/ms180878%28v=sql.105%29.aspx#StringLiteralDateandTimeFormats).
|
||||
- mysql/mysqli: Fix ability for MetaTables to filter by table name, broken since 5.15. See http://phplens.com/lens/lensforum/msgs.php?id=19359
|
||||
- odbc: Fixed MetaTables and MetaPrimaryKeys definitions in odbc driver to match adoconnection class.
|
||||
- odbc: clear fields before fetching. See http://phplens.com/lens/lensforum/msgs.php?id=17539
|
||||
- oci8: GetRowAssoc now works in ADODB_FETCH_ASSOC fetch mode
|
||||
- oci8: MetaType and MetaForeignKeys argument count are now strict-standards compliant
|
||||
- oci8: Added trailing `;` on trigger creation for sequence fields, prevents occurence of ORA-24344
|
||||
- oci8quercus: new oci8 driver with support for quercus jdbc data types.
|
||||
- pdo: Fixed concat recursion bug in 5.3. See http://phplens.com/lens/lensforum/msgs.php?id=19285
|
||||
- pgsql: Default driver (postgres/pgsql) is now postgres8
|
||||
- pgsql: Fix output of BLOB (bytea) columns with PostgreSQL >= 9.0
|
||||
- pgsql: Fix handling of DEFAULT NULL columns in AlterColumnSQL
|
||||
- pgsql: Fix mapping of error message to ADOdb error codes
|
||||
- pgsql: Reset parameter number in Param() method when $name == false
|
||||
- postgres8: New class/type with correct behavior for _insertid(). See Github #8
|
||||
- postgres9: Fixed assoc problem. See http://phplens.com/lens/lensforum/msgs.php?id=19296
|
||||
- sybase: Removed redundant sybase_connect() call in _connect(). See Github #3
|
||||
- sybase: Allow connection on custom port. See Github #9
|
||||
- sybase: Fix null values returned with ASSOC fetch mode. See Github #10
|
||||
- Added Composer support. See Github #7
|
||||
|
||||
## 5.18 - 3 Sep 2012
|
||||
|
||||
- datadict-postgres: Fixes bug in ALTER COL. See http://phplens.com/lens/lensforum/msgs.php?id=19202.
|
||||
- datadict-postgres: fixed bugs in MetaType() checking $fieldobj properties.
|
||||
- GetRowAssoc did not work with null values. Bug in 5.17.
|
||||
- postgres9: New driver to better support PostgreSQL 9. Thx Glenn Herteg and Cacti team.
|
||||
- sqlite3: Modified to support php 5.4. Thx Günter Weber [built.development#googlemail.com]
|
||||
- adodb: When fetch mode is ADODB_FETCH_ASSOC, and we execute `$db->GetAssoc("select 'a','0'");` we get an error. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=19190
|
||||
- adodb: Caching directory permissions now configurable using global variable $ADODB_CACHE_PERMS. Default value is 0771.
|
||||
- mysqli: SetCharSet() did not return true (success) or false (fail) correctly. Fixed.
|
||||
- mysqli: changed dataProvider to 'mysql' so that MetaError and other shared functions will work.
|
||||
- mssqlnative: Prepare() did not work previously. Now calling Prepare() will work but the sql is not actually compiled. Unfortunately bind params are passed to sqlsrv_prepare and not to sqlsrv_execute. make Prepare() and empty function, and we still execute the unprepared stmt.
|
||||
- mysql: FetchField(-1), turns it is is not possible to retrieve the max_length. Set to -1.
|
||||
- mysql-perf: Fixed "SHOW INNODB STATUS". Change to "SHOW ENGINE INNODB STATUS"
|
||||
|
||||
## 5.17 - 18 May 2012
|
||||
|
||||
- Active Record: Removed trailing whitespace from adodb-active-record.inc.php.
|
||||
- odbc: Added support for $database parameter in odbc Connect() function. E.g. $DB->Connect($dsn_without_db, $user, $pwd, $database).
|
||||
Previously $database had to be left blank and the $dsn was used to pass in this parameter.
|
||||
- oci8: Added better empty($rs) error handling to metaindexes().
|
||||
- oci8: Changed to use newer oci API to support PHP 5.4.
|
||||
- adodb.inc.php: Changed GetRowAssoc to more generic code that will work in all scenarios.
|
||||
|
||||
## 5.16 - 26 March 2012
|
||||
|
||||
- mysqli: extra mysqli_next_result() in close() removed. See http://phplens.com/lens/lensforum/msgs.php?id=19100
|
||||
- datadict-oci8: minor typo in create sequence trigger fixed. See http://phplens.com/lens/lensforum/msgs.php?id=18879.
|
||||
- security: safe date parsing changes. Does not impact security, these are code optimisations. Thx Saithis.
|
||||
- postgres, oci8, oci8po, db2oci: Param() function parameters inconsistent with base class. $type='C' missing. Fixed.
|
||||
- active-record: locked bug fixed. http://phplens.com/lens/lensforum/msgs.php?phplens_forummsg=new&id=19073
|
||||
- mysql, mysqli and informix: added MetaProcedures. Metaprocedures allows to retrieve an array list of all procedures in database. http://phplens.com/lens/lensforum/msgs.php?id=18414
|
||||
- Postgres7: added support for serial data type in MetaColumns().
|
||||
|
||||
## 5.15 - 19 Jan 2012
|
||||
|
||||
- pdo: fix ErrorMsg() to detect errors correctly. Thx Jens.
|
||||
- mssqlnative: added another check for $this->fields array exists.
|
||||
- mssqlnative: bugs in FetchField() fixed. See http://phplens.com/lens/lensforum/msgs.php?id=19024
|
||||
- DBDate and DBTimeStamp had sql injection bug. Fixed. Thx Saithis
|
||||
- mysql and mysqli: MetaTables() now identifies views and tables correctly.
|
||||
- Added function adodb_time() to adodb-time.inc.php. Generates current time in unsigned integer format.
|
||||
|
||||
## 5.14 - 8 Sep 2011
|
||||
|
||||
- mysqli: fix php compilation bug.
|
||||
- postgres: bind variables did not work properly. Fixed.
|
||||
- postgres: blob handling bug in _decode. Fixed.
|
||||
- ActiveRecord: if a null field was never updated, activerecord would still update the record. Fixed.
|
||||
- ActiveRecord: 1 char length string never quoted. Fixed.
|
||||
- LDAP: Connection string ldap:// and ldaps:// did not work. Fixed.
|
||||
|
||||
## 5.13 - 15 Aug 2011
|
||||
|
||||
- Postgres: Fix in 5.12 was wrong. Uses pg_unescape_bytea() correctly now in _decode.
|
||||
- GetInsertSQL/GetUpdateSQL: Now $ADODB_QUOTE_FIELDNAMES allows you to define 'NATIVE', 'UPPER', 'LOWER'. If set to true, will default to 'UPPER'.
|
||||
- mysqli: added support for persistent connections 'p:'.
|
||||
- mssqlnative: ADODB_FETCH_BOTH did not work properly. Fixed.
|
||||
- mssqlnative: return values for stored procedures where not returned! Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=18919
|
||||
- mssqlnative: timestamp and fetchfield bugs fixed. http ://phplens.com/lens/lensforum/msgs.php?id=18453
|
||||
|
||||
## 5.12 - 30 June 2011
|
||||
|
||||
- Postgres: Added information_schema support for postgresql.
|
||||
- Postgres: Use pg_unescape_bytea() in _decode.
|
||||
- Fix bulk binding with oci8. http://phplens.com/lens/lensforum/msgs.php?id=18786
|
||||
- oci8 perf: added wait evt monitoring. Also db cache advice now handles multiple buffer pools properly.
|
||||
- sessions2: Fixed setFetchMode problem.
|
||||
- sqlite: Some DSN connection settings were not parsed correctly.
|
||||
- mysqli: now GetOne obeys $ADODB_GETONE_EOF;
|
||||
- memcache: compress option did not work. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=18899
|
||||
|
||||
## 5.11 - 5 May 2010
|
||||
|
||||
- mysql: Fixed GetOne() to return null if no records returned.
|
||||
- oci8 perf: added stats on sga, rman, memory usage, and flash in performance tab.
|
||||
- odbtp: Now you can define password in $password field of Connect()/PConnect(), and it will add it to DSN.
|
||||
- Datadict: altering columns did not consider the scale of the column. Now it does.
|
||||
- mssql: Fixed problem with ADODB_CASE_ASSOC causing multiple versions of column name appearing in recordset fields.
|
||||
- oci8: Added missing & to refLob.
|
||||
- oci8: Added obj->scale to FetchField().
|
||||
- oci8: Now you can get column info of a table in a different schema, e.g. MetaColumns("schema.table") is supported.
|
||||
- odbc_mssql: Fixed missing $metaDatabasesSQL.
|
||||
- xmlschema: Changed declaration of create() to create($xmls) to fix compat problems. Also changed constructor adoSchema() to pass in variable instead of variable reference.
|
||||
- ado5: Fixed ado5 exceptions to only display errors when $this->debug=true;
|
||||
- Added DSN support to sessions2.inc.php.
|
||||
- adodb-lib.inc.php. Fixed issue with _adodb_getcount() not using $secs2cache parameter.
|
||||
- adodb active record. Fixed caching bug. See http://phplens.com/lens/lensforum/msgs.php?id=18288.
|
||||
- db2: fixed ServerInfo().
|
||||
- adodb_date: Added support for format 'e' for TZ as in adodb_date('e')
|
||||
- Active Record: If you have a field which is a string field (with numbers in) and you add preceding 0's to it the adodb library does not pick up the fact that the field has changed because of the way php's == works (dodgily). The end result is that it never gets updated into the database - fix by Matthew Forrester (MediaEquals). [matthew.forrester#mediaequals.com]
|
||||
- Fixes RowLock() and MetaIndexes() inconsistencies. See http://phplens.com/lens/lensforum/msgs.php?id=18236
|
||||
- Active record support for postgrseql boolean. See http://phplens.com/lens/lensforum/msgs.php?id=18246
|
||||
- By default, Execute 2D array is disabled for security reasons. Set $conn->bulkBind = true to enable. See http://phplens.com/lens/lensforum/msgs.php?id=18270. Note this breaks backward compat.
|
||||
- MSSQL: fixes for 5.2 compat. http://phplens.com/lens/lensforum/msgs.php?id=18325
|
||||
- Changed Version() to return a string instead of a float so it correctly returns 5.10 instead of 5.1.
|
||||
|
||||
## 5.10 - 10 Nov 2009
|
||||
|
||||
- Fixed memcache to properly support $rs->timeCreated.
|
||||
- adodb-ado.inc.php: Added BigInt support for PHP5. Will return float instead to support large numbers. Thx nasb#mail.goo.ne.jp.
|
||||
- adodb-mysqli.inc.php: mysqli_multi_query is now turned off by default. To turn it on, use $conn->multiQuery = true; This is because of the risks of sql injection. See http://phplens.com/lens/lensforum/msgs.php?id=18144
|
||||
- New db2oci driver for db2 9.7 when using PL/SQL mode. Allows oracle style :0, :1, :2 bind parameters which are remapped to ? ? ?.
|
||||
- adodb-db2.inc.php: fixed bugs in MetaTables. SYS owner field not checked properly. Also in $conn->Connect($dsn, null, null, $schema) and PConnect($dsn, null, null, $schema), we do a SET SCHEMA=$schema if successful connection.
|
||||
- adodb-mysqli.inc.php: Now $rs->Close() closes all pending next resultsets. Thx Clifton mesmackgod#gmail.com
|
||||
- Moved _CreateCache() from PConnect()/Connect() to CacheExecute(). Suggested by Dumka.
|
||||
- Many bug fixes to adodb-pdo_sqlite.inc.php and new datadict-sqlite.inc.php. Thx Andrei B. [andreutz#mymail.ro]
|
||||
- Removed usage of split (deprecated in php 5.3). Thx david#horizon-nigh.org.
|
||||
- Fixed RowLock() parameters to comply with PHP5 strict mode in multiple drivers.
|
||||
|
||||
## 5.09 - 25 June 2009
|
||||
|
||||
- Active Record: You can force column names to be quoted in INSERT and UPDATE statements, typically because you are using reserved words as column names by setting ADODB_Active_Record::$_quoteNames = true;
|
||||
- Added memcache and cachesecs to DSN. e.g.
|
||||
|
||||
``` php
|
||||
# we have a memcache servers mem1,mem2 on port 8888, compression=off and cachesecs=120
|
||||
$dsn = 'mysql://user:pwd@localhost/mydb?memcache=mem1,mem2:8888:0&cachesecs=120';
|
||||
```
|
||||
|
||||
- Fixed up MetaColumns and MetaPrimaryIndexes() for php 5.3 compat. Thx http://adodb.pastebin.com/m52082b16
|
||||
- The postgresql driver's OffsetDate() apparently does not work with postgres 8.3. Fixed.
|
||||
- Added support for magic_quotes_sybase in qstr() and addq(). Thanks Eloy and Sam Moffat.
|
||||
- The oci8 driver did not handle LOBs properly when binding. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=17991.
|
||||
- Datadict: In order to support TIMESTAMP with subsecond accuracy, added to datadict the new TS type. Supported by mssql, postgresql and oci8 (oracle). Also changed oci8 $conn->sysTimeStamp to use 'SYSTIMESTAMP' instead of 'SYSDATE'. Should be backwards compat.
|
||||
- Added support for PHP 5.1+ DateTime objects in DBDate and DBTimeStamp. This means that dates and timestamps will be managed by DateTime objects if you are running PHP 5.1+.
|
||||
- Added new property to postgres64 driver to support returning I if type is unique int called $db->uniqueIisR, defaulting to true. See http://phplens.com/lens/lensforum/msgs.php?id=17963
|
||||
- Added support for bindarray in adodb_GetActiveRecordsClass with SelectLimit in adodb-active-record.inc.php.
|
||||
- Transactions now allowed in ado_access driver. Thx to petar.petrov.georgiev#gmail.com.
|
||||
- Sessions2 garbage collection is now much more robust. We perform ORDER BY to prevent deadlock in adodb-sessions2.inc.php.
|
||||
- Fixed typo in pdo_sqlite driver.
|
||||
|
||||
## 5.08a - 17 Apr 2009
|
||||
|
||||
- Fixes wrong version number string.
|
||||
- Incorrect + in adodb-datadict.inc.php removed.
|
||||
- Fixes missing OffsetDate() function in pdo. Thx paul#mantisforge.org.
|
||||
|
||||
## 5.08 - 17 Apr 2009
|
||||
|
||||
- adodb-sybase.inc.php driver. Added $conn->charSet support. Thx Luis Henrique Mulinari (luis.mulinari#gmail.com)
|
||||
- adodb-ado5.inc.php. Fixed some bind param issues. Thx Jirka Novak.
|
||||
- adodb-ado5.inc.php. Now has improved error handling.
|
||||
- Fixed typo in adodb-xmlschema03.inc.php. See XMLS_EXISTING_DATA, line 1501. Thx james johnson.
|
||||
- Made $inputarr optional for _query() in all drivers.
|
||||
- Fixed spelling mistake in flushall() in adodb.inc.ophp.
|
||||
- Fixed handling of quotes in adodb_active_record::doquote. Thx Jonathan Hohle (jhohle#godaddy.com).
|
||||
- Added new index parameter to adodb_active_record::setdatabaseadaptor. Thx Jonathan Hohle
|
||||
- Fixed & readcache() reference compat problem with php 5.3 in adodb.Thx Jonathan Hohle.
|
||||
- Some minor $ADODB_CACHE_CLASS definition issues in adodb.inc.php.
|
||||
- Added Reset() function to adodb_active_record. Thx marcus.
|
||||
- Minor dsn fix for pdo_sqlite in adodb.inc.php. Thx Sergey Chvalyuk.
|
||||
- Fixed adodb-datadict _CreateSuffix() inconsistencies. Thx Chris Miller.
|
||||
- Option to delete old fields $dropOldFlds in datadict ChangeTableSQL($table, $flds, $tableOptions, $dropOldFlds=false) added. Thx Philipp Niethammer.
|
||||
- Memcache caching did not expire properly. Fixed.
|
||||
- MetaForeignKeys for postgres7 driver changed from adodb_movenext to $rs->MoveNext (also in 4.99)
|
||||
- Added support for ldap and ldaps url format in ldap driver. E.g. ldap://host:port/dn?attributes?scope?filter?extensions
|
||||
|
||||
## 5.07 - 26 Dec 2008
|
||||
|
||||
- BeginTrans/CommitTrans/RollbackTrans return true/false correctly on success/failure now for mssql, odbc, oci8, mysqlt, mysqli, postgres, pdo.
|
||||
- Replace() now quotes all non-null values including numeric ones.
|
||||
- Postgresql qstr() now returns booleans as *true* and *false* without quotes.
|
||||
- MetaForeignKeys in mysql and mysqli drivers had this problem: A table can have two foreign keys pointing to the same column in the same table. The original code will incorrectly report only the last column. Fixed. https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
|
||||
- Passing in full ado connection string in $argHostname with ado drivers was failing in adodb5 due to bug. Fixed.
|
||||
- Fixed memcachelib flushcache and flushall bugs. Also fixed possible timeCreated = 0 problem in readcache. (Also in adodb 4.992). Thanks AlexB_UK (alexbarnes#hotmail.com).
|
||||
- Fixed a notice in adodb-sessions2.inc.php, in _conn(). Thx bober m.derlukiewicz#rocktech.remove_me.pl;
|
||||
- ADOdb Active Record: Fixed some issues with incompatible fetch modes (ADODB_FETCH_ASSOC) causing problems in UpdateActiveTable().
|
||||
- ADOdb Active Record: Added support for functions that support predefining one-to-many relationships:
|
||||
_ClassHasMany ClassBelongsTo TableHasMany TableBelongsTo TableKeyHasMany TableKeyBelongsTo_.
|
||||
- You can also define your child/parent class in these functions, instead of the default ADODB_Active_Record. Thx Arialdo Martini & Chris R for idea.
|
||||
- ADOdb Active Record: HasMany hardcoded primary key to "id". Fixed.
|
||||
- Many pdo and pdo-sqlite fixes from Sid Dunayer [sdunayer#interserv.com].
|
||||
- CacheSelectLimit not working for mssql. Fixed. Thx AlexB.
|
||||
- The rs2html function did not display hours in timestamps correctly. Now 24hr clock used.
|
||||
- Changed ereg* functions to use preg* functions as ereg* is deprecated in PHP 5.3. Modified sybase and postgresql drivers.
|
||||
|
||||
## 5.06 - 16 Oct 2008
|
||||
|
||||
- Added driver adodb-pdo_sqlite.inc.php. Thanks Diogo Toscano (diogo#scriptcase.net) for the code.
|
||||
- Added support for [one-to-many relationships](docs-active-record.htm#onetomany) with BelongsTo() and HasMany() in adodb_active_record.
|
||||
- Added BINARY type to mysql.inc.php (also in 4.991).
|
||||
- Added support for SelectLimit($sql,-1,100) in oci8. (also in 4.991).
|
||||
- New $conn->GetMedian($table, $field, $where='') to get median account no. (also in 4.991)
|
||||
- The rs2html() function in tohtml.inc.php did not handle dates with ':' in it properly. Fixed. (also in 4.991)
|
||||
- Added support for connecting to oci8 using `$DB->Connect($ip, $user, $pwd, "SID=$sid");` (also in 4.991)
|
||||
- Added mysql type 'VAR_STRING' to MetaType(). (also in 4.991)
|
||||
- The session and session2 code supports setfetchmode assoc properly now (also in 4.991).
|
||||
- Added concat support to pdo. Thx Andrea Baron.
|
||||
- Changed db2 driver to use format `Y-m-d H-i-s` for datetime instead of `Y-m-d-H-i-s` which was legacy from odbc_db2 conversion.
|
||||
- Removed vestigal break on adodb_tz_offset in adodb-time.inc.php.
|
||||
- MetaForeignKeys did not work for views in MySQL 5. Fixed.
|
||||
- Changed error handling in GetActiveRecordsClass.
|
||||
- Added better support for using existing driver when $ADODB_NEWCONNECTION function returns false.
|
||||
- In _CreateSuffix in adodb-datadict.inc.php, adding unsigned variable for mysql.
|
||||
- In adodb-xmlschema03.inc.php, changed addTableOpt to include db name.
|
||||
- If bytea blob in postgresql is null, empty string was formerly returned. Now null is returned.
|
||||
- Changed db2 driver CreateSequence to support $start parameter.
|
||||
- rs2html() now does not add nbsp to end if length of string > 0
|
||||
- The oci8po FetchField() now only lowercases field names if ADODB_ASSOC_CASE is set to 0.
|
||||
- New mssqlnative drivers for php. TQ Garrett Serack of M'soft. [Download](http://www.microsoft.com/downloads/details.aspx?FamilyId=61BF87E0-D031-466B-B09A-6597C21A2E2A&displaylang=en) mssqlnative extension. Note that this is still in beta.
|
||||
- Fixed bugs in memcache support.
|
||||
- You can now change the return value of GetOne if no records are found using the global variable $ADODB_GETONE_EOF. The default is null. To change it back to the pre-4.99/5.00 behaviour of false, set $ADODB_GETONE_EOF = false;
|
||||
- In Postgresql 8.2/8.3 MetaForeignkeys did not work. Fixed William Kolodny William.Kolodny#gt-t.net
|
||||
|
||||
## 5.05 - 11 Jul 2008
|
||||
|
||||
Released together with [v4.990](changelog_v4.x.md#4990---11-jul-2008)
|
||||
|
||||
- Added support for multiple recordsets in mysqli , thanks to Geisel Sierote geisel#4up.com.br. See http://phplens.com/lens/lensforum/msgs.php?id=15917
|
||||
- Malcolm Cook added new Reload() function to Active Record. See http://phplens.com/lens/lensforum/msgs.php?id=17474
|
||||
- Thanks Zoltan Monori (monzol#fotoprizma.hu) for bug fixes in iterator, SelectLimit, GetRandRow, etc.
|
||||
- Under heavy loads, the performance monitor for oci8 disables Ixora views.
|
||||
- Fixed sybase driver SQLDate to use str_replace(). Also for adodb5, changed sybase driver UnixDate and UnixTimeStamp calls to static.
|
||||
- Changed oci8 lob handler to use & reference `$this->_refLOBs[$numlob]['VAR'] = &$var`.
|
||||
- We now strtolower the get_class() function in PEAR::isError() for php5 compat.
|
||||
- CacheExecute did not retrieve cache recordsets properly for 5.04 (worked in 4.98). Fixed.
|
||||
- New ADODB_Cache_File class for file caching defined in adodb.inc.php.
|
||||
- Farsi language file contribution by Peyman Hooshmandi Raad (phooshmand#gmail.com)
|
||||
- New API for creating your custom caching class which is stored in $ADODB_CACHE:
|
||||
|
||||
``` php
|
||||
include "/path/to/adodb.inc.php";
|
||||
$ADODB_CACHE_CLASS = 'MyCacheClass';
|
||||
class MyCacheClass extends ADODB_Cache_File
|
||||
{
|
||||
function writecache($filename, $contents,$debug=false) {...}
|
||||
function &readcache($filename, &$err, $secs2cache, $rsClass) { ...}
|
||||
:
|
||||
}
|
||||
$DB = NewADOConnection($driver);
|
||||
$DB->Connect(...); ## MyCacheClass created here and stored in $ADODB_CACHE global variable.
|
||||
$data = $rs->CacheGetOne($sql); ## MyCacheClass is used here for caching...
|
||||
```
|
||||
|
||||
- Memcache supports multiple pooled hosts now. Only if none of the pooled servers
|
||||
can be contacted will a connect error be generated. Usage example below:
|
||||
|
||||
``` php
|
||||
$db = NewADOConnection($driver);
|
||||
$db->memCache = true; /// should we use memCache instead of caching in files
|
||||
$db->memCacheHost = array($ip1, $ip2, $ip3); /// $db->memCacheHost = $ip1; still works
|
||||
$db->memCachePort = 11211; /// this is default memCache port
|
||||
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
|
||||
$db->Connect(...);
|
||||
$db->CacheExecute($sql);
|
||||
```
|
||||
|
||||
## 5.04 - 13 Feb 2008
|
||||
|
||||
Released together with [v4.98](changelog_v4.x.md#498---13-feb-2008)
|
||||
|
||||
- Fixed adodb_mktime problem which causes a performance bottleneck in $hrs.
|
||||
- Added mysqli support to adodb_getcount().
|
||||
- Removed MYSQLI_TYPE_CHAR from MetaType().
|
||||
|
||||
## 5.03 - 22 Jan 2008
|
||||
|
||||
Released together with [v4.97](changelog_v4.x.md#497---22-jan-2008)
|
||||
|
||||
- Active Record: $ADODB_ASSOC_CASE=1 did not work properly. Fixed.
|
||||
- Modified Fields() in recordset class to support display null fields in FetchNextObject().
|
||||
- In ADOdb5, active record implementation, we now support column names with spaces in them - we autoconvert the spaces to _ using __set(). Thx Daniel Cook. http://phplens.com/lens/lensforum/msgs.php?id=17200
|
||||
- Removed $arg3 from mysqli SelectLimit. See http://phplens.com/lens/lensforum/msgs.php?id=16243. Thx Zsolt Szeberenyi.
|
||||
- Changed oci8 FetchField, which returns the max_length of BLOB/CLOB/NCLOB as 4000 (incorrectly) to -1.
|
||||
- CacheExecute would sometimes return an error on Windows if it was unable to lock the cache file. This is harmless and has been changed to a warning that can be ignored. Also adodb_write_file() code revised.
|
||||
- ADOdb perf code changed to only log sql if execution time >= 0.05 seconds. New $ADODB_PERF_MIN variable holds min sql timing. Any SQL with timing value below this and is not causing an error is not logged.
|
||||
- Also adodb_backtrace() now traces 1 level deeper as sometimes actual culprit function is not displayed.
|
||||
- Fixed a group by problem with adodb_getcount() for db's which are not postgres/oci8 based.
|
||||
- Changed mssql driver Parameter() from SQLCHAR to SQLVARCHAR: case 'string': $type = SQLVARCHAR; break.
|
||||
- Problem with mssql driver in php5 (for adodb 5.03) because some functions are not static. Fixed.
|
||||
|
||||
## 5.02 - 24 Sept 2007
|
||||
|
||||
Released together with [v4.96](changelog_v4.x.md#496---24-sept-2007)
|
||||
|
||||
- ADOdb perf for oci8 now has non-table-locking code when clearing the sql. Slower but better transparency. Added in 4.96a and 5.02a.
|
||||
- Fix adodb count optimisation. Preg_match did not work properly. Also rewrote the ORDER BY stripping code in _adodb_getcount(), adodb-lib.inc.php.
|
||||
- SelectLimit for oci8 not optimal for large recordsets when offset=0. Changed $nrows check.
|
||||
- Active record optimizations. Added support for assoc arrays in Set().
|
||||
- Now GetOne returns null if EOF (no records found), and false if error occurs. Use ErrorMsg()/ErrorNo() to get the error.
|
||||
- Also CacheGetRow and CacheGetCol will return false if error occurs, or empty array() if EOF, just like GetRow and GetCol.
|
||||
- Datadict now allows changing of types which are not resizable, eg. VARCHAR to TEXT in ChangeTableSQL. -- Mateo Tibaquirá
|
||||
- Added BIT data type support to adodb-ado.inc.php and adodb-ado5.inc.php.
|
||||
- Ldap driver did not return actual ldap error messages. Fixed.
|
||||
- Implemented GetRandRow($sql, $inputarr). Optimized for Oci8.
|
||||
- Changed adodb5 active record to use static SetDatabaseAdapter() and removed php4 constructor. Bas van Beek bas.vanbeek#gmail.com.
|
||||
- Also in adodb5, changed adodb-session2 to use static function declarations in class. Thx Daniel Berlin.
|
||||
- Added "Clear SQL Log" to bottom of Performance screen.
|
||||
- Sessions2 code echo'ed directly to the screen in debug mode. Now uses ADOConnection::outp().
|
||||
- In mysql/mysqli, qstr(null) will return the string `null` instead of empty quoted string `''`.
|
||||
- postgresql optimizeTable in perf-postgres.inc.php added by Daniel Berlin (mail#daniel-berlin.de)
|
||||
- Added 5.2.1 compat code for oci8.
|
||||
- Changed @@identity to SCOPE_IDENTITY() for multiple mssql drivers. Thx Stefano Nari.
|
||||
- Code sanitization introduced in 4.95 caused problems in European locales (as float 3.2 was typecast to 3,2). Now we only sanitize if is_numeric fails.
|
||||
- Added support for customizing ADORecordset_empty using $this->rsPrefix.'empty'. By Josh Truwin.
|
||||
- Added proper support for ALterColumnSQL for Postgresql in datadict code. Thx. Josh Truwin.
|
||||
- Added better support for MetaType() in mysqli when using an array recordset.
|
||||
- Changed parser for pgsql error messages in adodb-error.inc.php to case-insensitive regex.
|
||||
|
||||
## 5.01 - 17 May 2007
|
||||
|
||||
Released together with [v4.95](changelog_v4.x.md#495---17-may-2007)
|
||||
|
||||
- CacheFlush debug outp() passed in invalid parameters. Fixed.
|
||||
- Added Thai language file for adodb. Thx Trirat Petchsingh rosskouk#gmail.com and Marcos Pont
|
||||
- Added zerofill checking support to MetaColumns for mysql and mysqli.
|
||||
- CacheFlush no longer deletes all files/directories. Only *.cache files deleted.
|
||||
- DB2 timestamp format changed to `var $fmtTimeStamp = "'Y-m-d-H:i:s'";`
|
||||
- Added some code sanitization to AutoExecute in adodb-lib.inc.php.
|
||||
- Due to typo, all connections in adodb-oracle.inc.php would become persistent, even non-persistent ones. Fixed.
|
||||
- Oci8 DBTimeStamp uses 24 hour time for input now, so you can perform string comparisons between 2 DBTimeStamp values.
|
||||
- Some PHP4.4 compat issues fixed in adodb-session2.inc.php
|
||||
- For ADOdb 5.01, fixed some adodb-datadict.inc.php MetaType compat issues with PHP5.
|
||||
- The $argHostname was wiped out in adodb-ado5.inc.php. Fixed.
|
||||
- Adodb5 version, added iterator support for adodb_recordset_empty.
|
||||
- Adodb5 version,more error checking code now will use exceptions if available.
|
||||
531
include/limesurvey/classes/adodb/docs/changelog_v2.x.md
Normal file
531
include/limesurvey/classes/adodb/docs/changelog_v2.x.md
Normal file
@@ -0,0 +1,531 @@
|
||||
# ADOdb old Changelog - v2.x and older
|
||||
|
||||
See the [Current Changelog](changelog.md).
|
||||
|
||||
|
||||
## 2.91 - 3 Jan 2003
|
||||
|
||||
- Revised PHP version checking to use $ADODB_PHPVER with legal values 0x4000, 0x4050, 0x4200, 0x4300.
|
||||
- Added support for bytea fields and oid blobs in postgres by allowing BlobDecode() to detect and convert non-oid fields. Also added BlobEncode to postgres when you want to encode oid blobs.
|
||||
- Added blobEncodeType property for connections to inform phpLens what encoding method to use for blobs.
|
||||
- Added BlobDecode() and BlobEncode() to base ADOConnection class.
|
||||
- Added umask() to _gencachename() when creating directories.
|
||||
- Added charPage for ado drivers, so you can set the code page.
|
||||
```
|
||||
$conn->charPage = CP_UTF8;
|
||||
$conn->Connect($dsn);
|
||||
```
|
||||
- Modified _seek in mysql to check for num rows=0.
|
||||
- Added to metatypes new informix types for IDS 9.30\. Thx Fernando Ortiz.
|
||||
- _maxrecordcount returned in CachePageExecute $rsreturn
|
||||
- Fixed sybase cacheselectlimit( ) problems
|
||||
- MetaColumns() max_length should use precision for types X and C for ms access. Fixed.
|
||||
- Speedup of odbc non-SELECT sql statements.
|
||||
- Added support in MetaColumns for Wide Char types for ODBC. We halve max_length if unicode/wide char.
|
||||
- Added 'B' to types handled by GetUpdateSQL/GetInsertSQL.
|
||||
- Fixed warning message in oci8 driver with $persist variable when using PConnect.
|
||||
|
||||
## 2.90 - 11 Dec 2002
|
||||
|
||||
- Mssql and mssqlpo and oci8po now support ADODB_ASSOC_CASE.
|
||||
- Now MetaType() can accept a field object as the first parameter.
|
||||
- New $arr = $db->ServerInfo( ) function. Returns $arr['description'] which is the string description, and $arr['version'].
|
||||
- PostgreSQL and MSSQL speedups for insert/updates.
|
||||
- Implemented new SetFetchMode() that removes the need to use $ADODB_FETCH_MODE. Each connection has independant fetchMode.
|
||||
- ADODB_ASSOC_CASE now defaults to 2, use native defaults. This is because we would break backward compat for too many applications otherwise.
|
||||
- Patched encrypted sessions to use replace()
|
||||
- The qstr function supports quoting of nulls when escape character is \
|
||||
- Rewrote bits and pieces of session code to check for time synch and improve reliability.
|
||||
- Added property ADOConnection::hasTransactions = true/false;
|
||||
- Added CreateSequence and DropSequence functions
|
||||
- Found misplaced MoveNext() in adodb-postgres.inc.php. Fixed.
|
||||
- Sybase SelectLimit not reliable because 'set rowcount' not cached - fixed.
|
||||
- Moved ADOConnection to adodb-connection.inc.php and ADORecordSet to adodb-recordset.inc.php. This allows us to use doxygen to generate documentation. Doxygen doesn't like the classes in the main adodb.inc.php file for some mysterious reason.
|
||||
|
||||
## 2.50 - 14 Nov 2002
|
||||
|
||||
- Added transOff and transCnt properties for disabling (transOff = true) and tracking transaction status (transCnt>0).
|
||||
- Added inputarray handling into _adodb_pageexecute_all_rows - "Ross Smith" RossSmith#bnw.com.
|
||||
- Fixed postgresql inconsistencies in date handling.
|
||||
- Added support for mssql_fetch_assoc.
|
||||
- Fixed $ADODB_FETCH_MODE bug in odbc MetaTables() and MetaPrimaryKeys().
|
||||
- Accidentally declared UnixDate() twice, making adodb incompatible with php 4.3.0\. Fixed.
|
||||
- Fixed pager problems with some databases that returned -1 for _currentRow on MoveLast() by switching to MoveNext() in adodb-lib.inc.php.
|
||||
- Also fixed uninited $discard in adodb-lib.inc.php.
|
||||
|
||||
## 2.43 - 25 Oct 2002
|
||||
|
||||
- Added ADODB_ASSOC_CASE constant to better support ibase and odbc field names.
|
||||
- Added support for NConnect() for oracle OCINLogin.
|
||||
- Fixed NumCols() bug.
|
||||
- Changed session handler to use Replace() on write.
|
||||
- Fixed oci8 SelectLimit aggregate function bug again.
|
||||
- Rewrote pivoting code.
|
||||
|
||||
## 2.42 - 4 Oct 2002
|
||||
|
||||
- Fixed ibase_fetch() problem with nulls. Also interbase now does automatic blob decoding, and is backward compatible. Suggested by Heinz Hombergs heinz#hhombergs.de.
|
||||
- Fixed postgresql MoveNext() problems when called repeatedly after EOF. Also suggested by Heinz Hombergs.
|
||||
- PageExecute() does not rewrite queries if SELECT DISTINCT is used. Requested by hans#velum.net
|
||||
- Added additional fixes to oci8 SelectLimit handling with aggregate functions - thx to Christian Bugge for reporting the problem.
|
||||
|
||||
## 2.41 - 2 Oct 2002
|
||||
|
||||
- Fixed ADODB_COUNTRECS bug in odbc. Thx to Joshua Zoshi jzoshi#hotmail.com.
|
||||
- Increased buffers for adodb-csvlib.inc.php for extremely long sql from 8192 to 32000.
|
||||
- Revised pivottable.inc.php code. Added better support for aggregate fields.
|
||||
- Fixed mysql text/blob types problem in MetaTypes base class - thx to horacio degiorgi.
|
||||
- Added SQLDate($fmt,$date) function, which allows an sql date format string to be generated - useful for group by's.
|
||||
- Fixed bug in oci8 SelectLimit when offset>100.
|
||||
|
||||
## 2.40 - 4 Sept 2002
|
||||
|
||||
- Added new NLS_DATE_FORMAT property to oci8\. Suggested by Laurent NAVARRO ln#altidev.com
|
||||
- Now use bind parameters in oci8 selectlimit for better performance.
|
||||
- Fixed interbase replaceQuote for dialect != 1\. Thx to "BEGUIN Pierre-Henri - INFOCOB" phb#infocob.com.
|
||||
- Added white-space check to QA.
|
||||
- Changed unixtimestamp to support fractional seconds (we always round down/floor the seconds). Thanks to beezly#beezly.org.uk.
|
||||
- Now you can set the trigger_error type your own user-defined type in adodb-errorhandler.inc.php. Suggested by Claudio Bustos clbustos#entelchile.net.
|
||||
- Added recordset filters with rsfilter.inc.php.
|
||||
$conn->_rs2rs does not create a new recordset when it detects it is of type array. Some trickery there as there seems to be a bug in Zend Engine
|
||||
- Added render_pagelinks to adodb-pager.inc.php. Code by "Pablo Costa" pablo#cbsp.com.br.
|
||||
- MetaType() speedup in adodb.inc.php by using hashing instead of switch. Best performance if constant arrays are supported, as they are in PHP5.
|
||||
- adodb-session.php now updates only the expiry date if the crc32 check indicates that the data has not been modified.
|
||||
|
||||
## 2.31 - 20 Aug 2002
|
||||
|
||||
- Made changes to pivottable.inc.php due to daniel lucuzaeu's suggestions (we sum the pivottable column if desired).
|
||||
- Fixed ErrorNo() in postgres so it does not depend on _errorMsg property.
|
||||
- Robert Tuttle added support for oracle cursors. See ExecuteCursor().
|
||||
- Fixed Replace() so it works with mysql when updating record where data has not changed. Reported by Cal Evans (cal#calevans.com).
|
||||
|
||||
## 2.30 - 1 Aug 2002
|
||||
|
||||
- Added pivottable.inc.php. Thanks to daniel.lucazeau#ajornet.com for the original concept.
|
||||
- Added ADOConnection::outp($msg,$newline) to output error and debugging messages. Now you can override this using the ADODB_OUTP constant and use your own output handler.
|
||||
- Changed == to === for 'null' comparison. Reported by ericquil#yahoo.com
|
||||
- Fixed mssql SelectLimit( ) bug when distinct used.
|
||||
|
||||
## 2.30 - 1 Aug 2002
|
||||
|
||||
- New GetCol() and CacheGetCol() from ross#bnw.com that returns the first field as a 1 dim array.
|
||||
- We have an empty recordset, but RecordCount() could return -1\. Fixed. Reported by "Jonathan Polansky" jonathan#polansky.com.
|
||||
- We now check for session variable changes using strlen($sessval).crc32($sessval). Formerly we only used crc32().
|
||||
- Informix SelectLimit() problem with $ADODB_COUNTRECS fixed.
|
||||
- Fixed informix SELECT FIRST x DISTINCT, and not SELECT DISTINCT FIRST x - reported by F Riosa
|
||||
- Now default adodb error handlers ignores error if @ used.
|
||||
- If you set $conn->autoRollback=true, we auto-rollback persistent connections for odbc, mysql, oci8, mssql. Default for autoRollback is false. No need to do so for postgres. As interbase requires a transaction id (what a flawed api), we don't do it for interbase.
|
||||
- Changed PageExecute() to use non-greedy preg_match when searching for "FROM" keyword.
|
||||
|
||||
## 2.20 - 9 July 2002
|
||||
|
||||
- Added CacheGetOne($secs2cache,$sql), CacheGetRow($secs2cache,$sql), CacheGetAll($secs2cache,$sql).
|
||||
- Added $conn->OffsetDate($dayFraction,$date=false) to generate sql that calcs date offsets. Useful for scheduling appointments.
|
||||
- Added connection properties: leftOuter, rightOuter that hold left and right outer join operators.
|
||||
- Added connection property: ansiOuter to indicate whether ansi outer joins supported.
|
||||
- New driver _mssqlpo_, the portable mssql driver, which converts string concat operator from || to +.
|
||||
- Fixed ms access bug - SelectLimit() did not support ties - fixed.
|
||||
- Karsten Kraus (Karsten.Kraus#web.de), contributed error-handling code to ADONewConnection. Unfortunately due to backward compat problems, had to rollback most of the changes.
|
||||
- Added new parameter to GetAssoc() to allow returning an array of key-value pairs, ignoring any additional columns in the recordset. Off by default.
|
||||
- Corrected mssql $conn->sysDate to return only date using convert().
|
||||
- CacheExecute() improved debugging output.
|
||||
- Changed rs2html() so newlines are converted to BR tags. Also optimized rs2html() based on feedback by "Jerry Workman" jerry#mtncad.com.
|
||||
- Added support for Replace() with Interbase, using DELETE and INSERT.
|
||||
- Some minor optimizations (mostly removing & references when passing arrays).
|
||||
- Changed GenID() to allows id's larger than the size of an integer.
|
||||
- Added force_session property to oci8 for better updateblob() support.
|
||||
- Fixed PageExecute() which did not work properly with sql containing GROUP BY.
|
||||
|
||||
## 2.12 - 12 June 2002
|
||||
|
||||
- Added toexport.inc.php to export recordsets in CSV and tab-delimited format.
|
||||
- CachePageExecute() does not work - fixed - thx John Huong.
|
||||
- Interbase aliases not set properly in FetchField() - fixed. Thx Stefan Goethals.
|
||||
- Added cache property to adodb pager class. The number of secs to cache recordsets.
|
||||
- SQL rewriting bug in pageexecute() due to skipping of newlines due to missing /s modifier. Fixed.
|
||||
- Max size of cached recordset due to a bug was 256000 bytes. Fixed.
|
||||
- Speedup of 1st invocation of CacheExecute() by tuning code.
|
||||
- We compare $rewritesql with $sql in pageexecute code in case of rewrite failure.
|
||||
|
||||
## 2.11 - 7 June 2002
|
||||
|
||||
- Fixed PageExecute() rewrite sql problem - COUNT(*) and ORDER BY don't go together with mssql, access and postgres. Thx to Alexander Zhukov alex#unipack.ru
|
||||
- DB2 support for CHARACTER type added - thx John Huong huongch#bigfoot.com
|
||||
- For ado, $argProvider not properly checked. Fixed - kalimero#ngi.it
|
||||
- Added $conn->Replace() function for update with automatic insert if the record does not exist. Supported by all databases except interbase.
|
||||
|
||||
## 2.10 - 4 June 2002
|
||||
|
||||
- Added uniqueSort property to indicate mssql ORDER BY cols must be unique.
|
||||
- Optimized session handler by crc32 the data. We only write if session data has changed.
|
||||
- adodb_sess_read in adodb-session.php now returns ''correctly - thanks to Jorma Tuomainen, webmaster#wizactive.com
|
||||
- Mssql driver did not throw EXECUTE errors correctly because ErrorMsg() and ErrorNo() called in wrong order. Pointed out by Alexios Fakos. Fixed.
|
||||
- Changed ado to use client cursors. This fixes BeginTran() problems with ado.
|
||||
- Added handling of timestamp type in ado.
|
||||
- Added to ado_mssql support for insert_id() and affected_rows().
|
||||
- Added support for mssql.datetimeconvert=0, available since php 4.2.0.
|
||||
- Made UnixDate() less strict, so that the time is ignored if present.
|
||||
- Changed quote() so that it checks for magic_quotes_gpc.
|
||||
- Changed maxblobsize for odbc to default to 64000.
|
||||
|
||||
## 2.00 - 13 May 2002
|
||||
|
||||
- Added drivers _informix72_ for pre-7.3 versions, and _oci805_ for oracle 8.0.5, and postgres64 for postgresql 6.4 and earlier. The postgres and postgres7 drivers are now identical.
|
||||
- Interbase now partially supports ADODB_FETCH_BOTH, by defaulting to ASSOC mode.
|
||||
- Proper support for blobs in mssql. Also revised blob support code is base class. Now UpdateBlobFile() calls UpdateBlob() for consistency.
|
||||
- Added support for changed odbc_fetch_into api in php 4.2.0 with $conn->_has_stupid_odbc_fetch_api_change.
|
||||
- Fixed spelling of tablock locking hint in GenID( ) for mssql.
|
||||
- Added RowLock( ) to several databases, including oci8, informix, sybase, etc. Fixed where error in mssql RowLock().
|
||||
- Added sysDate and sysTimeStamp properties to most database drivers. These are the sql functions/constants for that database that return the current date and current timestamp, and are useful for portable inserts and updates.
|
||||
- Support for RecordCount() caused date handling in sybase and mssql to break. Fixed, thanks to Toni Tunkkari, by creating derived classes for ADORecordSet_array for both databases. Generalized using arrayClass property. Also to support RecordCount(), changed metatype handling for ado drivers. Now the type returned in FetchField is no longer a number, but the 1-char data type returned by MetaType. At the same time, fixed a lot of date handling. Now mssql support dmy and mdy date formats. Also speedups in sybase and mssql with preg_match and ^ in date/timestamp handling. Added support in sybase and mssql for 24 hour clock in timestamps (no AM/PM).
|
||||
- Extensive revisions to informix driver - thanks to Samuel CARRIERE samuel_carriere#hotmail.com
|
||||
- Added $ok parameter to CommitTrans($ok) for easy rollbacks.
|
||||
- Fixed odbc MetaColumns and MetaTables to save and restore $ADODB_FETCH_MODE.
|
||||
- Some odbc drivers did not call the base connection class constructor. Fixed.
|
||||
- Fixed regex for GetUpdateSQL() and GetInsertSQL() to support more legal character combinations.
|
||||
|
||||
## 1.99 - 21 April 2002
|
||||
|
||||
- Added emulated RecordCount() to all database drivers if $ADODB_COUNTRECS = true (which it is by default). Inspired by Cristiano Duarte (cunha17#uol.com.br).
|
||||
- Unified stored procedure support for mssql and oci8\. Parameter() and PrepareSP() functions implemented.
|
||||
- Added support for SELECT FIRST in informix, modified hasTop property to support this.
|
||||
- Changed csv driver to handle updates/deletes/inserts properly (when Execute() returns true). Bind params also work now, and raiseErrorFn with csv driver. Added csv driver to QA process.
|
||||
- Better error checking in oci8 UpdateBlob() and UpdateBlobFile().
|
||||
- Added TIME type to MySQL - patch by Manfred h9125297#zechine.wu-wien.ac.at
|
||||
- Prepare/Execute implemented for Interbase/Firebird
|
||||
- Changed some regular expressions to be anchored by /^ $/ for speed.
|
||||
- Added UnixTimeStamp() and UnixDate() to ADOConnection(). Now these functions are in both ADOConnection and ADORecordSet classes.
|
||||
- Empty recordsets were not cached - fixed.
|
||||
- Thanks to Gaetano Giunta (g.giunta#libero.it) for the oci8 code review. We didn't agree on everything, but i hoped we agreed to disagree!
|
||||
|
||||
## 1.90 - 6 April 2002
|
||||
|
||||
- Now all database drivers support fetch modes ADODB_FETCH_NUM and ADODB_FETCH_ASSOC, though still not fully tested. Eg. Frontbase, Sybase, Informix.
|
||||
- NextRecordSet() support for mssql. Contributed by "Sven Axelsson" sven.axelsson#bokochwebb.se
|
||||
- Added blob support for SQL Anywhere. Contributed by Wade Johnson wade#wadejohnson.de
|
||||
- Fixed some security loopholes in server.php. Server.php also supports fetch mode.
|
||||
- Generalized GenID() to support odbc and mssql drivers. Mssql no longer generates GUID's.
|
||||
- Experimental RowLock($table,$where) for mssql.
|
||||
- Properly implemented Prepare() in oci8 and ODBC.
|
||||
- Added Bind() support to oci8 to support Prepare().
|
||||
- Improved error handler. Catches CacheExecute() and GenID() errors now.
|
||||
- Now if you are running php from the command line, debugging messages do not output html formating. Not 100% complete, but getting there.
|
||||
|
||||
## 1.81 - 22 March 2002
|
||||
|
||||
- Restored default $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT for backward compatibility.
|
||||
- SelectLimit for oci8 improved - Our FIRST_ROWS optimization now does not overwrite existing hint.
|
||||
- New Sybase SQL Anywhere driver. Contributed by Wade Johnson wade#wadejohnson.de
|
||||
|
||||
## 1.80 - 15 March 2002
|
||||
|
||||
- Redesigned directory structure of ADOdb files. Added new driver directory where all database drivers reside.
|
||||
- Changed caching algorithm to create subdirectories. Now we scale better.
|
||||
- Informix driver now supports insert_id(). Contribution by "Andrea Pinnisi" pinnisi#sysnet.it
|
||||
- Added experimental ISO date and FetchField support for informix.
|
||||
- Fixed a quoting bug in Execute() with bind parameters, causing problems with blobs.
|
||||
- Mssql driver speedup by 10-15%.
|
||||
- Now in CacheExecute($secs2cache,$sql,...), $secs2cache is optional. If missing, it will take the value defined in $connection->cacheSecs (default is 3600 seconds). Note that CacheSelectLimit(), the secs2cache is still compulsory - sigh.
|
||||
- Sybase SQL Anywhere driver (using ODBC) contributed by Wade Johnson wade#wadejohnson.de
|
||||
|
||||
## 1.72 - 8 March 2002
|
||||
|
||||
- Added @ when returning Fields() to prevent spurious error - "Michael William Miller" mille562#pilot.msu.edu
|
||||
- MetaDatabases() for postgres contributed by Phil pamelant#nerim.net
|
||||
- Mitchell T. Young (mitch#youngfamily.org) contributed informix driver.
|
||||
- Fixed rs2html() problem. I cannot reproduce, so probably a problem with pre PHP 4.1.0 versions, when supporting new ADODB_FETCH_MODEs.
|
||||
- Mattia Rossi (mattia#technologist.com) contributed BlobDecode() and UpdateBlobFile() for postgresql using the postgres specific pg_lo_import()/pg_lo_open() - i don't use them but hopefully others will find this useful. See [this posting](http://phplens.com/lens/lensforum/msgs.php?id=1262) for an example of usage.
|
||||
- Added UpdateBlobFile() for uploading files to a database.
|
||||
- Made UpdateBlob() compatible with oci8po driver.
|
||||
- Added noNullStrings support to oci8 driver. Oracle changes all ' ' strings to nulls, so you need to set strings to ' ' to prevent the nullifying of strings. $conn->noNullStrings = true; will do this for you automatically. This is useful when you define a char column as NOT NULL.
|
||||
- Fixed UnixTimeStamp() bug - wasn't setting minutes and seconds properly. Patch from Agusti Fita i Borrell agusti#anglatecnic.com.
|
||||
- Toni Tunkkari added patch for sybase dates. Problem with spaces in day part of date fixed.
|
||||
|
||||
## 1.71 - 18 Jan 2002
|
||||
|
||||
- Sequence start id support. Now $conn->Gen_ID('seqname', 50) to start sequence from 50.
|
||||
- CSV driver fix for selectlimit, from Andreas - akaiser#vocote.de.
|
||||
- Gam3r spotted that a global variable was undefined in the session handler.
|
||||
- Mssql date regex had error. Fixed - reported by Minh Hoang vb_user#yahoo.com.
|
||||
- DBTimeStamp() and DBDate() now accept iso dates and unix timestamps. This means that the PostgreSQL handling of dates in GetInsertSQL() and GetUpdateSQL() can be removed. Also if these functions are passed '' or null or false, we return a SQL null.
|
||||
- GetInsertSQL() and GetUpdateSQL() now accept a new parameter, $magicq to indicate whether quotes should be inserted based on magic quote settings - suggested by dj#4ict.com.
|
||||
- Reformated docs slightly based on suggestions by Chris Small.
|
||||
|
||||
## 1.65 - 28 Dec 2001
|
||||
|
||||
- Fixed borland_ibase class naming bug.
|
||||
- Now instead of using $rs->fields[0] internally, we use reset($rs->fields) so that we are compatible with ADODB_FETCH_ASSOC mode. Reported by Nico S.
|
||||
- Changed recordset constructor and _initrs() for oci8 so that it returns the field definitions even if no rows in the recordset. Reported by Rick Hickerson (rhickers#mv.mv.com).
|
||||
- Improved support for postgresql in GetInsertSQL and GetUpdateSQL by "mike" mike#partner2partner.com and "Ryan Bailey" rebel#windriders.com
|
||||
|
||||
## 1.64 - 20 Dec 2001
|
||||
|
||||
- Danny Milosavljevic <danny.milo#gmx.net> added some patches for MySQL error handling and displaying default values.
|
||||
- Fixed some ADODB_FETCH_BOTH inconsistencies in odbc and interbase.
|
||||
- Added more tests to test suite to cover ADODB_FETCH_* and ADODB_ERROR_HANDLER.
|
||||
- Added firebird (ibase) driver
|
||||
- Added borland_ibase driver for interbase 6.5
|
||||
|
||||
## 1.63 - 13 Dec 2001
|
||||
|
||||
- Absolute to the adodb-lib.inc.php file not set properly. Fixed.
|
||||
|
||||
## 1.62 - 11 Dec 2001
|
||||
|
||||
- Major speedup of ADOdb for low-end web sites by reducing the php code loading and compiling cycle. We conditionally compile not so common functions. Moved csv code to adodb-csvlib.inc.php to reduce adodb.inc.php parsing. This file is loaded only when the csv/proxy driver is used, or CacheExecute() is run. Also moved PageExecute(), GetSelectSQL() and GetUpdateSQL() core code to adodb-lib.inc.php. This reduced the 70K main adodb.inc.php file to 55K, and since at least 20K of the file is comments, we have reduced 50K of code in adodb.inc.php to 35K. There should be 35% reduction in memory and thus 35% speedup in compiling the php code for the main adodb.inc.php file.
|
||||
- Highly tuned SelectLimit() for oci8 for massive speed improvements on large files. Selecting 20 rows starting from the 20,000th row of a table is now 7 times faster. Thx to Tomas V V Cox.
|
||||
- Allow . and # in table definitions in GetInsertSQL and GetUpdateSQL. See ADODB_TABLE_REGEX constant. Thx to Ari Kuorikoski.
|
||||
- Added ADODB_PREFETCH_ROWS constant, defaulting to 10\. This determines the number of records to prefetch in a SELECT statement. Only used by oci8.
|
||||
- Added high portability Oracle class called oci8po. This uses ? for bind variables, and lower cases column names.
|
||||
- Now all database drivers support $ADODB_FETCH_MODE, including interbase, ado, and odbc: ADODB_FETCH_NUM and ADODB_FETCH_ASSOC. ADODB_FETCH_BOTH is not fully implemented for all database drivers.
|
||||
|
||||
## 1.61 - Nov 2001
|
||||
- Added PO_RecordCount() and PO_Insert_ID(). PO stands for portable. Pablo Roca [pabloroca#mvps.org]
|
||||
- GenID now returns 0 if not available. Safer is that you should check $conn->hasGenID for availability.
|
||||
- M'soft ADO we now correctly close recordset in _close() peterd#telephonetics.co.uk
|
||||
- MSSQL now supports GenID(). It generates a 16-byte GUID from mssql newid() function.
|
||||
- Changed ereg_replace to preg_replace in SelectLimit. This is a fix for mssql. Ereg doesn't support t or n! Reported by marino Carlos xaplo#postnuke-espanol.org
|
||||
- Added $recordset->connection. This is the ADOConnection object for the recordset. Works with cached and normal recordsets. Surprisingly, this had no affect on performance!
|
||||
|
||||
## 1.54 - 15 Nov 2001
|
||||
|
||||
- Fixed some more bugs in PageExecute(). I am getting sick of bug in this and will have to reconsider my QA here. The main issue is that I don't use PageExecute() and to check whether it is working requires a visual inspection of the html generated currently. It is possible to write a test script but it would be quite complicated :(
|
||||
- More speedups of SelectLimit() for DB2, Oci8, access, vfp, mssql.
|
||||
|
||||
## 1.53 - 7 Nov 2001
|
||||
|
||||
- Added support for ADODB_FETCH_ASSOC for ado and odbc drivers.
|
||||
- Tuned GetRowAssoc(false) in postgresql and mysql.
|
||||
- Stephen Van Dyke contributed ADOdb icon, accepted with some minor mods.
|
||||
- Enabled Affected_Rows() for postgresql
|
||||
- Speedup for Concat() using implode() - Benjamin Curtis ben_curtis#yahoo.com
|
||||
- Fixed some more bugs in PageExecute() to prevent infinite loops
|
||||
|
||||
## 1.52 - 5 Nov 2001
|
||||
|
||||
- Spelling error in CacheExecute() caused it to fail. $ql should be $sql in line 625!
|
||||
- Added fixes for parsing [ and ] in GetUpdateSQL().
|
||||
|
||||
## 1.51 - 5 Nov 2001
|
||||
|
||||
- Oci8 SelectLimit() speedup by using OCIFetch().
|
||||
- Oci8 was mistakenly reporting errors when $db->debug = true.
|
||||
- If a connection failed with ODBC, it was not correctly reported - fixed.
|
||||
- _connectionID was inited to -1, changed to false.
|
||||
- Added $rs->FetchRow(), to simplify API, ala PEAR DB
|
||||
- Added PEAR DB compat mode, which is still faster than PEAR! See adodb-pear.inc.php.
|
||||
- Removed postgres pconnect debugging statement.
|
||||
|
||||
## 1.50 - 31 Oct 2001
|
||||
|
||||
- ADOdbConnection renamed to ADOConnection, and ADOdbFieldObject to ADOFieldObject.
|
||||
- PageExecute() now checks for empty $rs correctly, and the errors in the docs on this subject have been fixed.
|
||||
- odbc_error() does not return 6 digit error correctly at times. Implemented workaround.
|
||||
- Added ADORecordSet_empty class. This will speedup INSERTS/DELETES/UPDATES because the return object created is much smaller.
|
||||
- Added Prepare() to odbc, and oci8 (but doesn't work properly for oci8 still).
|
||||
- Made pgsql a synonym for postgre7, and changed SELECT LIMIT to use OFFSET for compat with postgres 7.2.
|
||||
- Revised adodb-cryptsession.php thanks to Ari.
|
||||
- Set resources to false on _close, to force freeing of resources.
|
||||
- Added adodb-errorhandler.inc.php, adodb-errorpear.inc.php and raiseErrorFn on Freek's urging.
|
||||
- GetRowAssoc($toUpper=true): $toUpper added as default.
|
||||
- Errors when connecting to a database were not captured formerly. Now we do it correctly.
|
||||
|
||||
## 1.40 - 19 September 2001
|
||||
|
||||
- PageExecute() to implement page scrolling added. Code and idea by Iván Oliva.
|
||||
- Some minor postgresql fixes.
|
||||
- Added sequence support using GenID() for postgresql, oci8, mysql, interbase.
|
||||
- Added UpdateBlob support for interbase (untested).
|
||||
- Added encrypted sessions (see adodb-cryptsession.php). By Ari Kuorikoski <kuoriari#finebyte.com>
|
||||
|
||||
## 1.31 - 21 August 2001
|
||||
|
||||
- Many bug fixes thanks to "GaM3R (Cameron)" <gamr#outworld.cx>. Some session changes due to Gam3r.
|
||||
- Fixed qstr() to quote also.
|
||||
- rs2html() now pretty printed.
|
||||
- Jonathan Younger <jyounger#unilab.com> contributed the great idea GetUpdateSQL() and GetInsertSQL() which generates SQL to update and insert into a table from a recordset. Modify the recordset fields array, then can this function to generate the SQL (the SQL is not executed).
|
||||
- Nicola Fankhauser <nicola.fankhauser#couniq.com> found some bugs in date handling for mssql.
|
||||
- Added minimal Oracle support for LOBs. Still under development.
|
||||
- Added $ADODB_FETCH_MODE so you can control whether recordsets return arrays which are numeric, associative or both. This is a global variable you set. Currently only MySQL, Oci8, Postgres drivers support this.
|
||||
- PostgreSQL properly closes recordsets now. Reported by several people.
|
||||
- Added UpdateBlob() for Oracle. A hack to make it easier to save blobs.
|
||||
- Oracle timestamps did not display properly. Fixed.
|
||||
|
||||
## 1.20 - 6 June 2001
|
||||
|
||||
- Now Oracle can connect using tnsnames.ora or server and service name
|
||||
- Extensive Oci8 speed optimizations. Oci8 code revised to support variable binding, and /*+ FIRST_ROWS */ hint.
|
||||
- Worked around some 4.0.6 bugs in odbc_fetch_into().
|
||||
- Paolo S. Asioli paolo.asioli#libero.it suggested GetRowAssoc().
|
||||
- Escape quotes for oracle wrongly set to '. Now '' is used.
|
||||
- Variable binding now works in ODBC also.
|
||||
- Jumped to version 1.20 because I don't like 13 :-)
|
||||
|
||||
## 1.12 - 6 June 2001
|
||||
|
||||
- Changed $ADODB_DIR to ADODB_DIR constant to plug a security loophole.
|
||||
- Changed _close() to close persistent connections also. Prevents connection leaks.
|
||||
- Major revision of oracle and oci8 drivers. Added OCI_RETURN_NULLS and OCI_RETURN_LOBS to OCIFetchInto(). BLOB, CLOB and VARCHAR2 recognition in MetaType() improved. MetaColumns() returns columns in correct sort order.
|
||||
- Interbase timestamp input format was wrong. Fixed.
|
||||
|
||||
## 1.11 - 20 May 2001
|
||||
|
||||
- Improved file locking for Windows.
|
||||
- Probabilistic flushing of cache to avoid avalanche updates when cache timeouts.
|
||||
- Cached recordset timestamp not saved in some scenarios. Fixed.
|
||||
|
||||
## 1.10 - 19 May 2001
|
||||
|
||||
- Added caching. CacheExecute() and CacheSelectLimit().
|
||||
- Added csv driver. See [http://php.weblogs.com/ADODB_csv](http://php.weblogs.com/adodb_csv).
|
||||
- Fixed SelectLimit(), SELECT TOP not working under certain circumstances.
|
||||
- Added better Frontbase support of MetaTypes() by Frank M. Kromann.
|
||||
|
||||
## 1.01 - 24 April 2001
|
||||
|
||||
- Fixed SelectLimit bug. not quoted properly.
|
||||
- SelectLimit: SELECT TOP -1 * FROM TABLE not support by Microsoft. Fixed.
|
||||
- GetMenu improved by glen.davies#cce.ac.nz to support multiple hilited items
|
||||
- FetchNextObject() did not work with only 1 record returned. Fixed bug reported by $tim#orotech.net
|
||||
- Fixed mysql field max_length problem. Fix suggested by Jim Nicholson (jnich#att.com)
|
||||
|
||||
## 1.00 - 16 April 2001
|
||||
|
||||
- Given some brilliant suggestions on how to simplify ADOdb by akul. You no longer need to setup $ADODB_DIR yourself, and ADOLoadCode() is automatically called by ADONewConnection(), simplifying the startup code.
|
||||
- FetchNextObject() added. Suggested by Jakub Marecek. This makes FetchObject() obsolete, as this is more flexible and powerful.
|
||||
- Misc fixes to SelectLimit() to support Access (top must follow distinct) and Fields() in the array recordset. From Reinhard Balling.
|
||||
|
||||
## 0.96 - 27 Mar 2001
|
||||
|
||||
- ADOConnection Close() did not return a value correctly. Thanks to akul#otamedia.com.
|
||||
- When the horrible magic_quotes is enabled, back-slash () is changed to double-backslash (\). This doesn't make sense for Microsoft/Sybase databases. We fix this in qstr().
|
||||
- Fixed Sybase date problem in UnixDate() thanks to Toni Tunkkari. Also fixed MSSQL problem in UnixDate() - thanks to milhouse31#hotmail.com.
|
||||
- MoveNext() moved to leaf classes for speed in MySQL/PostgreSQL. 10-15% speedup.
|
||||
- Added null handling in bindInputArray in Execute() -- Ron Baldwin suggestion.
|
||||
- Fixed some option tags. Thanks to john#jrmstudios.com.
|
||||
|
||||
## 0.95 - 13 Mar 2001
|
||||
|
||||
- Added postgres7 database driver which supports LIMIT and other version 7 stuff in the future.
|
||||
- Added SelectLimit to ADOConnection to simulate PostgreSQL's "select * from table limit 10 offset 3". Added helper function GetArrayLimit() to ADORecordSet.
|
||||
- Fixed mysql metacolumns bug. Thanks to Freek Dijkstra (phpeverywhere#macfreek.com).
|
||||
- Also many PostgreSQL changes by Freek. He almost rewrote the whole PostgreSQL driver!
|
||||
- Added fix to input parameters in Execute for non-strings by Ron Baldwin.
|
||||
- Added new metatype, X for TeXt. Formerly, metatype B for Blob also included text fields. Now 'B' is for binary/image data. 'X' for textual data.
|
||||
- Fixed $this->GetArray() in GetRows().
|
||||
- Oracle and OCI8: 1st parameter is always blank -- now warns if it is filled.
|
||||
- Now _hasLimit_ and _hasTop_ added to indicate whether SELECT * FROM TABLE LIMIT 10 or SELECT TOP 10 * FROM TABLE are supported.
|
||||
|
||||
## 0.94 - 04 Feb 2001
|
||||
|
||||
- Added ADORecordSet::GetRows() for compatibility with Microsoft ADO. Synonym for GetArray().
|
||||
- Added new metatype 'R' to represent autoincrement numbers.
|
||||
- Added ADORecordSet.FetchObject() to return a row as an object.
|
||||
- Finally got a Linux box to test PostgreSql. Many fixes.
|
||||
- Fixed copyright misspellings in 0.93.
|
||||
- Fixed mssql MetaColumns type bug.
|
||||
- Worked around odbc bug in PHP4 for sessions.
|
||||
- Fixed many documentation bugs (affected_rows, metadatabases, qstr).
|
||||
- Fixed MySQL timestamp format (removed comma).
|
||||
- Interbase driver did not call ibase_pconnect(). Fixed.
|
||||
|
||||
## 0.93 - 18 Jan 2002
|
||||
|
||||
- Fixed GetMenu bug.
|
||||
- Simplified Interbase commit and rollback.
|
||||
- Default behaviour on closing a connection is now to rollback all active transactions.
|
||||
- Added field object handling for array recordset for future XML compatibility.
|
||||
- Added arr2html() to convert array to html table.
|
||||
|
||||
## 0.92 - 2 Jan 2002
|
||||
|
||||
- Interbase Commit and Rollback should be working again.
|
||||
- Changed initialisation of ADORecordSet. This is internal and should not affect users. We are doing this to support cached recordsets in the future.
|
||||
- Implemented ADORecordSet_array class. This allows you to simulate a database recordset with an array.
|
||||
- Added UnixDate() and UnixTimeStamp() to ADORecordSet.
|
||||
|
||||
## 0.91 - 21 Dec 2000
|
||||
|
||||
- Fixed ODBC so ErrorMsg() is working.
|
||||
- Worked around ADO unrecognised null (0x1) value problem in COM.
|
||||
- Added Sybase support for FetchField() type
|
||||
- Removed debugging code and unneeded html from various files
|
||||
- Changed to javadoc style comments to adodb.inc.php.
|
||||
- Added maxsql as synonym for mysqlt
|
||||
- Now ODBC downloads first 8K of blob by default
|
||||
|
||||
## 0.90 - 15 Nov 2000
|
||||
|
||||
- Lots of testing of Microsoft ADO. Should be more stable now.
|
||||
- Added $ADODB_COUNTREC. Set to false for high speed selects.
|
||||
- Added Sybase support. Contributed by Toni Tunkkari (toni.tunkkari#finebyte.com). Bug in Sybase API: GetFields is unable to determine date types.
|
||||
- Changed behaviour of RecordSet.GetMenu() to support size parameter (listbox) properly.
|
||||
- Added emptyDate and emptyTimeStamp to RecordSet class that defines how to represent empty dates.
|
||||
- Added MetaColumns($table) that returns an array of ADOFieldObject's listing the columns of a table.
|
||||
- Added transaction support for PostgresSQL -- thanks to "Eric G. Werk" egw#netguide.dk.
|
||||
- Added adodb-session.php for session support.
|
||||
|
||||
## 0.80 - 30 Nov 2000
|
||||
|
||||
- Added support for charSet for interbase. Implemented MetaTables for most databases. PostgreSQL more extensively tested.
|
||||
|
||||
## 0.71 - 22 Nov 2000
|
||||
|
||||
- Switched from using require_once to include/include_once for backward compatability with PHP 4.02 and earlier.
|
||||
|
||||
## 0.70 - 15 Nov 2000
|
||||
|
||||
- Calls by reference have been removed (call_time_pass_reference=Off) to ensure compatibility with future versions of PHP, except in Oracle 7 driver due to a bug in php_oracle.dll.
|
||||
- PostgreSQL database driver contributed by Alberto Cerezal (acerezalp#dbnet.es).
|
||||
- Oci8 driver for Oracle 8 contributed by George Fourlanos (fou#infomap.gr).
|
||||
- Added _mysqlt_ database driver to support MySQL 3.23 which has transaction support.
|
||||
- Oracle default date format (DD-MON-YY) did not match ADOdb default date format (which is YYYY-MM-DD). Use ALTER SESSION to force the default date.
|
||||
- Error message checking is now included in test suite.
|
||||
- MoveNext() did not check EOF properly -- fixed.
|
||||
|
||||
## 0.60 - 8 Nov 2000
|
||||
|
||||
- Fixed some constructor bugs in ODBC and ADO. Added ErrorNo function to ADOConnection class.
|
||||
|
||||
## 0.51 - 18 Oct 2000
|
||||
|
||||
- Fixed some interbase bugs.
|
||||
|
||||
## 0.50 - 16 Oct 2000
|
||||
|
||||
- Interbase commit/rollback changed to be compatible with PHP 4.03\.
|
||||
- CommitTrans( ) will now return true if transactions not supported.
|
||||
- Conversely RollbackTrans( ) will return false if transactions not supported.
|
||||
|
||||
## 0.46 - 12 Oct 2000
|
||||
|
||||
- Many Oracle compatibility issues fixed.
|
||||
|
||||
## 0.40 - 26 Sept 2000
|
||||
|
||||
- Many bug fixes
|
||||
- Now Code for BeginTrans, CommitTrans and RollbackTrans is working. So is the Affected_Rows and Insert_ID. Added above functions to test.php.
|
||||
- ADO type handling was busted in 0.30\. Fixed.
|
||||
- Generalised Move( ) so it works will all databases, including ODBC.
|
||||
|
||||
## 0.30 - 18 Sept 2000
|
||||
|
||||
- Renamed ADOLoadDB to ADOLoadCode. This is clearer.
|
||||
- Added BeginTrans, CommitTrans and RollbackTrans functions.
|
||||
- Added Affected_Rows() and Insert_ID(), _affectedrows() and _insertID(), ListTables(), ListDatabases(), ListColumns().
|
||||
- Need to add New_ID() and hasInsertID and hasAffectedRows, autoCommit
|
||||
|
||||
## 0.20 - 12 Sept 2000
|
||||
|
||||
- Added support for Microsoft's ADO.
|
||||
- Added new field to ADORecordSet -- canSeek
|
||||
- Added new parameter to _fetch($ignore_fields = false). Setting to true will not update fields array for faster performance.
|
||||
- Added new field to ADORecordSet/ADOConnection -- dataProvider to indicate whether a class is derived from odbc or ado.
|
||||
- Changed class ODBCFieldObject to ADOFieldObject -- not documented currently.
|
||||
- Added benchmark.php and testdatabases.inc.php to the test suite.
|
||||
- Added to ADORecordSet FastForward( ) for future high speed scrolling. Not documented.
|
||||
- Realised that ADO's Move( ) uses relative positioning. ADOdb uses absolute.
|
||||
|
||||
## 0.10 - 9 Sept 2000
|
||||
|
||||
- First release
|
||||
242
include/limesurvey/classes/adodb/docs/changelog_v3.x.md
Normal file
242
include/limesurvey/classes/adodb/docs/changelog_v3.x.md
Normal file
@@ -0,0 +1,242 @@
|
||||
# ADOdb old Changelog - v3.x
|
||||
|
||||
See the [Current Changelog](changelog.md).
|
||||
Older changelogs:
|
||||
[v2.x](changelog_v2.x.md).
|
||||
|
||||
|
||||
## 3.94 - 11 Oct 2003
|
||||
|
||||
- Create trigger in datadict-oci8.inc.php did not work, because all cr/lf's must be removed.
|
||||
- ErrorMsg()/ErrorNo() did not work for many databases when logging enabled. Fixed.
|
||||
- Removed global variable $ADODB_LOGSQL as it does not work properly with multiple connections.
|
||||
- Added SQLDate support for sybase. Thx to Chris Phillipson
|
||||
- Postgresql checking of pgsql resultset resource was incorrect. Fix by Bharat Mediratta bharat#menalto.com. Same patch applied to _insertid and _affectedrows for adodb-postgres64.inc.php.
|
||||
- Added support for NConnect for postgresql.
|
||||
- Added Sybase data dict support. Thx to Chris Phillipson
|
||||
- Extensive improvements in $perf->UI(), eg. Explain now opens in new window, we show scripts which call sql, etc.
|
||||
- Perf Monitor UI works with magic quotes enabled.
|
||||
- rsPrefix was declared twice. Removed.
|
||||
- Oci8 stored procedure support, eg. "begin func(); end;" was incorrect in _query. Fixed.
|
||||
- Tiraboschi Massimiliano contributed italian language file.
|
||||
- Fernando Ortiz, fortiz#lacorona.com.mx, contributed informix performance monitor.
|
||||
- Added _varchar (varchar arrays) support for postgresql. Reported by PREVOT Stéphane.
|
||||
|
||||
|
||||
## 3.92 - 22 Sept 2003
|
||||
|
||||
- Added GetAssoc and CacheGetAssoc to connection object.
|
||||
- Removed TextMax and CharMax functions from adodb.inc.php.
|
||||
- HasFailedTrans() returned false when trans failed. Fixed.
|
||||
- Moved perf driver classes into adodb/perf/*.php.
|
||||
- Misc improvements to performance monitoring, including UI().
|
||||
- RETVAL in mssql Parameter(), we do not append @ now.
|
||||
- Added Param($name) to connection class, returns '?' or ":$name", for defining bind parameters portably.
|
||||
- LogSQL traps affected_rows() and saves its value properly now. Also fixed oci8 _stmt and _affectedrows() bugs.
|
||||
- Session code timestamp check for oci8 works now. Formerly default NLS_DATE_FORMAT stripped off time portion. Thx to Tony Blair (tonanbarbarian#hotmail.com). Also added new $conn->datetime field to oci8, controls whether MetaType() returns 'D' ($this->datetime==false) or 'T' ($this->datetime == true) for DATE type.
|
||||
- Fixed bugs in adodb-cryptsession.inc.php and adodb-session-clob.inc.php.
|
||||
- Fixed misc bugs in adodb_key_exists, GetInsertSQL() and GetUpdateSQL().
|
||||
- Tuned include_once handling to reduce file-system checking overhead.
|
||||
|
||||
## 3.91 - 9 Sept 2003
|
||||
|
||||
- Only released to InterAkt
|
||||
- Added LogSQL() for sql logging and $ADODB_NEWCONNECTION to override factory for driver instantiation.
|
||||
- Added IfNull($field,$ifNull) function, thx to johnwilk#juno.com
|
||||
- Added portable substr support.
|
||||
- Now rs2html() has new parameter, $echo. Set to false to return $html instead of echoing it.
|
||||
|
||||
## 3.90 - 5 Sept 2003
|
||||
|
||||
- First beta of performance monitoring released.
|
||||
- MySQL supports MetaTable() masking.
|
||||
- Fixed key_exists() bug in adodb-lib.inc.php
|
||||
- Added sp_executesql Prepare() support to mssql.
|
||||
- Added bind support to db2.
|
||||
- Added swedish language file - Christian Tiberg" christian#commsoft.nu
|
||||
- Bug in drop index for mssql data dict fixed. Thx to Gert-Rainer Bitterlich.
|
||||
- Left join setting for oci8 was wrong. Thx to johnwilk#juno.com
|
||||
|
||||
## 3.80 - 27 Aug 2003
|
||||
|
||||
- Patch for PHP 4.3.3 cached recordset csv2rs() fread loop incompatibility.
|
||||
- Added matching mask for MetaTables. Only for oci8, mssql and postgres currently.
|
||||
- Rewrite of "oracle" driver connection code, merging with "oci8", by Gaetano.
|
||||
- Added better debugging for Smart Transactions.
|
||||
- Postgres DBTimeStamp() was wrongly using TO_DATE. Changed to TO_TIMESTAMP.
|
||||
- ADODB_FETCH_CASE check pushed to ADONewConnection to allow people to define it after including adodb.inc.php.
|
||||
- Added portugese (brazilian) to languages. Thx to "Levi Fukumori".
|
||||
- Removed arg3 parameter from Execute/SelectLimit/Cache* functions.
|
||||
- Execute() now accepts 2-d array as $inputarray. Also changed docs of fnExecute() to note change in sql query counting with 2-d arrays.
|
||||
- Added MONEY to MetaType in PostgreSQL.
|
||||
- Added more debugging output to CacheFlush().
|
||||
|
||||
## 3.72 - 9 Aug 2003
|
||||
|
||||
- Added qmagic($str), which is a qstr($str) that auto-checks for magic quotes and does the right thing...
|
||||
- Fixed CacheFlush() bug - Thx to martin#gmx.de
|
||||
- Walt Boring contributed MetaForeignKeys for postgres7.
|
||||
- _fetch() called _BlobDecode() wrongly in interbase. Fixed.
|
||||
- adodb_time bug fixed with dates after 2038 fixed by Jason Pell. http://phplens.com/lens/lensforum/msgs.php?id=6980
|
||||
|
||||
## 3.71 - 4 Aug 2003
|
||||
|
||||
- The oci8 driver, MetaPrimaryKeys() did not check the owner correctly when $owner == false.
|
||||
- Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru.
|
||||
- Spanish language file contributed by "Horacio Degiorgi" horaciod#codigophp.com.
|
||||
- Error handling in oci8 bugfix - if there was an error in Execute(), then when calling ErrorNo() and/or ErrorMsg(), the 1st call would return the error, but the 2nd call would return no error.
|
||||
- Error handling in odbc bugfix. ODBC would always return the last error, even if it happened 5 queries ago. Now we reset the errormsg to '' and errorno to 0 everytime before CacheExecute() and Execute().
|
||||
|
||||
## 3.70 - 29 July 2003
|
||||
|
||||
- Added new SQLite driver. Tested on PHP 4.3 and PHP 5.
|
||||
- Added limited "sapdb" driver support - mainly date support.
|
||||
- The oci8 driver did not identify NUMBER with no defined precision correctly.
|
||||
- Added ADODB_FORCE_NULLS, if set, then PHP nulls are converted to SQL nulls in GetInsertSQL/GetUpdateSQL.
|
||||
- DBDate() and DBTimeStamp() format for postgresql had problems. Fixed.
|
||||
- Added tableoptions to ChangeTableSQL(). Thx to Mike Benoit.
|
||||
- Added charset support to postgresql. Thx to Julian Tarkhanov.
|
||||
- Changed OS check for MS-Windows to prevent confusion with darWIN (MacOS)
|
||||
- Timestamp format for db2 was wrong. Changed to yyyy-mm-dd-hh.mm.ss.nnnnnn.
|
||||
- adodb-cryptsession.php includes wrong. Fixed.
|
||||
- Added MetaForeignKeys(). Supported by mssql, odbc_mssql and oci8.
|
||||
- Fixed some oci8 MetaColumns/MetaPrimaryKeys bugs. Thx to Walt Boring.
|
||||
- adodb_getcount() did not init qryRecs to 0\. Missing "WHERE" clause checking in GetUpdateSQL fixed. Thx to Sebastiaan van Stijn.
|
||||
- Added support for only 'VIEWS' and "TABLES" in MetaTables. From Walt Boring.
|
||||
- Upgraded to adodb-xmlschema.inc.php 0.0.2.
|
||||
- NConnect for mysql now returns value. Thx to Dennis Verspuij.
|
||||
- ADODB_FETCH_BOTH support added to interbase/firebird.
|
||||
- Czech language file contributed by Kamil Jakubovic jake#host.sk.
|
||||
- PostgreSQL BlobDecode did not use _connectionID properly. Thx to Juraj Chlebec.
|
||||
- Added some new initialization stuff for Informix. Thx to "Andrea Pinnisi" pinnisi#sysnet.it
|
||||
- ADODB_ASSOC_CASE constant wrong in sybase _fetch(). Fixed.
|
||||
|
||||
## 3.60 - 16 June 2003
|
||||
|
||||
- We now SET CONCAT_NULL_YIELDS_NULL OFF for odbc_mssql driver to be compat with mssql driver.
|
||||
- The property $emptyDate missing from connection class. Also changed 1903 to constant (TIMESTAMP_FIRST_YEAR=100). Thx to Sebastiaan van Stijn.
|
||||
- ADOdb speedup optimization - we now return all arrays by reference.
|
||||
- Now DBDate() and DBTimeStamp() now accepts the string 'null' as a parameter. Suggested by vincent.
|
||||
- Added GetArray() to connection class.
|
||||
- Added not_null check in informix metacolumns().
|
||||
- Connection parameters for postgresql did not work correctly when port was defined.
|
||||
- DB2 is now a tested driver, making adodb 100% compatible. Extensive changes to odbc driver for DB2, including implementing serverinfo() and SQLDate(), switching to SQL_CUR_USE_ODBC as the cursor mode, and lastAffectedRows and SelectLimit() fixes.
|
||||
- The odbc driver's FetchField() field names did not obey ADODB_ASSOC_CASE. Fixed.
|
||||
- Some bugs in adodb_backtrace() fixed.
|
||||
- Added "INT IDENTITY" type to adorecordset::MetaType() to support odbc_mssql properly.
|
||||
- MetaColumns() for oci8, mssql, odbc revised to support scale. Also minor revisions to odbc MetaColumns() for vfp and db2 compat.
|
||||
- Added unsigned support to mysql datadict class. Thx to iamsure.
|
||||
- Infinite loop in mssql MoveNext() fixed when ADODB_FETCH_ASSOC used. Thx to Josh R, Night_Wulfe#hotmail.com.
|
||||
- ChangeTableSQL contributed by Florian Buzin.
|
||||
- The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with mssql driver.
|
||||
|
||||
## 3.50 - 19 May 2003
|
||||
|
||||
- Fixed mssql compat with FreeTDS. FreeTDS does not implement mssql_fetch_assoc().
|
||||
- Merged back connection and recordset code into adodb.inc.php.
|
||||
- ADOdb sessions using oracle clobs contributed by achim.gosse#ddd.de. See adodb-session-clob.php.
|
||||
- Added /s modifier to preg_match everywhere, which ensures that regex does not stop at /n. Thx Pao-Hsi Huang.
|
||||
- Fixed error in metacolumns() for mssql.
|
||||
- Added time format support for SQLDate.
|
||||
- Image => B added to metatype.
|
||||
- MetaType now checks empty($this->blobSize) instead of empty($this).
|
||||
- Datadict has beta support for informix, sybase (mapped to mssql), db2 and generic (which is a fudge).
|
||||
- BlobEncode for postgresql uses pg_escape_bytea, if available. Needed for compat with 7.3.
|
||||
- Added $ADODB_LANG, to support multiple languages in MetaErrorMsg().
|
||||
- Datadict can now parse table definition as declarative text.
|
||||
- For DataDict, oci8 autoincrement trigger missing semi-colon. Fixed.
|
||||
- For DataDict, when REPLACE flag enabled, drop sequence in datadict for autoincrement field in postgres and oci8.s
|
||||
- Postgresql defaults to template1 database if no database defined in connect/pconnect.
|
||||
- We now clear _resultid in postgresql if query fails.
|
||||
|
||||
## 3.40 - 19 May 2003
|
||||
|
||||
- Added insert_id for odbc_mssql.
|
||||
- Modified postgresql UpdateBlobFile() because it did not work in safe mode.
|
||||
- Now connection object is passed to raiseErrorFn as last parameter. Needed by StartTrans().
|
||||
- Added StartTrans() and CompleteTrans(). It is recommended that you do not modify transOff, but use the above functions.
|
||||
- oci8po now obeys ADODB_ASSOC_CASE settings.
|
||||
- Added virtualized error codes, using PEAR DB equivalents. Requires you to manually include adodb-error.inc.php yourself, with MetaError() and MetaErrorMsg($errno).
|
||||
- GetRowAssoc for mysql and pgsql were flawed. Fix by Ross Smith.
|
||||
- Added to datadict types I1, I2, I4 and I8\. Changed datadict type 'T' to map to timestamp instead of datetime for postgresql.
|
||||
- Error handling in ExecuteSQLArray(), adodb-datadict.inc.php did not work.
|
||||
- We now auto-quote postgresql connection parameters when building connection string.
|
||||
- Added session expiry notification.
|
||||
- We now test with odbc mysql - made some changes to odbc recordset constructor.
|
||||
- MetaColumns now special cases access and other databases for odbc.
|
||||
|
||||
## 3.31 - 17 March 2003
|
||||
|
||||
- Added row checking for _fetch in postgres.
|
||||
- Added Interval type to MetaType for postgres.
|
||||
- Remapped postgres driver to call postgres7 driver internally.
|
||||
- Adorecordset_array::getarray() did not return array when nRows >= 0.
|
||||
- Postgresql: at times, no error message returned by pg_result_error() but error message returned in pg_last_error(). Recoded again.
|
||||
- Interbase blob's now use chunking for updateblob.
|
||||
- Move() did not set EOF correctly. Reported by Jorma T.
|
||||
- We properly support mysql timestamp fields when we are creating mysql tables using the data-dict interface.
|
||||
- Table regex includes backticks character now.
|
||||
|
||||
## 3.30 - 3 March 2003
|
||||
|
||||
- Added $ADODB_EXTENSION and $ADODB_COMPAT_FETCH constant.
|
||||
- Made blank1stItem configurable using syntax "value:text" in GetMenu/GetMenu2. Thx to Gabriel Birke.
|
||||
- Previously ADOdb differed from the Microsoft standard because it did not define what to set $this->fields when EOF was reached. Now at EOF, ADOdb sets $this->fields to false for all databases, which is consist with Microsoft's implementation. Postgresql and mysql have always worked this way (in 3.11 and earlier). If you are experiencing compatibility problems (and you are not using postgresql nor mysql) on upgrading to 3.30, try setting the global variables $ADODB_COUNTRECS = true (which is the default) and $ADODB_FETCH_COMPAT = true (this is a new global variable).
|
||||
- We now check both pg_result_error and pg_last_error as sometimes pg_result_error does not display anything. Iman Mayes
|
||||
- We no longer check for magic quotes gpc in Quote().
|
||||
- Misc fixes for table creation in adodb-datadict.inc.php. Thx to iamsure.
|
||||
- Time calculations use adodb_time library for all negative timestamps due to problems in Red Hat 7.3 or later. Formerly, only did this for Windows.
|
||||
- In mssqlpo, we now check if $sql in _query is a string before we change || to +. This is to support prepared stmts.
|
||||
- Move() and MoveLast() internals changed to support to support EOF and $this->fields change.
|
||||
- Added ADODB_FETCH_BOTH support to mssql. Thx to Angel Fradejas afradejas#mediafusion.es
|
||||
- We now check if link resource exists before we run mysql_escape_string in qstr().
|
||||
- Before we flock in csv code, we check that it is not a http url.
|
||||
|
||||
## 3.20 - 17 Feb 2003
|
||||
|
||||
- Added new Data Dictionary classes for creating tables and indexes. Warning - this is very much alpha quality code. The API can still change. See adodb/tests/test-datadict.php for more info.
|
||||
- We now ignore $ADODB_COUNTRECS for mysql, because PHP truncates incomplete recordsets when mysql_unbuffered_query() is called a second time.
|
||||
- Now postgresql works correctly when $ADODB_COUNTRECS = false.
|
||||
- Changed _adodb_getcount to properly support SELECT DISTINCT.
|
||||
- Discovered that $ADODB_COUNTRECS=true has some problems with prepared queries - suspect PHP bug.
|
||||
- Now GetOne and GetRow run in $ADODB_COUNTRECS=false mode for better performance.
|
||||
- Added support for mysql_real_escape_string() and pg_escape_string() in qstr().
|
||||
- Added an intermediate variable for mysql _fetch() and MoveNext() to store fields, to prevent overwriting field array with boolean when mysql_fetch_array() returns false.
|
||||
- Made arrays for getinsertsql and getupdatesql case-insensitive. Suggested by Tim Uckun" tim#diligence.com
|
||||
|
||||
## 3.11 - 11 Feb 2003
|
||||
|
||||
- Added check for ADODB_NEVER_PERSIST constant in PConnect(). If defined, then PConnect() will actually call non-persistent Connect().
|
||||
- Modified interbase to properly work with Prepare().
|
||||
- Added $this->ibase_timefmt to allow you to change the date and time format.
|
||||
- Added support for $input_array parameter in CacheFlush().
|
||||
- Added experimental support for dbx, which was then removed when i found that it was slower than using native calls.
|
||||
- Added MetaPrimaryKeys for mssql and ibase/firebird.
|
||||
- Added new $trim parameter to GetCol and CacheGetCol
|
||||
- Uses updated adodb-time.inc.php 0.06.
|
||||
|
||||
## 3.10 - 27 Jan 2003
|
||||
|
||||
- Added adodb_date(), adodb_getdate(), adodb_mktime() and adodb-time.inc.php.
|
||||
- For interbase, added code to handle unlimited number of bind parameters. From Daniel Hasan daniel#hasan.cl.
|
||||
- Added BlobDecode and UpdateBlob for informix. Thx to Fernando Ortiz.
|
||||
- Added constant ADODB_WINDOWS. If defined, means that running on Windows.
|
||||
- Added constant ADODB_PHPVER which stores php version as a hex num. Removed $ADODB_PHPVER variable.
|
||||
- Felho Bacsi reported a minor white-space regular expression problem in GetInsertSQL.
|
||||
- Modified ADO to use variant to store _affectedRows
|
||||
- Changed ibase to use base class Replace(). Modified base class Replace() to support ibase.
|
||||
- Changed odbc to auto-detect when 0 records returned is wrong due to bad odbc drivers.
|
||||
- Changed mssql to use datetimeconvert ini setting only when 4.30 or later (does not work in 4.23).
|
||||
- ExecuteCursor($stmt, $cursorname, $params) now accepts a new $params array of additional bind parameters -- William Lovaton walovaton#yahoo.com.mx.
|
||||
- Added support for sybase_unbuffered_query if ADODB_COUNTRECS == false. Thx to chuck may.
|
||||
- Fixed FetchNextObj() bug. Thx to Jorma Tuomainen.
|
||||
- We now use SCOPE_IDENTITY() instead of @@IDENTITY for mssql - thx to marchesini#eside.it
|
||||
- Changed postgresql movenext logic to prevent illegal row number from being passed to pg_fetch_array().
|
||||
- Postgresql initrs bug found by "Bogdan RIPA" bripa#interakt.ro $f1 accidentally named $f
|
||||
|
||||
## 3.00 - 6 Jan 2003
|
||||
|
||||
- Fixed adodb-pear.inc.php syntax error.
|
||||
- Improved _adodb_getcount() to use SELECT COUNT(*) FROM ($sql) for languages that accept it.
|
||||
- Fixed _adodb_getcount() caching error.
|
||||
- Added sql to retrive table and column info for odbc_mssql.
|
||||
109
include/limesurvey/classes/adodb/docs/changelog_v4+5.md
Normal file
109
include/limesurvey/classes/adodb/docs/changelog_v4+5.md
Normal file
@@ -0,0 +1,109 @@
|
||||
## 4.990/5.05 - 11 Jul 2008
|
||||
|
||||
- Added support for multiple recordsets in mysqli Geisel Sierote <geisel#4up.com.br>. See http://phplens.com/lens/lensforum/msgs.php?id=15917
|
||||
- Malcolm Cook added new Reload() function to Active Record. See http://phplens.com/lens/lensforum/msgs.php?id=17474
|
||||
- Thanks Zoltan Monori [monzol#fotoprizma.hu] for bug fixes in iterator, SelectLimit, GetRandRow, etc.
|
||||
- Under heavy loads, the performance monitor for oci8 disables Ixora views.
|
||||
- Fixed sybase driver SQLDate to use str_replace(). Also for adodb5, changed sybase driver UnixDate and UnixTimeStamp calls to static.
|
||||
- Changed oci8 lob handler to use & reference $this->_refLOBs[$numlob]['VAR'] = &$var.
|
||||
- We now strtolower the get_class() function in PEAR::isError() for php5 compat.
|
||||
- CacheExecute did not retrieve cache recordsets properly for 5.04 (worked in 4.98). Fixed.
|
||||
- New ADODB_Cache_File class for file caching defined in adodb.inc.php.
|
||||
- Farsi language file contribution by Peyman Hooshmandi Raad (phooshmand#gmail.com)
|
||||
- New API for creating your custom caching class which is stored in $ADODB_CACHE:
|
||||
```
|
||||
include "/path/to/adodb.inc.php";
|
||||
$ADODB_CACHE_CLASS = 'MyCacheClass';
|
||||
|
||||
class MyCacheClass extends ADODB_Cache_File
|
||||
{
|
||||
function writecache($filename, $contents,$debug=false){...}
|
||||
function &readcache($filename, &$err, $secs2cache, $rsClass){ ...}
|
||||
:
|
||||
}
|
||||
|
||||
$DB = NewADOConnection($driver);
|
||||
$DB->Connect(...); ## MyCacheClass created here and stored in $ADODB_CACHE global variable.
|
||||
|
||||
$data = $rs->CacheGetOne($sql); ## MyCacheClass is used here for caching...
|
||||
```
|
||||
- Memcache supports multiple pooled hosts now. Only if none of the pooled servers can be contacted will a connect error be generated. Usage example below:
|
||||
```
|
||||
$db = NewADOConnection($driver);
|
||||
$db->memCache = true; /// should we use memCache instead of caching in files
|
||||
$db->memCacheHost = array($ip1, $ip2, $ip3); /// $db->memCacheHost = $ip1; still works
|
||||
$db->memCachePort = 11211; /// this is default memCache port
|
||||
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
|
||||
|
||||
$db->Connect(...);
|
||||
$db->CacheExecute($sql);
|
||||
```
|
||||
|
||||
## 4.98/5.04 - 13 Feb 2008
|
||||
|
||||
- Fixed adodb_mktime problem which causes a performance bottleneck in $hrs.
|
||||
- Added mysqli support to adodb_getcount().
|
||||
- Removed MYSQLI_TYPE_CHAR from MetaType().
|
||||
|
||||
## 4.97/5.03 - 22 Jan 2008
|
||||
|
||||
- Active Record: $ADODB_ASSOC_CASE=1 did not work properly. Fixed.
|
||||
- Modified Fields() in recordset class to support display null fields in FetchNextObject().
|
||||
- In ADOdb5, active record implementation, we now support column names with spaces in them - we autoconvert the spaces to _ using __set(). Thx Daniel Cook. http://phplens.com/lens/lensforum/msgs.php?id=17200
|
||||
- Removed $arg3 from mysqli SelectLimit. See http://phplens.com/lens/lensforum/msgs.php?id=16243. Thx Zsolt Szeberenyi.
|
||||
- Changed oci8 FetchField, which returns the max_length of BLOB/CLOB/NCLOB as 4000 (incorrectly) to -1.
|
||||
- CacheExecute would sometimes return an error on Windows if it was unable to lock the cache file. This is harmless and has been changed to a warning that can be ignored. Also adodb_write_file() code revised.
|
||||
- ADOdb perf code changed to only log sql if execution time >= 0.05 seconds. New $ADODB_PERF_MIN variable holds min sql timing. Any SQL with timing value below this and is not causing an error is not logged.
|
||||
- Also adodb_backtrace() now traces 1 level deeper as sometimes actual culprit function is not displayed.
|
||||
- Fixed a group by problem with adodb_getcount() for db's which are not postgres/oci8 based.
|
||||
- Changed mssql driver Parameter() from SQLCHAR to SQLVARCHAR: case 'string': $type = SQLVARCHAR; break.
|
||||
- Problem with mssql driver in php5 (for adodb 5.03) because some functions are not static. Fixed.
|
||||
|
||||
## 4.96/5.02 - 24 Sept 2007
|
||||
|
||||
ADOdb perf for oci8 now has non-table-locking code when clearing the sql. Slower but better transparency. Added in 4.96a and 5.02a.
|
||||
Fix adodb count optimisation. Preg_match did not work properly. Also rewrote the ORDER BY stripping code in _adodb_getcount(), adodb-lib.inc.php.
|
||||
SelectLimit for oci8 not optimal for large recordsets when offset=0. Changed $nrows check.
|
||||
Active record optimizations. Added support for assoc arrays in Set().
|
||||
Now GetOne returns null if EOF (no records found), and false if error occurs. Use ErrorMsg()/ErrorNo() to get the error.
|
||||
Also CacheGetRow and CacheGetCol will return false if error occurs, or empty array() if EOF, just like GetRow and GetCol.
|
||||
Datadict now allows changing of types which are not resizable, eg. VARCHAR to TEXT in ChangeTableSQL. -- Mateo Tibaquirá
|
||||
Added BIT data type support to adodb-ado.inc.php and adodb-ado5.inc.php.
|
||||
Ldap driver did not return actual ldap error messages. Fixed.
|
||||
Implemented GetRandRow($sql, $inputarr). Optimized for Oci8.
|
||||
Changed adodb5 active record to use static SetDatabaseAdapter() and removed php4 constructor. Bas van Beek bas.vanbeek#gmail.com.
|
||||
Also in adodb5, changed adodb-session2 to use static function declarations in class. Thx Daniel Berlin.
|
||||
Added "Clear SQL Log" to bottom of Performance screen.
|
||||
Sessions2 code echo'ed directly to the screen in debug mode. Now uses ADOConnection::outp().
|
||||
In mysql/mysqli, qstr(null) will return the string "null" instead of empty quoted string "''".
|
||||
postgresql optimizeTable in perf-postgres.inc.php added by Daniel Berlin (mail#daniel-berlin.de)
|
||||
Added 5.2.1 compat code for oci8.
|
||||
Changed @@identity to SCOPE_IDENTITY() for multiple mssql drivers. Thx Stefano Nari.
|
||||
Code sanitization introduced in 4.95 caused problems in European locales (as float 3.2 was typecast to 3,2). Now we only sanitize if is_numeric fails.
|
||||
Added support for customizing ADORecordset_empty using $this->rsPrefix.'empty'. By Josh Truwin.
|
||||
Added proper support for ALterColumnSQL for Postgresql in datadict code. Thx. Josh Truwin.
|
||||
Added better support for MetaType() in mysqli when using an array recordset.
|
||||
Changed parser for pgsql error messages in adodb-error.inc.php to case-insensitive regex.
|
||||
|
||||
## 4.95/5.01 - 17 May 2007
|
||||
|
||||
CacheFlush debug outp() passed in invalid parameters. Fixed.
|
||||
Added Thai language file for adodb. Thx Trirat Petchsingh rosskouk#gmail.com
|
||||
and Marcos Pont
|
||||
Added zerofill checking support to MetaColumns for mysql and mysqli.
|
||||
CacheFlush no longer deletes all files/directories. Only *.cache files
|
||||
deleted.
|
||||
DB2 timestamp format changed to var $fmtTimeStamp =
|
||||
"'Y-m-d-H:i:s'";
|
||||
Added some code sanitization to AutoExecute in adodb-lib.inc.php.
|
||||
Due to typo, all connections in adodb-oracle.inc.php would become
|
||||
persistent, even non-persistent ones. Fixed.
|
||||
Oci8 DBTimeStamp uses 24 hour time for input now, so you can perform string
|
||||
comparisons between 2 DBTimeStamp values.
|
||||
Some PHP4.4 compat issues fixed in adodb-session2.inc.php
|
||||
For ADOdb 5.01, fixed some adodb-datadict.inc.php MetaType compat issues
|
||||
with PHP5.
|
||||
The $argHostname was wiped out in adodb-ado5.inc.php. Fixed.
|
||||
Adodb5 version, added iterator support for adodb_recordset_empty.
|
||||
Adodb5 version,more error checking code now will use exceptions if
|
||||
available.
|
||||
722
include/limesurvey/classes/adodb/docs/changelog_v4.x.md
Normal file
722
include/limesurvey/classes/adodb/docs/changelog_v4.x.md
Normal file
@@ -0,0 +1,722 @@
|
||||
# ADOdb old Changelog - v4.x
|
||||
|
||||
See the [Current Changelog](changelog.md).
|
||||
Older changelogs:
|
||||
[v3.x](changelog_v3.x.md),
|
||||
[v2.x](changelog_v2.x.md).
|
||||
|
||||
|
||||
## 4.990 - 11 Jul 2008
|
||||
|
||||
- Added support for multiple recordsets in mysqli Geisel Sierote <geisel#4up.com.br>. See http://phplens.com/lens/lensforum/msgs.php?id=15917
|
||||
- Malcolm Cook added new Reload() function to Active Record. See http://phplens.com/lens/lensforum/msgs.php?id=17474
|
||||
- Thanks Zoltan Monori [monzol#fotoprizma.hu] for bug fixes in iterator, SelectLimit, GetRandRow, etc.
|
||||
- Under heavy loads, the performance monitor for oci8 disables Ixora views.
|
||||
- Fixed sybase driver SQLDate to use str_replace(). Also for adodb5, changed sybase driver UnixDate and UnixTimeStamp calls to static.
|
||||
- Changed oci8 lob handler to use & reference $this->_refLOBs[$numlob]['VAR'] = &$var.
|
||||
- We now strtolower the get_class() function in PEAR::isError() for php5 compat.
|
||||
- CacheExecute did not retrieve cache recordsets properly for 5.04 (worked in 4.98). Fixed.
|
||||
- New ADODB_Cache_File class for file caching defined in adodb.inc.php.
|
||||
- Farsi language file contribution by Peyman Hooshmandi Raad (phooshmand#gmail.com)
|
||||
- New API for creating your custom caching class which is stored in $ADODB_CACHE:
|
||||
```
|
||||
include "/path/to/adodb.inc.php";
|
||||
$ADODB_CACHE_CLASS = 'MyCacheClass';
|
||||
|
||||
class MyCacheClass extends ADODB_Cache_File
|
||||
{
|
||||
function writecache($filename, $contents,$debug=false){...}
|
||||
function &readcache($filename, &$err, $secs2cache, $rsClass){ ...}
|
||||
:
|
||||
}
|
||||
|
||||
$DB = NewADOConnection($driver);
|
||||
$DB->Connect(...); ## MyCacheClass created here and stored in $ADODB_CACHE global variable.
|
||||
|
||||
$data = $rs->CacheGetOne($sql); ## MyCacheClass is used here for caching...
|
||||
```
|
||||
- Memcache supports multiple pooled hosts now. Only if none of the pooled servers can be contacted will a connect error be generated. Usage example below:
|
||||
```
|
||||
$db = NewADOConnection($driver);
|
||||
$db->memCache = true; /// should we use memCache instead of caching in files
|
||||
$db->memCacheHost = array($ip1, $ip2, $ip3); /// $db->memCacheHost = $ip1; still works
|
||||
$db->memCachePort = 11211; /// this is default memCache port
|
||||
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
|
||||
|
||||
$db->Connect(...);
|
||||
$db->CacheExecute($sql);
|
||||
```
|
||||
|
||||
## 4.98 - 13 Feb 2008
|
||||
|
||||
- Fixed adodb_mktime problem which causes a performance bottleneck in $hrs.
|
||||
- Added mysqli support to adodb_getcount().
|
||||
- Removed MYSQLI_TYPE_CHAR from MetaType().
|
||||
|
||||
## 4.97 - 22 Jan 2008
|
||||
|
||||
- Active Record: $ADODB_ASSOC_CASE=1 did not work properly. Fixed.
|
||||
- Modified Fields() in recordset class to support display null fields in FetchNextObject().
|
||||
- In ADOdb5, active record implementation, we now support column names with spaces in them - we autoconvert the spaces to `_` using `__set()`. Thx Daniel Cook. http://phplens.com/lens/lensforum/msgs.php?id=17200
|
||||
- Removed $arg3 from mysqli SelectLimit. See http://phplens.com/lens/lensforum/msgs.php?id=16243. Thx Zsolt Szeberenyi.
|
||||
- Changed oci8 FetchField, which returns the max_length of BLOB/CLOB/NCLOB as 4000 (incorrectly) to -1.
|
||||
- CacheExecute would sometimes return an error on Windows if it was unable to lock the cache file. This is harmless and has been changed to a warning that can be ignored. Also adodb_write_file() code revised.
|
||||
- ADOdb perf code changed to only log sql if execution time >= 0.05 seconds. New $ADODB_PERF_MIN variable holds min sql timing. Any SQL with timing value below this and is not causing an error is not logged.
|
||||
- Also adodb_backtrace() now traces 1 level deeper as sometimes actual culprit function is not displayed.
|
||||
- Fixed a group by problem with adodb_getcount() for db's which are not postgres/oci8 based.
|
||||
- Changed mssql driver Parameter() from SQLCHAR to SQLVARCHAR: case 'string': $type = SQLVARCHAR; break.
|
||||
- Problem with mssql driver in php5 (for adodb 5.03) because some functions are not static. Fixed.
|
||||
|
||||
## 4.96 - 24 Sept 2007
|
||||
|
||||
- ADOdb perf for oci8 now has non-table-locking code when clearing the sql. Slower but better transparency. Added in 4.96a and 5.02a.
|
||||
- Fix adodb count optimisation. Preg_match did not work properly. Also rewrote the ORDER BY stripping code in _adodb_getcount(), adodb-lib.inc.php.
|
||||
- SelectLimit for oci8 not optimal for large recordsets when offset=0. Changed $nrows check.
|
||||
- Active record optimizations. Added support for assoc arrays in Set().
|
||||
- Now GetOne returns null if EOF (no records found), and false if error occurs. Use ErrorMsg()/ErrorNo() to get the error.
|
||||
- Also CacheGetRow and CacheGetCol will return false if error occurs, or empty array() if EOF, just like GetRow and GetCol.
|
||||
- Datadict now allows changing of types which are not resizable, eg. VARCHAR to TEXT in ChangeTableSQL. -- Mateo Tibaquirá
|
||||
- Added BIT data type support to adodb-ado.inc.php and adodb-ado5.inc.php.
|
||||
- Ldap driver did not return actual ldap error messages. Fixed.
|
||||
- Implemented GetRandRow($sql, $inputarr). Optimized for Oci8.
|
||||
- Changed adodb5 active record to use static SetDatabaseAdapter() and removed php4 constructor. Bas van Beek bas.vanbeek#gmail.com.
|
||||
- Also in adodb5, changed adodb-session2 to use static function declarations in class. Thx Daniel Berlin.
|
||||
- Added "Clear SQL Log" to bottom of Performance screen.
|
||||
- Sessions2 code echo'ed directly to the screen in debug mode. Now uses ADOConnection::outp().
|
||||
- In mysql/mysqli, qstr(null) will return the string "null" instead of empty quoted string "''".
|
||||
- postgresql optimizeTable in perf-postgres.inc.php added by Daniel Berlin (mail#daniel-berlin.de)
|
||||
- Added 5.2.1 compat code for oci8.
|
||||
- Changed @@identity to SCOPE_IDENTITY() for multiple mssql drivers. Thx Stefano Nari.
|
||||
- Code sanitization introduced in 4.95 caused problems in European locales (as float 3.2 was typecast to 3,2). Now we only sanitize if is_numeric fails.
|
||||
- Added support for customizing ADORecordset_empty using $this->rsPrefix.'empty'. By Josh Truwin.
|
||||
- Added proper support for ALterColumnSQL for Postgresql in datadict code. Thx. Josh Truwin.
|
||||
- Added better support for MetaType() in mysqli when using an array recordset.
|
||||
- Changed parser for pgsql error messages in adodb-error.inc.php to case-insensitive regex.
|
||||
|
||||
## 4.95 - 17 May 2007
|
||||
|
||||
- CacheFlush debug outp() passed in invalid parameters. Fixed.
|
||||
- Added Thai language file for adodb. Thx Trirat Petchsingh rosskouk#gmail.com and Marcos Pont
|
||||
- Added zerofill checking support to MetaColumns for mysql and mysqli.
|
||||
- CacheFlush no longer deletes all files directories. Only `*.cache` files deleted.
|
||||
- DB2 timestamp format changed to var $fmtTimeStamp = 'Y-m-d-H:i:s';
|
||||
- Added some code sanitization to AutoExecute in adodb-lib.inc.php.
|
||||
- Due to typo, all connections in adodb-oracle.inc.php would become persistent, even non-persistent ones. Fixed.
|
||||
- Oci8 DBTimeStamp uses 24 hour time for input now, so you can perform string comparisons between 2 DBTimeStamp values.
|
||||
- Some PHP4.4 compat issues fixed in adodb-session2.inc.php
|
||||
- For ADOdb 5.01, fixed some adodb-datadict.inc.php MetaType compat issues with PHP5.
|
||||
- The $argHostname was wiped out in adodb-ado5.inc.php. Fixed.
|
||||
- Adodb5 version, added iterator support for adodb_recordset_empty.
|
||||
- Adodb5 version,more error checking code now will use exceptions if available.
|
||||
|
||||
## 4.94 - 23 Jan 2007
|
||||
|
||||
- Active Record: $ADODB_ASSOC_CASE=2 did not work properly. Fixed. Thx gmane#auxbuss.com.
|
||||
- mysqli had bugs in BeginTrans() and EndTrans(). Fixed.
|
||||
- Improved error handling when no database is connected for oci8. Thx Andy Hassall.
|
||||
- Names longer than 30 chars in oci8 datadict will be changed to random name. Thx Eugenio. http://phplens.com/lens/lensforum/msgs.php?id=16182
|
||||
- Added var $upperCase = 'ucase' to access and ado_access drivers. Thx Renato De Giovanni renato#cria.org.br
|
||||
- Postgres64 driver, if preparing plan failed in _query, did not handle error properly. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=16131.
|
||||
- Fixed GetActiveRecordsClass() reference bug. See http://phplens.com/lens/lensforum/msgs.php?id=16120
|
||||
- Added handling of nulls in adodb-ado_mssql.inc.php for qstr(). Thx to Felix Rabinovich.
|
||||
- Adodb-dict contributions by Gaetano
|
||||
- Support for INDEX in data-dict. Example: idx_ev1. The ability to define indexes using the INDEX keyword was added in ADOdb 4.94. The following example features mutiple indexes, including a compound index idx_ev1.
|
||||
|
||||
```
|
||||
event_id I(11) NOTNULL AUTOINCREMENT PRIMARY,
|
||||
event_type I(4) NOTNULL
|
||||
event_start_date T DEFAULT NULL **INDEX id_esd**,
|
||||
event_end_date T DEFAULT '0000-00-00 00:00:00' **INDEX id_eted**,
|
||||
event_parent I(11) UNSIGNED NOTNULL DEFAULT 0 **INDEX id_evp**,
|
||||
event_owner I(11) DEFAULT 0 **INDEX idx_ev1**,
|
||||
event_project I(11) DEFAULT 0 **INDEX idx_ev1**,
|
||||
event_times_recuring I(11) UNSIGNED NOTNULL DEFAULT 0,
|
||||
event_icon C(20) DEFAULT 'obj/event',
|
||||
event_description X
|
||||
```
|
||||
|
||||
- Prevents the generated SQL from including double drop-sequence statements for REPLACE case of tables with autoincrement columns (on those dbs that emulate it via sequences)
|
||||
- makes any date defined as DEFAULT value for D and T columns work cross-database, not just the "sysdate" value (as long as it is specified using adodb standard format). See above example.
|
||||
- Fixed pdo's GetInsertID() support. Thx Ricky Su.
|
||||
- oci8 Prepare() now sets error messages if an error occurs.
|
||||
- Added 'PT_BR' to SetDateLocale() -- brazilian portugese.
|
||||
- charset in oci8 was not set correctly on `*Connect()`
|
||||
- ADOConnection::Transpose() now appends as first column the field names.
|
||||
- Added $ADODB_QUOTE_FIELDNAMES. If set to true, will autoquote field names in AutoExecute(),GetInsertSQL(), GetUpdateSQL().
|
||||
- Transpose now adds the field names as the first column after transposition.
|
||||
- Added === check in ADODB_SetDatabaseAdapter for $db, adodb-active-record.inc.php. Thx Christian Affolter.
|
||||
- Added ErrorNo() to adodb-active-record.inc.php. Thx ante#novisplet.com.
|
||||
|
||||
## 4.93 - 10 Oct 2006
|
||||
|
||||
- Added support for multiple database connections in performance monitoring code (adodb-perf.inc.php). Now all sql in multiple database connections can be saved into one database ($ADODB_LOG_CONN).
|
||||
- Added MetaIndexes() to odbc_mssql.
|
||||
- Added connection property $db->null2null = 'null'. In autoexecute/getinsertsql/getupdatesql, this value will be converted to a null. Set this to a funny invalid value if you do not want null conversion. See http://phplens.com/lens/lensforum/msgs.php?id=15902.
|
||||
- Path disclosure problem in mysqli fixed. Thx Andy.
|
||||
- Fixed typo in session_schema2.xml.
|
||||
- Changed INT in oci8 to return correct precision in $fld->max_length, MetaColumns(). Thx Eloy Lafuente Plaza.
|
||||
- Patched postgres64 _connect to handle serverinfo(). see http://phplens.com/lens/lensforum/msgs.php?id=15887.
|
||||
- Added pdo fix for null columns. See http://phplens.com/lens/lensforum/msgs.php?id=15889
|
||||
- For stored procedures, missing connection id now passed into mssql_query(). Thx Ecsy (ecsy#freemail.hu).
|
||||
|
||||
## 4.92a - 30 Aug 2006
|
||||
|
||||
- Syntax error in postgres7 driver. Thx Eloy Lafuente Plaza.
|
||||
- Minor bug fixes - adodb informix 10 types added to adodb.inc.php. Thx Fernando Ortiz.
|
||||
|
||||
## 4.92 - 29 Aug 2006
|
||||
|
||||
- Better odbtp date support.
|
||||
- Added IgnoreErrors() to bypass default error handling.
|
||||
- The _adodb_getcount() function in adodb-lib.inc.php, some ORDER BY bug fixes.
|
||||
- For ibase and firebird, set $sysTimeStamp = "CURRENT_TIMESTAMP".
|
||||
- Fixed postgres connection bug: http://phplens.com/lens/lensforum/msgs.php?id=11057.
|
||||
- Changed CacheSelectLimit() to flush cache when $secs2cache==-1 due to complaints from other users.
|
||||
- Added support for using memcached with CacheExecute/CacheSelectLimit. Requires memcache module PECL extension. Usage:
|
||||
```
|
||||
$db = NewADOConnection($driver);
|
||||
$db->memCache = true; /// should we use memCache instead of caching in files
|
||||
$db->memCacheHost = "126.0.1.1"; /// memCache host
|
||||
$db->memCachePort = 11211; /// this is default memCache port
|
||||
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
|
||||
$db->Connect(...);
|
||||
$db->CacheExecute($sql);
|
||||
```
|
||||
|
||||
- Implemented Transpose() for recordsets. Recordset must be retrieved using ADODB_FETCH_NUM. First column becomes the column name.
|
||||
```
|
||||
$db = NewADOConnection('mysql');
|
||||
$db->Connect(...);
|
||||
$db->SetFetchMode(ADODB_FETCH_NUM);
|
||||
$rs = $db->Execute('select productname,productid,unitprice from products limit 10');
|
||||
$rs2 = $db->Transpose($rs);
|
||||
rs2html($rs2);
|
||||
```
|
||||
|
||||
## 4.91 - 2 Aug 2006
|
||||
|
||||
- Major session code rewrite... See session docs.
|
||||
- PDO bindinputarray() was not set properly for MySQL (changed from true to false).
|
||||
- Changed CacheSelectLimit() to re-cache when $secs2cache==0. This is one way to flush the cache when SelectLimit is called.
|
||||
- Added to quotes to mysql and mysqli: "SHOW COLUMNS FROM \`%s\`";
|
||||
- Removed accidental optgroup handling in GetMenu(). Fixed ibase _BlobDecode for php5 compat, and also mem alloc issues for small blobs, thx salvatori#interia.pl
|
||||
- Mysql driver OffsetDate() speedup, useful for adodb-sessions.
|
||||
- Fix for GetAssoc() PHP5 compat. See http://phplens.com/lens/lensforum/msgs.php?id=15425
|
||||
- Active Record - If inserting a record and the value of a primary key field is null, then we do not insert that field in as we assume it is an auto-increment field. Needed by mssql.
|
||||
- Changed postgres7 MetaForeignKeys() see http://phplens.com/lens/lensforum/msgs.php?id=15531
|
||||
- DB2 will now return db2_conn_errormsg() when it is a connection error.
|
||||
|
||||
## 4.90 - 8 June 2006
|
||||
|
||||
- Changed adodb_countrec() in adodb-lib.inc.php to allow LIMIT to be used as a speedup to reduce no of records counted.
|
||||
- Added support for transaction modes for postgres and oci8 with SetTransactionMode(). These transaction modes affect all subsequent transactions of that connection.
|
||||
- Thanks to Halmai Csongor for suggestion.
|
||||
- Removed `$off = $fieldOffset - 1` line in db2 driver, FetchField(). Tx Larry Menard.
|
||||
- Added support for PHP5 objects as Execute() bind parameters using `__toString` (eg. Simple-XML). Thx Carl-Christian Salvesen.
|
||||
- Rounding in tohtml.inc.php did not work properly. Fixed.
|
||||
- MetaIndexes in postgres fails when fields are deleted then added in again because the attnum has gaps in it. See http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976. Fixed.
|
||||
- MetaForeignkeys in mysql and mysqli did not work when fetchMode==ADODB_FETCH_ASSOC used. Fixed.
|
||||
- Reference error in AutoExecute() fixed.
|
||||
- Added macaddr postgres type to MetaType. Maps to 'C'.
|
||||
- Added to `_connect()` in adodb-ado5.inc.php support for $database and $dataProvider parameters. Thx Larry Menard.
|
||||
- Added support for sequences in adodb-ado_mssql.inc.php. Thx Larry Menard.
|
||||
- Added ADODB_SESSION_READONLY.
|
||||
- Added session expiryref support to crc32 mode, and in LOB code.
|
||||
- Clear `_errorMsg` in postgres7 driver, so that ErrorMsg() displays properly when no error occurs.
|
||||
- Added BindDate and BindTimeStamp
|
||||
|
||||
## 4.81 - 3 May 2006
|
||||
|
||||
- Fixed variable ref errors in adodb-ado5.inc.php in _query().
|
||||
- Mysqli setcharset fix using method_exists().
|
||||
- The adodb-perf.inc.php CreateLogTable() code now works for user-defined table names.
|
||||
- Error in ibase_blob_open() fixed. See http://phplens.com/lens/lensforum/msgs.php?id=14997
|
||||
|
||||
## 4.80 - 8 Mar 2006
|
||||
|
||||
- Added activerecord support.
|
||||
- Added mysql `$conn->compat323 = true` if you want MySQL 3.23 compat enabled. Fixes GetOne() Select-Limit problems.
|
||||
- Added adodb-xmlschema03.inc.php to support XML Schema version 3 and updated adodb-datadict.htm docs.
|
||||
- Better memory management in Execute. Thx Mike Fedyk.
|
||||
|
||||
## 4.72 - 21 Feb 2006
|
||||
|
||||
- Added 'new' DSN parameter for NConnect().
|
||||
- Pager now sanitizes $PHP_SELF to protect against XSS. Thx to James Bercegay and others.
|
||||
- ADOConnection::MetaType changed to setup $rs->connection correctly.
|
||||
- New native DB2 driver contributed by Larry Menard, Dan Scott, Andy Staudacher, Bharat Mediratta.
|
||||
- The mssql CreateSequence() did not BEGIN TRANSACTION correctly. Fixed. Thx Sean Lee.
|
||||
- The _adodb_countrecs() function in adodb-lib.inc.php has been revised to handle more ORDER BY variations.
|
||||
|
||||
## 4.71 - 24 Jan 2006
|
||||
|
||||
- Fixes postgresql security issue related to binary strings. Thx to Andy Staudacher.
|
||||
- Several DSN bugs found:
|
||||
1. Fix bugs in DSN connections introduced in 4.70 when underscores are found in the DSN.
|
||||
2. DSN with _ did not work properly in PHP5 (fine in PHP4). Fixed.
|
||||
3. Added support for PDO DSN connections in NewADOConnection(), and database parameter in PDO::Connect().
|
||||
- The oci8 datetime flag not correctly implemented in ADORecordSet_array. Fixed.
|
||||
- Added BlobDelete() to postgres, as a counterpoint to UpdateBlobFile().
|
||||
- Fixed GetInsertSQL() to support oci8po.
|
||||
- Fixed qstr() issue with postgresql with \0 in strings.
|
||||
- Fixed some datadict driver loading issues in _adodb_getdriver().
|
||||
- Added register shutdown function session_write_close in adodb-session.inc.php for PHP 5 compat. See http://phplens.com/lens/lensforum/msgs.php?id=14200.
|
||||
|
||||
## 4.70 - 6 Jan 2006
|
||||
|
||||
- Many fixes from Danila Ulyanov to ibase, oci8, postgres, mssql, odbc_oracle, odbtp, etc drivers.
|
||||
- Changed usage of binary hint in adodb-session.inc.php for mysql. See http://phplens.com/lens/lensforum/msgs.php?id=14160
|
||||
- Fixed invalid variable reference problem in undomq(), adodb-perf.inc.php.
|
||||
- Fixed http://phplens.com/lens/lensforum/msgs.php?id=14254 in adodb-perf.inc.php, `_DBParameter()` settings of fetchmode was wrong.
|
||||
- Fixed security issues in server.php and tmssql.php discussed by Andreas Sandblad in a Secunia security advisory. Added `$ACCEPTIP = 127.0.0.1` and changed suggested root password to something more secure.
|
||||
- Changed pager to close recordset after RenderLayout().
|
||||
|
||||
## 4.68 - 25 Nov 2005
|
||||
|
||||
- PHP 5 compat for mysqli. MetaForeignKeys repeated twice and MYSQLI_BINARY_FLAG missing.
|
||||
- PHP 5.1 support for postgresql bind parameters using ? did not work if >= 10 parameters. Fixed. Thx to Stanislav Shramko.
|
||||
- Lots of PDO improvements.
|
||||
- Spelling error fixed in mysql MetaForeignKeys, $associative parameter.
|
||||
|
||||
## 4.67 - 16 Nov 2005
|
||||
|
||||
- Postgresql not_null flag not set to false correctly. Thx Cristian MARIN.
|
||||
- We now check in Replace() if key is in fieldArray. Thx Sébastien Vanvelthem.
|
||||
- `_file_get_contents()` function was missing in xmlschema. fixed.
|
||||
- Added week in year support to SQLDate(), using 'W' flag. Thx Spider.
|
||||
- In sqlite metacolumns was repeated twice, causing PHP 5 problems. Fixed.
|
||||
- Made debug output XHTML compliant.
|
||||
|
||||
## 4.66 - 28 Sept 2005
|
||||
|
||||
- ExecuteCursor() in oci8 did not clean up properly on failure. Fixed.
|
||||
- Updated xmlschema.dtd, by "Alec Smecher" asmecher#smecher.bc.ca
|
||||
- Hardened SelectLimit, typecasting nrows and offset to integer.
|
||||
- Fixed misc bugs in AutoExecute() and GetInsertSQL().
|
||||
- Added $conn->database as the property holding the database name. The older $conn->databaseName is retained for backward compat.
|
||||
- Changed _adodb_backtrace() compat check to use function_exists().
|
||||
- Bug in postgresql MetaIndexes fixed. Thx Kevin Jamieson.
|
||||
- Improved OffsetDate for MySQL, reducing rounding error.
|
||||
- Metacolumns added to sqlite. Thx Mark Newnham.
|
||||
- PHP 4.4 compat fixes for GetAssoc().
|
||||
- Added postgresql bind support for php 5.1. Thx Cristiano da Cunha Duarte
|
||||
- OffsetDate() fixes for postgresql, typecasting strings to date or timestamp.
|
||||
- DBTimeStamp formats for mssql, odbc_mssql and postgresql made to conform with other db's.
|
||||
- Changed PDO constants from PDO_ to PDO:: to support latest spec.
|
||||
|
||||
## 4.65 - 22 July 2005
|
||||
|
||||
- Reverted 'X' in mssql datadict to 'TEXT' to be compat with mssql driver. However now you can set $datadict->typeX = 'varchar(4000)' or 'TEXT' or 'CLOB' for mssql and oci8 drivers.
|
||||
- Added charset support when using DSN for Oracle.
|
||||
- _adodb_getmenu did not use fieldcount() to get number of fields. Fixed.
|
||||
- MetaForeignKeys() for mysql/mysqli contributed by Juan Carlos Gonzalez.
|
||||
- MetaDatabases() now correctly returns an array for mysqli driver. Thx Cristian MARIN.
|
||||
- CompleteTrans(false) did not return false. Fixed. Thx to JMF.
|
||||
- AutoExecute() did not work with Oracle. Fixed. Thx José Moreira.
|
||||
- MetaType() added to connection object.
|
||||
- More PHP 4.4 reference return fixes. Thx Ryan C Bonham and others.
|
||||
|
||||
## 4.64 - 20 June 2005
|
||||
|
||||
- In datadict, if the default field value is set to '', then it is not applied when the field is created. Fixed by Eugenio.
|
||||
- MetaPrimaryKeys for postgres did not work because of true/false change in 4.63. Fixed.
|
||||
- Tested ocifetchstatement in oci8. Rejected at the end.
|
||||
- Added port to dsn handling. Supported in postgres, mysql, mysqli,ldap.
|
||||
- Added 'w' and 'l' to mysqli SQLDate().
|
||||
- Fixed error handling in ldap _connect() to be more consistent. Also added ErrorMsg() handling to ldap.
|
||||
- Added support for union in _adodb_getcount, adodb-lib.inc.php for postgres and oci8.
|
||||
- rs2html() did not work with null dates properly.
|
||||
- PHP 4.4 reference return fixes.
|
||||
|
||||
## 4.63 - 18 May 2005
|
||||
|
||||
- Added $nrows<0 check to mysqli's SelectLimit().
|
||||
- Added OptimizeTable() and OptimizeTables() in adodb-perf.inc.php. By Markus Staab.
|
||||
- PostgreSQL inconsistencies fixed. true and false set to TRUE and FALSE, and boolean type in datadict-postgres.inc.php set to 'L' => 'BOOLEAN'. Thx Kevin Jamieson.
|
||||
- New adodb_session_create_table() function in adodb-session.inc.php. By Markus Staab.
|
||||
- Added null check to UserTimeStamp().
|
||||
- Fixed typo in mysqlt driver in adorecordset. Thx to Andy Staudacher.
|
||||
- GenID() had a bug in the raiseErrorFn handling. Fixed. Thx Marcos Pont.
|
||||
- Datadict name quoting now handles ( ) in index fields correctly - they aren't part of the index field.
|
||||
- Performance monitoring:
|
||||
1. oci8 Ixora checks moved down;
|
||||
2. expensive sql changed so that only those sql with count(*)>1 are shown;
|
||||
3. changed sql1 field to a length+crc32 checksum - this breaks backward compat.
|
||||
- We remap firebird15 to firebird in data dictionary.
|
||||
|
||||
## 4.62 - 2 Apr 2005
|
||||
|
||||
- Added 'w' (dow as 0-6 or 1-7) and 'l' (dow as string) for SQLDate for oci8, postgres and mysql.
|
||||
- Rolled back MetaType() changes for mysqli done in prev version.
|
||||
- Datadict change by chris, cblin#tennaxia.com data mappings from:
|
||||
|
||||
```
|
||||
oci8: X->varchar(4000) XL->CLOB
|
||||
mssql: X->XL->TEXT
|
||||
mysql: X->XL->LONGTEXT
|
||||
fbird: X->XL->varchar(4000)
|
||||
```
|
||||
to:
|
||||
```
|
||||
oci8: X->varchar(4000) XL->CLOB
|
||||
mssql: X->VARCHAR(4000) XL->TEXT
|
||||
mysql: X->TEXT XL->LONGTEXT
|
||||
fbird: X->VARCHAR(4000) XL->VARCHAR(32000)
|
||||
```
|
||||
- Added $connection->disableBlobs to postgresql to improve performance when no bytea is used (2-5% improvement).
|
||||
- Removed all HTTP_* vars.
|
||||
- Added $rs->tableName to be set before calling AutoExecute().
|
||||
- Alex Rootoff rootoff#pisem.net contributed ukrainian language file.
|
||||
- Added new mysql_option() support using $conn->optionFlags array.
|
||||
- Added support for ldap_set_option() using the $LDAP_CONNECT_OPTIONS global variable. Contributed by Josh Eldridge.
|
||||
- Added LDAP_* constant definitions to ldap.
|
||||
- Added support for boolean bind variables. We use $conn->false and $conn->true to hold values to set false/true to.
|
||||
- We now do not close the session connection in adodb-session.inc.php as other objects could be using this connection.
|
||||
- We now strip off `\0` at end of Ixora SQL strings in $perf->tohtml() for oci8.
|
||||
|
||||
## 4.61 - 23 Feb 2005
|
||||
|
||||
- MySQLi added support for mysqli_connect_errno() and mysqli_connect_error().
|
||||
- Massive improvements to alpha PDO driver.
|
||||
- Quote string bind parameters logged by performance monitor for easy type checking. Thx Jason Judge.
|
||||
- Added support for $role when connecting with Interbase/firebird.
|
||||
- Added support for enum recognition in MetaColumns() mysql and mysqli. Thx Amedeo Petrella.
|
||||
- The sybase_ase driver contributed by Interakt Online. Thx Cristian Marin cristic#interaktonline.com.
|
||||
- Removed not_null, has_default, and default_value from ADOFieldObject.
|
||||
- Sessions code, fixed quoting of keys when handling LOBs in session write() function.
|
||||
- Sessions code, added adodb_session_regenerate_id(), to reduce risk of session hijacking by changing session cookie dynamically. Thx Joe Li.
|
||||
- Perf monitor, polling for CPU did not work for PHP 4.3.10 and 5.0.0-5.0.3 due to PHP bugs, so we special case these versions.
|
||||
- Postgresql, UpdateBlob() added code to handle type==CLOB.
|
||||
|
||||
## 4.60 - 24 Jan 2005
|
||||
|
||||
- Implemented PEAR DB's autoExecute(). Simplified design because I don't like using constants when strings work fine.
|
||||
- _rs2serialize will now update $rs->sql and $rs->oldProvider.
|
||||
- Added autoExecute().
|
||||
- Added support for postgres8 driver. Currently just remapped to postgres7 driver.
|
||||
- Changed oci8 _query(), so that OCIBindByName() sets the length to -1 if element size is > 4000. This provides better support for LONGs.
|
||||
- Added SetDateLocale() support for netherlands (Nl).
|
||||
- Spelling error in pivot code ($iff should be $iif).
|
||||
- mysql insert_id() did not work with mysql 3.x. Fixed.
|
||||
- `\r\n` not converted to spaces correctly in exporting data. Fixed.
|
||||
- _nconnect() in mysqli did not return value correctly. Fixed.
|
||||
- Arne Eckmann contributed danish language file.
|
||||
- Added clone() support to FetchObject() for PHP5.
|
||||
- Removed SQL_CUR_USE_ODBC from odbc_mssql.
|
||||
|
||||
## 4.55 - 5 Jan 2005
|
||||
|
||||
- Found bug in Execute() with bind params for db's that do not support binding natively.
|
||||
- DropSequence() now correctly uses default parameter.
|
||||
- Now Execute() ignores locale for floats, so 1.23 is NEVER converted to 1,23.
|
||||
- SetFetchMode() not properly saved in adodb-perf, suspicious sql and expensive sql. Fixed.
|
||||
- Added INET to postgresql metatypes. Thx motzel.
|
||||
- Allow oracle hints to work when counting with _adodb_getcount in adodb-lib.inc.php. Thx Chris Wrye.
|
||||
- Changed mysql insert_id() to use SELECT LAST_INSERT_ID().
|
||||
- If alter col in datadict does not modify col type/size of actual col, then it is removed from alter col code. By Mark Newham. Not perfect as MetaType() !== ActualType().
|
||||
- Added handling of view fields in metacolumns() for postgresql. Thx Renato De Giovanni.
|
||||
- Added to informix MetaPrimaryKeys and MetaColumns fixes for null bit. Thx to Cecilio Albero.
|
||||
- Removed obsolete connection_timeout() from perf code.
|
||||
- Added support for arrayClass in adodb-csv.inc.php.
|
||||
- RSFilter now accepts methods of the form $array($obj, 'methodname'). Thx to blake#near-time.com.
|
||||
- Changed CacheFlush to `$cmd = 'rm -rf '.$ADODB_CACHE_DIR.'/[0-9a-f][0-9a-f]/';`
|
||||
- For better cursor concurrency, added code to free ref cursors in oci8 when $rs->Close() is called. Note that CLose() is called internally by the Get* functions too.
|
||||
- Added IIF support for access when pivoting. Thx Volodia Krupach.
|
||||
- Added mssql datadict support for timestamp. Thx Alexios.
|
||||
- Informix pager fix. By Mario Ramirez.
|
||||
- ADODB_TABLE_REGEX now includes ':'. By Mario Ramirez.
|
||||
- Mark Newnham contributed MetaIndexes for oci8 and db2.
|
||||
|
||||
## 4.54 - 5 Nov 2004
|
||||
|
||||
- Now you can set $db->charSet = ?? before doing a Connect() in oci8.
|
||||
- Added adodbFetchMode to sqlite.
|
||||
- Perf code, added a string typecast to substr in adodb_log_sql().
|
||||
- Postgres: Changed BlobDecode() to use po_loread, added new $maxblobsize parameter, and now it returns the blob instead of sending it to stdout - make sure to mention that as a compat warning. Also added $db->IsOID($oid) function; uses a heuristic, not guaranteed to work 100%.
|
||||
- Contributed arabic language file by "El-Shamaa, Khaled" k.el-shamaa#cgiar.org
|
||||
- PHP5 exceptions did not handle @ protocol properly. Fixed.
|
||||
- Added ifnull handling for postgresql (using coalesce).
|
||||
- Added metatables() support for Postgresql 8.0 (no longer uses pg_% dictionary tables).
|
||||
- Improved Sybase ErrorMsg() function. By Gaetano Giunta.
|
||||
- Improved oci8 SelectLimit() to use Prepare(). By Cristiano Duarte.
|
||||
- Type-cast $row parameter in ifx_fetch_row() to int. Thx stefan bodgan.
|
||||
- Ralf becker contributed improvements in postgresql, sapdb, mysql data dictionary handling:
|
||||
- MySql and Postgres MetaType was reporting every int column which was part of a primary key and unique as serial
|
||||
- Postgres was not reporting the scale of decimal types
|
||||
- MaxDB was padding the defaults of none-string types with spaces
|
||||
- MySql now correctly converts enum columns to varchar
|
||||
- Ralf also changed Postgresql datadict:
|
||||
- you cant add NOT NULL columns in postgres in one go, they need to be added as NULL and then altered to NOT NULL
|
||||
- AlterColumnSQL could not change a varchar column with numbers into an integer column, postgres need an explicit conversation
|
||||
- a re-created sequence was not set to the correct value, if the name was the old name (no implicit sequence), now always the new name of the implicit sequence is used
|
||||
- Sergio Strampelli added extra $intoken check to Lens_ParseArgs() in datadict code.
|
||||
|
||||
## 4.53 - 28 Sept 2004
|
||||
|
||||
- FetchMode cached in recordset is sometimes mapped to native db fetchMode. Normally this does not matter, but when using cached recordsets, we need to switch back to using adodb fetchmode. So we cache this in $rs->adodbFetchMode if it differs from the db's fetchMode.
|
||||
- For informix we now set canSeek = false driver because stefan bodgan tells me that seeking doesn't work.
|
||||
- SetDateLocale() never worked till now ;-) Thx david#tomato.it
|
||||
- Set $_bindInputArray = true in sapdb driver. Required for clob support.
|
||||
- Fixed some PEAR::DB emulation issues with isError() and isWarning. Thx to Gert-Rainer Bitterlich.
|
||||
- Empty() used in getupdatesql without strlen() check. Fixed.
|
||||
- Added unsigned detection to mysql and mysqli drivers. Thx to dan cech.
|
||||
- Added hungarian language file. Thx to Halászvári Gábor.
|
||||
- Improved fieldname-type formatting of datadict SQL generated (adding $widespacing parameter to _GenField).
|
||||
- Datadict oci8 DROP CONSTRAINTS misspelt. Fixed. Thx Mark Newnham.
|
||||
- Changed odbtp to dynamically change databaseType based on connection, eg. from 'odbtp' to 'odbtp_mssql' when connecting to mssql database.
|
||||
- In datadict, MySQL I4 was wrongly mapped to MEDIUMINT, which is actually I3. Fixed.
|
||||
- Fixed mysqli MetaType() recognition. Mysqli returns numeric types unlike mysql extension. Thx Francesco Riosa.
|
||||
- VFP odbc driver curmode set wrongly, causing problems with memo fields. Fixed.
|
||||
- Odbc driver did not recognize odbc version 2 driver date types properly. Fixed. Thx Bostjan.
|
||||
- ChangeTableSQL() fixes to datadict-db2.inc.php by Mark Newnham.
|
||||
- Perf monitoring with odbc improved. Now we try in perf code to manually set the sysTimeStamp using date() if sysTimeStamp is empty.
|
||||
- All ADO errors are thrown as exceptions in PHP5. So we added exception handling to ado in PHP5 by creating new adodb-ado5.inc.php driver.
|
||||
- Added IsConnected(). Returns true if connection object connected. By Luca.Gioppo.
|
||||
- "Ralf Becker" RalfBecker#digitalROCK.de contributed new sapdb data-dictionary driver and a large patch that implements field and table renaming for oracle, mssql, postgresql, mysql and sapdb. See the new RenameTableSQL() and RenameColumnSQL() functions.
|
||||
- We now check ExecuteCursor to see if PrepareSP was initially called.
|
||||
- Changed oci8 datadict to use MODIFY for $dd->alterCol. Thx Mark Newnham.
|
||||
|
||||
## 4.52 - 10 Aug 2004
|
||||
|
||||
- Bug found in Replace() when performance logging enabled, introduced in ADOdb 4.50. Fixed.
|
||||
- Replace() checks update stmt. If update stmt fails, we now return immediately. Thx to alex.
|
||||
- Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to niko.
|
||||
- Added ADODB_ASSOC_CASE support to postgres/postgres7 driver.
|
||||
- Support for DECLARE stmt in oci8. Thx Lochbrunner.
|
||||
|
||||
## 4.51 - 29 July 2004
|
||||
|
||||
- Added adodb-xmlschema 1.0.2. Thx dan and richard.
|
||||
- Added new adorecordset_ext_* classes. If ADOdb extension installed for mysql, mysqlt and oci8 (but not oci8po), we use the superfast ADOdb extension code for movenext.
|
||||
- Added schema support to mssql and odbc_mssql MetaPrimaryKeys().
|
||||
- Patched MSSQL driver to support PHP NULL and Boolean values while binding the input array parameters in the _query() function. By Stephen Farmer.
|
||||
- Added support for clob's for mssql, UpdateBlob(). Thx to gfran#directa.com.br
|
||||
- Added normalize support for postgresql (true=lowercase table name, or false=case-sensitive table names) to MetaColumns($table, $normalize=true).
|
||||
- PHP5 variant dates in ADO not working. Fixed in adodb-ado.inc.php.
|
||||
- Constant ADODB_FORCE_NULLS was not working properly for many releases (for GetUpdateSQL). Fixed. Also GetUpdateSQL strips off ORDER BY now - thx Elieser Leão.
|
||||
- Perf Monitor for oci8 now dynamically highlights optimizer_* params if too high/low.
|
||||
- Added dsn support to NewADOConnection/ADONewConnection.
|
||||
- Fixed out of page bounds bug in _adodb_pageexecute_all_rows() Thx to "Sergio Strampelli" sergio#rir.it
|
||||
- Speedup of movenext for mysql and oci8 drivers.
|
||||
- Moved debugging code _adodb_debug_execute() to adodb-lib.inc.php.
|
||||
- Fixed postgresql bytea detection bug. See http://phplens.com/lens/lensforum/msgs.php?id=9849.
|
||||
- Fixed ibase datetimestamp typo in PHP5. Thx stefan.
|
||||
- Removed whitespace at end of odbtp drivers.
|
||||
- Added db2 metaprimarykeys fix.
|
||||
- Optimizations to MoveNext() for mysql and oci8. Misc speedups to Get* functions.
|
||||
|
||||
## 4.50 - 6 July 2004
|
||||
|
||||
- Bumped it to 4.50 to avoid confusion with PHP 4.3.x series.
|
||||
- Added db2 metatables and metacolumns extensions.
|
||||
- Added alpha PDO driver. Very buggy, only works with odbc.
|
||||
- Tested mysqli. Set poorAffectedRows = true. Cleaned up movenext() and _fetch().
|
||||
- PageExecute does not work properly with php5 (return val not a variable). Reported Dmytro Sychevsky sych#php.com.ua. Fixed.
|
||||
- MetaTables() for mysql, $showschema parameter was not backward compatible with older versions of adodb. Fixed.
|
||||
- Changed mysql GetOne() to work with mysql 3.23 when using with non-select stmts (e.g. SHOW TABLES).
|
||||
- Changed TRIG_ prefix to a variable in datadict-oci8.inc.php. Thx to Luca.Gioppo#csi.it.
|
||||
- New to adodb-time code. We allow you to define your own daylights savings function, adodb_daylight_sv for pre-1970 dates. If the function is defined (somewhere in an include), then you can correct for daylights savings. See http://phplens.com/phpeverywhere/node/view/16#daylightsavings for more info.
|
||||
- New sqlitepo driver. This is because assoc mode does not work like other drivers in sqlite. Namely, when selecting (joining) multiple tables, in assoc mode the table names are included in the assoc keys in the "sqlite" driver. In "sqlitepo" driver, the table names are stripped from the returned column names. When this results in a conflict, the first field get preference. Contributed by Herman Kuiper herman#ozuzo.net
|
||||
- Added $forcenull parameter to GetInsertSQL/GetUpdateSQL. Idea by Marco Aurelio Silva.
|
||||
- More XHTML changes for GetMenu. By Jeremy Evans.
|
||||
- Fixes some ibase date issues. Thx to stefan bogdan.
|
||||
- Improvements to mysqli driver to support $ADODB_COUNTRECS.
|
||||
- Fixed adodb-csvlib.inc.php problem when reading stream from socket. We need to poll stream continiously.
|
||||
|
||||
## 4.23 - 16 June 2004
|
||||
|
||||
- New interbase/firebird fixes thx to Lester Caine. Driver fixes a problem with getting field names in the result array, and corrects a couple of data conversions. Also we default to dialect3 for firebird. Also ibase sysDate property was wrong. Changed to cast as timestamp.
|
||||
- The datadict driver is set up to give quoted tables and fields as this was the only way round reserved words being used as field names in TikiWiki. TikiPro is tidying that up, and I hope to be able to produce a build of THAT which uses what I consider proper UPPERCASE field and table names. The conversion of TikiWiki to ADOdb helped in that, but until the database is completely tidied up in TikiPro ...
|
||||
- Modified _gencachename() to include fetchmode in name hash. This means you should clear your cache directory after installing this release as the cache name algorithm has changed.
|
||||
- Now Cache* functions work in safe mode, because we do not create sub-directories in the $ADODB_CACHE_DIR in safe mode. In non-safe mode we still create sub-directories. Done by modifying _gencachename().
|
||||
- Added $gmt parameter (true/false) to UserDate and UserTimeStamp in connection class, to force conversion of input (in local time) to be converted to UTC/GMT.
|
||||
- Mssql datadict did not support INT types properly (no size param allowed). Added _GetSize() to datadict-mssql.inc.php.
|
||||
- For borland_ibase, BeginTrans(), changed:
|
||||
|
||||
```
|
||||
$this->_transactionID = $this->_connectionID;
|
||||
```
|
||||
|
||||
to
|
||||
|
||||
```
|
||||
$this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID);
|
||||
```
|
||||
|
||||
- Fixed typo in mysqi_field_seek(). Thx to Sh4dow (sh4dow#php.pl).
|
||||
- LogSQL did not work with Firebird/Interbase. Fixed.
|
||||
- Postgres: made errorno() handling more consistent. Thx to Michael Jahn, Michael.Jahn#mailbox.tu-dresden.de.
|
||||
- Added informix patch to better support metatables, metacolumns by "Cecilio Albero" c-albero#eos-i.com
|
||||
- Cyril Malevanov contributed patch to oci8 to support passing of LOB parameters:
|
||||
|
||||
```
|
||||
$text = 'test test test';
|
||||
$sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";
|
||||
$stmt = $conn -> PrepareSP($sql);
|
||||
$conn -> InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB);
|
||||
$rs = '';
|
||||
$conn -> OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);
|
||||
$conn -> Execute($stmt);
|
||||
echo "return = ".$rs."<br>";</pre>
|
||||
```
|
||||
|
||||
As he says, the LOBs limitations are:
|
||||
- use OCINewDescriptor before binding
|
||||
- if Param is IN, uses save() before each execute. This is done automatically for you.
|
||||
- if Param is OUT, uses load() after each execute. This is done automatically for you.
|
||||
- when we bind $var as LOB, we create new descriptor and return it as a Bind Result, so if we want to use OUT parameters, we have to store somewhere &$var to load() data from LOB to it.
|
||||
- IN OUT params are not working now (should not be a big problem to fix it)
|
||||
- now mass binding not working too (I've wrote about it before)</pre>
|
||||
- Simplified Connect() and PConnect() error handling.
|
||||
- When extension not loaded, Connect() and PConnect() will return null. On connect error, the fns will return false.
|
||||
- CacheGetArray() added to code.
|
||||
- Added Init() to adorecordset_empty().
|
||||
- Changed postgres64 driver, MetaColumns() to not strip off quotes in default value if :: detected (type-casting of default).
|
||||
- Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from detecting file paths.
|
||||
- Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*).
|
||||
- New polish language file by Grzegorz Pacan
|
||||
- Added support for UNION in _adodb_getcount().
|
||||
- Added security check for ADODB_DIR to limit path disclosure issues. Requested by postnuke team.
|
||||
- Added better error message support to oracle driver. Thx to Gaetano Giunta.
|
||||
- Added showSchema support to mysql.
|
||||
- Bind in oci8 did not handle $name=false properly. Fixed.
|
||||
- If extension not loaded, Connect(), PConnect(), NConnect() will return null.
|
||||
|
||||
## 4.22 - 15 Apr 2004
|
||||
|
||||
- Moved docs to own adodb/docs folder.
|
||||
- Fixed session bug when quoting compressed/encrypted data in Replace().
|
||||
- Netezza Driver and LDAP drivers contributed by Josh Eldridge.
|
||||
- GetMenu now uses rtrim() on values instead of trim().
|
||||
- Changed MetaColumnNames to return an associative array, keys being the field names in uppercase.
|
||||
- Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants. Thx to Alexios Fakos.
|
||||
- Contributed bulgarian language file by Valentin Sheiretsky valio#valio.eu.org.
|
||||
- Contributed romanian language file by stefan bogdan.
|
||||
- GetInsertSQL now checks for table name (string) in $rs, and will create a recordset for that table automatically. Contributed by Walt Boring. Also added OCI_B_BLOB in bind on Walt's request - hope it doesn't break anything :-)
|
||||
- Some minor postgres speedups in `_initrs()`.
|
||||
- ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge.
|
||||
- Added ADOConnection::Time(), returns current database time in unix timestamp format, or false.
|
||||
|
||||
## 4.21 - 20 Mar 2004
|
||||
|
||||
- We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER BY exists.
|
||||
- Pim Koeman contributed dutch language file adodb-nl.inc.php.
|
||||
- Rick Hickerson added CLOB support to db2 datadict.
|
||||
- Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro.
|
||||
- Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly false). Fixes oci8 backward compat problems with OUT params.
|
||||
- Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared as 2102-May-32.
|
||||
- Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to valid().
|
||||
- Changed internal format of serialized cache recordsets. As we store a version number, this should be backward compatible.
|
||||
- Error handling when driver file not found was flawed in ADOLoadCode(). Fixed.
|
||||
|
||||
## 4.20 - 27 Feb 2004
|
||||
|
||||
- Updated to AXMLS 1.01.
|
||||
- MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
|
||||
- Now numbers accepts function calls or sequences for GetInsertSQL/GetUpdateSQL numeric fields.
|
||||
- Changed quotes of 'delete from $perf_table' to "". Thx Kehui (webmaster#kehui.net)
|
||||
- Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz.
|
||||
- Added addq(), which is analogous to addslashes().
|
||||
- Tested with php5b4. Fix some php5 compat problems with exceptions and sybase.
|
||||
- Carl-Christian Salvesen added patch to mssql _query to support binds greater than 4000 chars.
|
||||
- Mike suggested patch to PHP5 exception handler. $errno must be numeric.
|
||||
- Added double quotes (") to ADODB_TABLE_REGEX.
|
||||
- For oci8, Prepare(...,$cursor), $cursor's meaning was accidentally inverted in 4.11. This causes problems with ExecuteCursor() too, which calls Prepare() internally. Thx to William Lovaton.
|
||||
- Now dateHasTime property in connection object renamed to datetime for consistency. This could break bc.
|
||||
- Csongor Halmai reports that db2 SelectLimit with input array is not working. Fixed..
|
||||
|
||||
## 4.11 - 27 Jan 2004
|
||||
|
||||
- Csongor Halmai reports db2 binding not working. Reverted back to emulated binding.
|
||||
- Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
|
||||
- Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to v$db_cache_advice. Reported by Steve W.
|
||||
- UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly. Reported by Mike Muir. Fixed.
|
||||
- Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically, unless 2nd param is set to true. This will break backward compat, if Prepare/Execute is used instead of ExecuteCursor. Reported by Chris Jones.
|
||||
- Added InParameter() and OutParameter(). Wrapper functions to Parameter(), but nicer because they are self-documenting.
|
||||
- Added 'R' handling in ActualType() to datadict-mysql.inc.php
|
||||
- Added ADOConnection::SerializableRS($rs). Returns a recordset that can be serialized in a session.
|
||||
- Added "Run SQL" to performance UI().
|
||||
- Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and datadict-oci8.inc.php, from Heinz Hombergs.
|
||||
- MetaIndexes() for ibase contributed by Heinz Hombergs.
|
||||
|
||||
## 4.10 - 12 Jan 2004
|
||||
|
||||
- Dan Cech contributed extensive changes to data dictionary to support name quoting (with `\``), and drop table/index.
|
||||
- Informix added cursorType property. Default remains IFX_SCROLL, but you can change to 0 (non-scrollable cursor) for performance.
|
||||
- Added ADODB_View_PrimaryKeys() for returning view primary keys to MetaPrimaryKeys().
|
||||
- Simplified chinese file, adodb-cn.inc.php from cysoft.
|
||||
- Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge.
|
||||
- Added connection parameter to ibase Prepare(). Fix by Daniel Hassan.
|
||||
- Added nameQuote for quoting identifiers and names to connection obj. Requested by Jason Judge. Also the data dictionary parser now detects `field name` and generates column names with spaces correctly.
|
||||
- BOOL type not recognised correctly as L. Fixed.
|
||||
- Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15 Dec 2003)
|
||||
- Added Schema to postgresql MetaTables. Thx to col#gear.hu
|
||||
- Empty postgresql recordsets that had blob fields did not set EOF properly. Fixed.
|
||||
- CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio.
|
||||
- Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg. no html).
|
||||
- Fixed some fr and it lang errors. Thx to Gaetano G.
|
||||
- Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G.
|
||||
- Fixed array recordset bugs when `_skiprow1` is true. Thx to Gaetano G.
|
||||
- Fixed pivot table code when count is false.
|
||||
|
||||
## 4.05 - 13 Dec 2003
|
||||
|
||||
- Added MetaIndexes to data-dict code - thx to Dan Cech.
|
||||
- Rewritten session code by Ross Smith. Moved code to adodb/session directory.
|
||||
- Added function exists check on connecting to most drivers, so we don't crash with the unknown function error.
|
||||
- Smart Transactions failed with GenID() when it no seq table has been created because the sql statement fails. Fix by Mark Newnham.
|
||||
- Added $db->length, which holds name of function that returns strlen.
|
||||
- Fixed error handling for bad driver in ADONewConnection - passed too few params to error-handler.
|
||||
- Datadict did not handle types like 16.0 properly in _GetSize. Fixed.
|
||||
- Oci8 driver SelectLimit() bug &= instead of =& used. Thx to Swen Thümmler.
|
||||
- Jesse Mullan suggested not flushing outp when output buffering enabled. Due to Apache 2.0 bug. Added.
|
||||
- MetaTables/MetaColumns return ref bug with PHP5 fixed in adodb-datadict.inc.php.
|
||||
- New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver. Then jlim added BeginTrans, CommitTrans, RollbackTrans, IfNull, SQLDate. Also fixed return ref bug.
|
||||
- $ADODB_FLUSH added, if true then force flush in debugging outp. Default is false. In earlier versions, outp defaulted to flush, which is not compat with apache 2.0.
|
||||
- Mysql driver's GenID() function did not work when when sql logging is on. Fixed.
|
||||
- $ADODB_SESSION_TBL not declared as global var. Not available if adodb-session.inc.php included in function. Fixed.
|
||||
- The input array not passed to Execute() in _adodb_getcount(). Fixed.
|
||||
|
||||
## 4.04 - 13 Nov 2003
|
||||
|
||||
- Switched back to foreach - faster than list-each.
|
||||
- Fixed bug in ado driver - wiping out $this->fields with date fields.
|
||||
- Performance Monitor, View SQL, Explain Plan did not work if strlen($SQL)>max($_GET length). Fixed.
|
||||
- Performance monitor, oci8 driver added memory sort ratio.
|
||||
- Added random property, returns SQL to generate a floating point number between 0 and 1;
|
||||
|
||||
## 4.03 - 6 Nov 2003
|
||||
|
||||
- The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup properly.
|
||||
- Patched SQLDate in interbase to support hours/mins/secs. Thx to ari kuorikoski.
|
||||
- Force autorollback for pgsql persistent connections - apparently pgsql did not autorollback properly before 4.3.4. See http://bugs.php.net/bug.php?id=25404
|
||||
|
||||
## 4.02 - 5 Nov 2003
|
||||
|
||||
- Some errors in adodb_error_pg() fixed. Thx to Styve.
|
||||
- Spurious Insert_ID() error was generated by LogSQL(). Fixed.
|
||||
- Insert_ID was interfering with Affected_Rows() and Replace() when LogSQL() enabled. Fixed.
|
||||
- More foreach loops optimized with list/each.
|
||||
- Null dates not handled properly in ADO driver (it becomes 31 Dec 1969!).
|
||||
- Heinz Hombergs contributed patches for mysql MetaColumns - adding scale, made interbase MetaColumns work with firebird/interbase, and added lang/adodb-de.inc.php.
|
||||
- Added INFORMIXSERVER environment variable.
|
||||
- Added $ADODB_ANSI_PADDING_OFF for interbase/firebird.
|
||||
- PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support.
|
||||
|
||||
## 4.01 - 23 Oct 2003
|
||||
|
||||
- Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells.
|
||||
- Fixed insert_id() incorrectly generated when logsql() enabled.
|
||||
- Modified PostgreSQL _fixblobs to use list/each instead of foreach.
|
||||
- Informix ErrorNo() implemented correctly.
|
||||
- Modified several places to use list/each, including GetRowAssoc().
|
||||
- Added UserTimeStamp() to connection class.
|
||||
- Added $ADODB_ANSI_PADDING_OFF for oci8po.
|
||||
|
||||
## 4.00 - 20 Oct 2003
|
||||
|
||||
- Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.
|
||||
- Fix to rs2html warning message. Thx to Filo.
|
||||
- Fix for odbc_mssql/mssql SQLDate(), hours was wrong.
|
||||
- Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson.
|
||||
- Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by Karsten Dambekalns
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -29,12 +31,12 @@ if (!defined('_ADODB_ACCESS')) {
|
||||
var $hasTransactions = false;
|
||||
var $upperCase = 'ucase';
|
||||
|
||||
function ADODB_access()
|
||||
function __construct()
|
||||
{
|
||||
global $ADODB_EXTENSION;
|
||||
|
||||
$ADODB_EXTENSION = false;
|
||||
$this->ADODB_odbc();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function Time()
|
||||
@@ -78,10 +80,9 @@ if (!defined('_ADODB_ACCESS')) {
|
||||
|
||||
var $databaseType = "access";
|
||||
|
||||
function ADORecordSet_access($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbc($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}// class
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -37,7 +39,7 @@ class ADODB_ado extends ADOConnection {
|
||||
var $poorAffectedRows = true;
|
||||
var $charPage;
|
||||
|
||||
function ADODB_ado()
|
||||
function __construct()
|
||||
{
|
||||
$this->_affectedRows = new VARIANT;
|
||||
}
|
||||
@@ -147,7 +149,7 @@ class ADODB_ado extends ADOConnection {
|
||||
|
||||
*/
|
||||
|
||||
function MetaTables()
|
||||
function MetaTables($ttype = false, $showSchema = false, $mask = false)
|
||||
{
|
||||
$arr= array();
|
||||
$dbc = $this->_connectionID;
|
||||
@@ -341,14 +343,14 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
var $canSeek = true;
|
||||
var $hideErrors = true;
|
||||
|
||||
function ADORecordSet_ado($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
$this->fetchMode = $mode;
|
||||
return $this->ADORecordSet($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
|
||||
@@ -625,7 +627,7 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
@$rs->MoveNext(); // @ needed for some versions of PHP!
|
||||
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -656,5 +658,3 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -37,7 +39,7 @@ class ADODB_ado extends ADOConnection {
|
||||
var $poorAffectedRows = true;
|
||||
var $charPage;
|
||||
|
||||
function ADODB_ado()
|
||||
function __construct()
|
||||
{
|
||||
$this->_affectedRows = new VARIANT;
|
||||
}
|
||||
@@ -118,7 +120,7 @@ class ADODB_ado extends ADOConnection {
|
||||
$dbc->CursorLocation = $this->_cursor_location;
|
||||
return $dbc->State > 0;
|
||||
} catch (exception $e) {
|
||||
if ($this->debug);echo "<pre>",$argHostname,"\n",$e,"</pre>\n";
|
||||
if ($this->debug) echo "<pre>",$argHostname,"\n",$e,"</pre>\n";
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -172,7 +174,7 @@ class ADODB_ado extends ADOConnection {
|
||||
|
||||
*/
|
||||
|
||||
function MetaTables()
|
||||
function MetaTables($ttype = false, $showSchema = false, $mask = false)
|
||||
{
|
||||
$arr= array();
|
||||
$dbc = $this->_connectionID;
|
||||
@@ -375,14 +377,14 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
var $canSeek = true;
|
||||
var $hideErrors = true;
|
||||
|
||||
function ADORecordSet_ado($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
$this->fetchMode = $mode;
|
||||
return $this->ADORecordSet($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
|
||||
@@ -670,7 +672,7 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
@$rs->MoveNext(); // @ needed for some versions of PHP!
|
||||
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -704,5 +706,3 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -28,11 +30,6 @@ class ADODB_ado_access extends ADODB_ado {
|
||||
var $sysTimeStamp = 'NOW';
|
||||
var $upperCase = 'ucase';
|
||||
|
||||
function ADODB_ado_access()
|
||||
{
|
||||
$this->ADODB_ado();
|
||||
}
|
||||
|
||||
/*function BeginTrans() { return false;}
|
||||
|
||||
function CommitTrans() { return false;}
|
||||
@@ -46,9 +43,8 @@ class ADORecordSet_ado_access extends ADORecordSet_ado {
|
||||
|
||||
var $databaseType = "ado_access";
|
||||
|
||||
function ADORecordSet_ado_access($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_ado($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -39,11 +41,6 @@ class ADODB_ado_mssql extends ADODB_ado {
|
||||
|
||||
//var $_inTransaction = 1; // always open recordsets, so no transaction problems.
|
||||
|
||||
function ADODB_ado_mssql()
|
||||
{
|
||||
$this->ADODB_ado();
|
||||
}
|
||||
|
||||
function _insertid()
|
||||
{
|
||||
return $this->GetOne('select SCOPE_IDENTITY()');
|
||||
@@ -146,9 +143,8 @@ class ADORecordSet_ado_mssql extends ADORecordSet_ado {
|
||||
|
||||
var $databaseType = 'ado_mssql';
|
||||
|
||||
function ADORecordSet_ado_mssql($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_ado($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
(c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
(c) 2000-2014 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
Portions Copyright (c) 2007-2009, iAnywhere Solutions, Inc.
|
||||
All rights reserved. All unpublished rights reserved.
|
||||
|
||||
@@ -66,7 +66,7 @@ class ADODB_ads extends ADOConnection {
|
||||
var $uCaseTables = true; // for meta* functions, uppercase table names
|
||||
|
||||
|
||||
function ADODB_ads()
|
||||
function __construct()
|
||||
{
|
||||
$this->_haserrorfunctions = ADODB_PHPVER >= 0x4050;
|
||||
$this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
|
||||
@@ -136,7 +136,7 @@ class ADODB_ads extends ADOConnection {
|
||||
|
||||
|
||||
// returns true or false
|
||||
function CreateSequence( $seqname,$start=1)
|
||||
function CreateSequence($seqname = 'adodbseq', $start = 1)
|
||||
{
|
||||
$res = $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
|
||||
if(!$res){
|
||||
@@ -149,7 +149,7 @@ class ADODB_ads extends ADOConnection {
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
function DropSequence($seqname)
|
||||
function DropSequence($seqname = 'adodbseq')
|
||||
{
|
||||
$res = $this->Execute("DROP TABLE $seqname");
|
||||
if(!$res){
|
||||
@@ -164,7 +164,7 @@ class ADODB_ads extends ADOConnection {
|
||||
// returns the generated ID or false
|
||||
// checks if the table already exists, else creates the table and inserts a record into the table
|
||||
// and gets the ID number of the last inserted record.
|
||||
function GenID($seqname,$start=1)
|
||||
function GenID($seqname = 'adodbseq', $start = 1)
|
||||
{
|
||||
$go = $this->Execute("select * from $seqname");
|
||||
if (!$go){
|
||||
@@ -254,7 +254,7 @@ class ADODB_ads extends ADOConnection {
|
||||
|
||||
// Returns tables,Views or both on succesfull execution. Returns
|
||||
// tables by default on succesfull execustion.
|
||||
function &MetaTables($ttype)
|
||||
function &MetaTables($ttype = false, $showSchema = false, $mask = false)
|
||||
{
|
||||
$recordSet1 = $this->Execute("select * from system.tables");
|
||||
if(!$recordSet1){
|
||||
@@ -294,7 +294,7 @@ class ADODB_ads extends ADOConnection {
|
||||
|
||||
}
|
||||
|
||||
function &MetaPrimaryKeys($table)
|
||||
function &MetaPrimaryKeys($table, $owner = false)
|
||||
{
|
||||
$recordSet = $this->Execute("select table_primary_key from system.tables where name='$table'");
|
||||
if(!$recordSet){
|
||||
@@ -378,7 +378,7 @@ class ADODB_ads extends ADOConnection {
|
||||
}
|
||||
}
|
||||
|
||||
function &MetaColumns($table)
|
||||
function &MetaColumns($table, $normalize = true)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -486,7 +486,7 @@ class ADODB_ads extends ADOConnection {
|
||||
}
|
||||
|
||||
// Returns an array of columns names for a given table
|
||||
function &MetaColumnNames($table)
|
||||
function &MetaColumnNames($table, $numIndexes = false, $useattnum = false)
|
||||
{
|
||||
$recordSet = $this->Execute("select name from system.columns where parent='$table'");
|
||||
if(!$recordSet){
|
||||
@@ -654,7 +654,7 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
var $useFetchArray;
|
||||
var $_has_stupid_odbc_fetch_api_change;
|
||||
|
||||
function ADORecordSet_ads($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -667,7 +667,7 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
// the following is required for mysql odbc driver in 4.3.1 -- why?
|
||||
$this->EOF = false;
|
||||
$this->_currentRow = -1;
|
||||
//$this->ADORecordSet($id);
|
||||
//parent::__construct($id);
|
||||
}
|
||||
|
||||
|
||||
@@ -731,7 +731,7 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
$this->fetchMode = $savem;
|
||||
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields =& $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields =& $this->GetRowAssoc();
|
||||
}
|
||||
|
||||
$results = array();
|
||||
@@ -749,17 +749,7 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
{
|
||||
if ($this->_numOfRows != 0 && !$this->EOF) {
|
||||
$this->_currentRow++;
|
||||
|
||||
if ($this->_has_stupid_odbc_fetch_api_change)
|
||||
$rez = @ads_fetch_into($this->_queryID,$this->fields);
|
||||
else {
|
||||
$row = 0;
|
||||
$rez = @ads_fetch_into($this->_queryID,$row,$this->fields);
|
||||
}
|
||||
if ($rez) {
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields =& $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
}
|
||||
if( $this->_fetch() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -770,7 +760,7 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
|
||||
function _fetch()
|
||||
{
|
||||
|
||||
$this->fields = false;
|
||||
if ($this->_has_stupid_odbc_fetch_api_change)
|
||||
$rez = @ads_fetch_into($this->_queryID,$this->fields);
|
||||
else {
|
||||
@@ -779,11 +769,10 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
}
|
||||
if ($rez) {
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields =& $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields =& $this->GetRowAssoc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
$this->fields = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -793,4 +782,3 @@ class ADORecordSet_ads extends ADORecordSet {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -20,12 +22,6 @@ include_once(ADODB_DIR."/drivers/adodb-ibase.inc.php");
|
||||
class ADODB_borland_ibase extends ADODB_ibase {
|
||||
var $databaseType = "borland_ibase";
|
||||
|
||||
|
||||
function ADODB_borland_ibase()
|
||||
{
|
||||
$this->ADODB_ibase();
|
||||
}
|
||||
|
||||
function BeginTrans()
|
||||
{
|
||||
if ($this->transOff) return true;
|
||||
@@ -84,9 +80,8 @@ class ADORecordSet_borland_ibase extends ADORecordSet_ibase {
|
||||
|
||||
var $databaseType = "borland_ibase";
|
||||
|
||||
function ADORecordSet_borland_ibase($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_ibase($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -36,7 +38,7 @@ if (! defined("_ADODB_CSV_LAYER")) {
|
||||
var $hasTransactions = false;
|
||||
var $_errorNo = false;
|
||||
|
||||
function ADODB_csv()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -79,7 +81,7 @@ if (! defined("_ADODB_CSV_LAYER")) {
|
||||
|
||||
|
||||
// parameters use PostgreSQL convention, not MySQL
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1)
|
||||
function SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs2cache = 0)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -191,9 +193,9 @@ if (! defined("_ADODB_CSV_LAYER")) {
|
||||
} // class
|
||||
|
||||
class ADORecordset_csv extends ADORecordset {
|
||||
function ADORecordset_csv($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordset($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
function _close()
|
||||
@@ -203,5 +205,3 @@ if (! defined("_ADODB_CSV_LAYER")) {
|
||||
}
|
||||
|
||||
} // define
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.06 16 Oct 2008 (c) 2006 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
/**
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
This is a version of the ADODB driver for DB2. It uses the 'ibm_db2' PECL extension
|
||||
for PHP (http://pecl.php.net/package/ibm_db2), which in turn requires DB2 V8.2.2 or
|
||||
@@ -61,7 +63,7 @@ class ADODB_db2 extends ADOConnection {
|
||||
return ADOConnection::GetOne('VALUES IDENTITY_VAL_LOCAL()');
|
||||
}
|
||||
|
||||
function ADODB_db2()
|
||||
function __construct()
|
||||
{
|
||||
$this->_haserrorfunctions = ADODB_PHPVER >= 0x4050;
|
||||
}
|
||||
@@ -134,7 +136,7 @@ class ADODB_db2 extends ADOConnection {
|
||||
}
|
||||
|
||||
// format and return date string in database timestamp format
|
||||
function DBTimeStamp($ts)
|
||||
function DBTimeStamp($ts, $isfld = false)
|
||||
{
|
||||
if (empty($ts) && $ts !== 0) return 'null';
|
||||
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
|
||||
@@ -210,31 +212,19 @@ class ADODB_db2 extends ADOConnection {
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
$row = $this->GetRow("SELECT service_level, fixpack_num FROM TABLE(sysproc.env_get_inst_info())
|
||||
as INSTANCEINFO");
|
||||
|
||||
if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
|
||||
$dsn = strtoupper($this->host);
|
||||
$first = true;
|
||||
$found = false;
|
||||
|
||||
if (!function_exists('db2_data_source')) return false;
|
||||
|
||||
while(true) {
|
||||
|
||||
$rez = @db2_data_source($this->_connectionID,
|
||||
$first ? SQL_FETCH_FIRST : SQL_FETCH_NEXT);
|
||||
$first = false;
|
||||
if (!is_array($rez)) break;
|
||||
if (strtoupper($rez['server']) == $dsn) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) return ADOConnection::ServerInfo();
|
||||
if (!isset($rez['version'])) $rez['version'] = '';
|
||||
return $rez;
|
||||
if ($row) {
|
||||
$info['version'] = $row[0].':'.$row[1];
|
||||
$info['fixpack'] = $row[1];
|
||||
$info['description'] = '';
|
||||
} else {
|
||||
return ADOConnection::ServerInfo();
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
function CreateSequence($seqname='adodbseq',$start=1)
|
||||
@@ -245,13 +235,13 @@ class ADODB_db2 extends ADOConnection {
|
||||
return true;
|
||||
}
|
||||
|
||||
function DropSequence($seqname)
|
||||
function DropSequence($seqname = 'adodbseq')
|
||||
{
|
||||
if (empty($this->_dropSeqSQL)) return false;
|
||||
return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
|
||||
}
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
|
||||
function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0)
|
||||
{
|
||||
$nrows = (integer) $nrows;
|
||||
if ($offset <= 0) {
|
||||
@@ -345,7 +335,7 @@ class ADODB_db2 extends ADOConnection {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function MetaPrimaryKeys($table)
|
||||
function MetaPrimaryKeys($table, $owner = false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -421,7 +411,7 @@ class ADODB_db2 extends ADOConnection {
|
||||
}
|
||||
|
||||
|
||||
function MetaTables($ttype=false,$schema=false)
|
||||
function MetaTables($ttype = false, $schema = false, $mask = false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -738,7 +728,7 @@ class ADORecordSet_db2 extends ADORecordSet {
|
||||
var $dataProvider = "db2";
|
||||
var $useFetchArray;
|
||||
|
||||
function ADORecordSet_db2($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -805,7 +795,7 @@ class ADORecordSet_db2 extends ADORecordSet {
|
||||
$this->fetchMode = $savem;
|
||||
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
|
||||
$results = array();
|
||||
@@ -827,7 +817,7 @@ class ADORecordSet_db2 extends ADORecordSet {
|
||||
$this->fields = @db2_fetch_array($this->_queryID);
|
||||
if ($this->fields) {
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -843,7 +833,7 @@ class ADORecordSet_db2 extends ADORecordSet {
|
||||
$this->fields = db2_fetch_array($this->_queryID);
|
||||
if ($this->fields) {
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -857,4 +847,3 @@ class ADORecordSet_db2 extends ADORecordSet {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -158,18 +160,13 @@ if (!defined('ADODB_DB2OCI')){
|
||||
var $sysDate = 'trunc(sysdate)';
|
||||
var $_bindInputArray = true;
|
||||
|
||||
function ADODB_db2oci()
|
||||
{
|
||||
parent::ADODB_db2();
|
||||
}
|
||||
|
||||
function Param($name,$type=false)
|
||||
function Param($name,$type='C')
|
||||
{
|
||||
return ':'.$name;
|
||||
}
|
||||
|
||||
|
||||
function MetaTables($ttype=false,$schema=false)
|
||||
function MetaTables($ttype = false, $schema = false, $mask = false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -220,11 +217,10 @@ if (!defined('ADODB_DB2OCI')){
|
||||
|
||||
var $databaseType = "db2oci";
|
||||
|
||||
function ADORecordSet_db2oci($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_db2($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
} //define
|
||||
?>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
|
||||
Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
|
||||
*/
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
include(ADODB_DIR."/drivers/adodb-db2.inc.php");
|
||||
|
||||
|
||||
if (!defined('ADODB_DB2OCI')){
|
||||
define('ADODB_DB2OCI',1);
|
||||
|
||||
|
||||
/**
|
||||
* Callback function for preg_replace in _colonscope()
|
||||
* @param array $p matched patterns
|
||||
* return string '?' if parameter replaced, :N if not
|
||||
*/
|
||||
function _colontrack($p)
|
||||
{
|
||||
global $_COLONARR, $_COLONSZ;
|
||||
$v = (integer) substr($p[1], 1);
|
||||
if ($v > $_COLONSZ) return $p[1];
|
||||
$_COLONARR[] = $v;
|
||||
return '?';
|
||||
}
|
||||
|
||||
/**
|
||||
* smart remapping of :0, :1 bind vars to ? ?
|
||||
* @param string $sql SQL statement
|
||||
* @param array $arr parameters
|
||||
* @return array
|
||||
*/
|
||||
function _colonscope($sql,$arr)
|
||||
{
|
||||
global $_COLONARR,$_COLONSZ;
|
||||
|
||||
$_COLONARR = array();
|
||||
$_COLONSZ = sizeof($arr);
|
||||
|
||||
$sql2 = preg_replace_callback('/(:[0-9]+)/', '_colontrack', $sql);
|
||||
|
||||
if (empty($_COLONARR)) return array($sql,$arr);
|
||||
|
||||
foreach($_COLONARR as $k => $v) {
|
||||
$arr2[] = $arr[$v];
|
||||
}
|
||||
|
||||
return array($sql2,$arr2);
|
||||
}
|
||||
|
||||
class ADODB_db2oci extends ADODB_db2 {
|
||||
var $databaseType = "db2oci";
|
||||
var $sysTimeStamp = 'sysdate';
|
||||
var $sysDate = 'trunc(sysdate)';
|
||||
|
||||
function _Execute($sql, $inputarr = false)
|
||||
{
|
||||
if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
|
||||
return parent::_Execute($sql, $inputarr);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ADORecordSet_db2oci extends ADORecordSet_odbc {
|
||||
|
||||
var $databaseType = "db2oci";
|
||||
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
} //define
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
@version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -23,7 +25,7 @@ if (! defined("_ADODB_FBSQL_LAYER")) {
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $hasLimit = false;
|
||||
|
||||
function ADODB_fbsql()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -162,7 +164,7 @@ if (! defined("_ADODB_FBSQL_LAYER")) {
|
||||
var $databaseType = "fbsql";
|
||||
var $canSeek = true;
|
||||
|
||||
function ADORecordSet_fbsql($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if (!$mode) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -175,7 +177,7 @@ if (! defined("_ADODB_FBSQL_LAYER")) {
|
||||
default:
|
||||
$this->fetchMode = FBSQL_BOTH; break;
|
||||
}
|
||||
return $this->ADORecordSet($queryID);
|
||||
return parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function _initrs()
|
||||
@@ -263,4 +265,3 @@ if (! defined("_ADODB_FBSQL_LAYER")) {
|
||||
|
||||
} //class
|
||||
} // defined
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -21,11 +23,6 @@ class ADODB_firebird extends ADODB_ibase {
|
||||
|
||||
var $sysTimeStamp = "CURRENT_TIMESTAMP"; //"cast('NOW' as timestamp)";
|
||||
|
||||
function ADODB_firebird()
|
||||
{
|
||||
$this->ADODB_ibase();
|
||||
}
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
$arr['dialect'] = $this->dialect;
|
||||
@@ -69,9 +66,8 @@ class ADORecordSet_firebird extends ADORecordSet_ibase {
|
||||
|
||||
var $databaseType = "firebird";
|
||||
|
||||
function ADORecordSet_firebird($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_ibase($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -54,7 +56,7 @@ class ADODB_ibase extends ADOConnection {
|
||||
var $blobEncodeType = 'C';
|
||||
var $role = false;
|
||||
|
||||
function ADODB_ibase()
|
||||
function __construct()
|
||||
{
|
||||
if (defined('IBASE_DEFAULT')) $this->ibasetrans = IBASE_DEFAULT;
|
||||
}
|
||||
@@ -84,8 +86,12 @@ class ADODB_ibase extends ADOConnection {
|
||||
// PHP5 change.
|
||||
if (function_exists('ibase_timefmt')) {
|
||||
ibase_timefmt($this->ibase_datefmt,IBASE_DATE );
|
||||
if ($this->dialect == 1) ibase_timefmt($this->ibase_datefmt,IBASE_TIMESTAMP );
|
||||
else ibase_timefmt($this->ibase_timestampfmt,IBASE_TIMESTAMP );
|
||||
if ($this->dialect == 1) {
|
||||
ibase_timefmt($this->ibase_datefmt,IBASE_TIMESTAMP );
|
||||
}
|
||||
else {
|
||||
ibase_timefmt($this->ibase_timestampfmt,IBASE_TIMESTAMP );
|
||||
}
|
||||
ibase_timefmt($this->ibase_timefmt,IBASE_TIME );
|
||||
|
||||
} else {
|
||||
@@ -95,6 +101,7 @@ class ADODB_ibase extends ADOConnection {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
@@ -104,7 +111,9 @@ class ADODB_ibase extends ADOConnection {
|
||||
|
||||
function MetaPrimaryKeys($table,$owner_notused=false,$internalKey=false)
|
||||
{
|
||||
if ($internalKey) return array('RDB$DB_KEY');
|
||||
if ($internalKey) {
|
||||
return array('RDB$DB_KEY');
|
||||
}
|
||||
|
||||
$table = strtoupper($table);
|
||||
|
||||
@@ -144,9 +153,15 @@ class ADODB_ibase extends ADOConnection {
|
||||
|
||||
function CommitTrans($ok=true)
|
||||
{
|
||||
if (!$ok) return $this->RollbackTrans();
|
||||
if ($this->transOff) return true;
|
||||
if ($this->transCnt) $this->transCnt -= 1;
|
||||
if (!$ok) {
|
||||
return $this->RollbackTrans();
|
||||
}
|
||||
if ($this->transOff) {
|
||||
return true;
|
||||
}
|
||||
if ($this->transCnt) {
|
||||
$this->transCnt -= 1;
|
||||
}
|
||||
$ret = false;
|
||||
$this->autoCommit = true;
|
||||
if ($this->_transactionID) {
|
||||
@@ -180,8 +195,9 @@ class ADODB_ibase extends ADOConnection {
|
||||
if ($this->transCnt) $this->transCnt -= 1;
|
||||
$ret = false;
|
||||
$this->autoCommit = true;
|
||||
if ($this->_transactionID)
|
||||
if ($this->_transactionID) {
|
||||
$ret = ibase_rollback($this->_transactionID);
|
||||
}
|
||||
$this->_transactionID = false;
|
||||
|
||||
return $ret;
|
||||
@@ -219,7 +235,9 @@ class ADODB_ibase extends ADOConnection {
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$index = $row[0];
|
||||
if (!isset($indexes[$index])) {
|
||||
if (is_null($row[3])) {$row[3] = 0;}
|
||||
if (is_null($row[3])) {
|
||||
$row[3] = 0;
|
||||
}
|
||||
$indexes[$index] = array(
|
||||
'unique' => ($row[3] == 1),
|
||||
'columns' => array()
|
||||
@@ -244,20 +262,22 @@ class ADODB_ibase extends ADOConnection {
|
||||
// See http://community.borland.com/article/0,1410,25844,00.html
|
||||
function RowLock($tables,$where,$col=false)
|
||||
{
|
||||
if ($this->autoCommit) $this->BeginTrans();
|
||||
if ($this->autoCommit) {
|
||||
$this->BeginTrans();
|
||||
}
|
||||
$this->Execute("UPDATE $table SET $col=$col WHERE $where "); // is this correct - jlim?
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
function CreateSequence($seqname,$startID=1)
|
||||
function CreateSequence($seqname = 'adodbseq', $startID = 1)
|
||||
{
|
||||
$ok = $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" ));
|
||||
if (!$ok) return false;
|
||||
return $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';');
|
||||
}
|
||||
|
||||
function DropSequence($seqname)
|
||||
function DropSequence($seqname = 'adodbseq')
|
||||
{
|
||||
$seqname = strtoupper($seqname);
|
||||
$this->Execute("delete from RDB\$GENERATORS where RDB\$GENERATOR_NAME='$seqname'");
|
||||
@@ -272,10 +292,16 @@ class ADODB_ibase extends ADOConnection {
|
||||
$this->Execute("SET GENERATOR $seqname TO ".($startID-1).';');
|
||||
$rs = $this->Execute($getnext);
|
||||
}
|
||||
if ($rs && !$rs->EOF) $this->genID = (integer) reset($rs->fields);
|
||||
else $this->genID = 0; // false
|
||||
if ($rs && !$rs->EOF) {
|
||||
$this->genID = (integer) reset($rs->fields);
|
||||
}
|
||||
else {
|
||||
$this->genID = 0; // false
|
||||
}
|
||||
|
||||
if ($rs) $rs->Close();
|
||||
if ($rs) {
|
||||
$rs->Close();
|
||||
}
|
||||
|
||||
return $this->genID;
|
||||
}
|
||||
@@ -365,7 +391,9 @@ class ADODB_ibase extends ADOConnection {
|
||||
}
|
||||
} else $ret = $fn($conn,$sql);
|
||||
}
|
||||
if ($docommit && $ret === true) ibase_commit($this->_connectionID);
|
||||
if ($docommit && $ret === true) {
|
||||
ibase_commit($this->_connectionID);
|
||||
}
|
||||
|
||||
$this->_handleerror();
|
||||
return $ret;
|
||||
@@ -374,7 +402,9 @@ class ADODB_ibase extends ADOConnection {
|
||||
// returns true or false
|
||||
function _close()
|
||||
{
|
||||
if (!$this->autoCommit) @ibase_rollback($this->_connectionID);
|
||||
if (!$this->autoCommit) {
|
||||
@ibase_rollback($this->_connectionID);
|
||||
}
|
||||
return @ibase_close($this->_connectionID);
|
||||
}
|
||||
|
||||
@@ -475,6 +505,7 @@ class ADODB_ibase extends ADOConnection {
|
||||
} // switch
|
||||
}
|
||||
//OPN STUFF end
|
||||
|
||||
// returns array of ADOFieldObjects for current table
|
||||
function MetaColumns($table, $normalize=true)
|
||||
{
|
||||
@@ -730,12 +761,12 @@ class ADORecordset_ibase extends ADORecordSet
|
||||
var $bind=false;
|
||||
var $_cacheType;
|
||||
|
||||
function ADORecordset_ibase($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
$this->fetchMode = ($mode === false) ? $ADODB_FETCH_MODE : $mode;
|
||||
$this->ADORecordSet($id);
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
/* Returns: an object containing field information.
|
||||
@@ -747,18 +778,19 @@ class ADORecordset_ibase extends ADORecordSet
|
||||
{
|
||||
$fld = new ADOFieldObject;
|
||||
$ibf = ibase_field_info($this->_queryID,$fieldOffset);
|
||||
|
||||
$name = empty($ibf['alias']) ? $ibf['name'] : $ibf['alias'];
|
||||
|
||||
switch (ADODB_ASSOC_CASE) {
|
||||
case 2: // the default
|
||||
$fld->name = ($ibf['alias']);
|
||||
if (empty($fld->name)) $fld->name = ($ibf['name']);
|
||||
case ADODB_ASSOC_CASE_UPPER:
|
||||
$fld->name = strtoupper($name);
|
||||
break;
|
||||
case 0:
|
||||
$fld->name = strtoupper($ibf['alias']);
|
||||
if (empty($fld->name)) $fld->name = strtoupper($ibf['name']);
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
$fld->name = strtolower($name);
|
||||
break;
|
||||
case 1:
|
||||
$fld->name = strtolower($ibf['alias']);
|
||||
if (empty($fld->name)) $fld->name = strtolower($ibf['name']);
|
||||
case ADODB_ASSOC_CASE_NATIVE:
|
||||
default:
|
||||
$fld->name = $name;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -822,9 +854,9 @@ class ADORecordset_ibase extends ADORecordSet
|
||||
|
||||
$this->fields = $f;
|
||||
if ($this->fetchMode == ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
} else if ($this->fetchMode == ADODB_FETCH_BOTH) {
|
||||
$this->fields = array_merge($this->fields,$this->GetRowAssoc(ADODB_ASSOC_CASE));
|
||||
$this->fields = array_merge($this->fields,$this->GetRowAssoc());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -884,4 +916,3 @@ class ADORecordset_ibase extends ADORecordSet
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -32,9 +34,8 @@ class ADODB_informix extends ADODB_informix72 {
|
||||
class ADORecordset_informix extends ADORecordset_informix72 {
|
||||
var $databaseType = "informix";
|
||||
|
||||
function ADORecordset_informix($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordset_informix72($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim. All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -54,7 +56,7 @@ class ADODB_informix72 extends ADOConnection {
|
||||
var $sysTimeStamp = 'CURRENT';
|
||||
var $cursorType = IFX_SCROLL; // IFX_SCROLL or IFX_HOLD or 0
|
||||
|
||||
function ADODB_informix72()
|
||||
function __construct()
|
||||
{
|
||||
// alternatively, use older method:
|
||||
//putenv("DBDATE=Y4MD-");
|
||||
@@ -123,7 +125,7 @@ class ADODB_informix72 extends ADOConnection {
|
||||
return true;
|
||||
}
|
||||
|
||||
function RowLock($tables,$where,$col='1 as ignore')
|
||||
function RowLock($tables,$where,$col='1 as adodbignore')
|
||||
{
|
||||
if ($this->_autocommit) $this->BeginTrans();
|
||||
return $this->GetOne("select $col from $tables where $where for update");
|
||||
@@ -147,6 +149,51 @@ class ADODB_informix72 extends ADOConnection {
|
||||
}
|
||||
|
||||
|
||||
function MetaProcedures($NamePattern = false, $catalog = null, $schemaPattern = null)
|
||||
{
|
||||
// save old fetch mode
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
$false = false;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
if ($this->fetchMode !== FALSE) {
|
||||
$savem = $this->SetFetchMode(FALSE);
|
||||
|
||||
}
|
||||
$procedures = array ();
|
||||
|
||||
// get index details
|
||||
|
||||
$likepattern = '';
|
||||
if ($NamePattern) {
|
||||
$likepattern = " WHERE procname LIKE '".$NamePattern."'";
|
||||
}
|
||||
|
||||
$rs = $this->Execute('SELECT procname, isproc FROM sysprocedures'.$likepattern);
|
||||
|
||||
if (is_object($rs)) {
|
||||
// parse index data into array
|
||||
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$procedures[$row[0]] = array(
|
||||
'type' => ($row[1] == 'f' ? 'FUNCTION' : 'PROCEDURE'),
|
||||
'catalog' => '',
|
||||
'schema' => '',
|
||||
'remarks' => ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// restore fetchmode
|
||||
if (isset($savem)) {
|
||||
$this->SetFetchMode($savem);
|
||||
}
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
return $procedures;
|
||||
}
|
||||
|
||||
function MetaColumns($table, $normalize=true)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -331,8 +378,11 @@ class ADODB_informix72 extends ADOConnection {
|
||||
function _close()
|
||||
{
|
||||
$this->lastQuery = false;
|
||||
if($this->_connectionID) {
|
||||
return ifx_close($this->_connectionID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -346,14 +396,14 @@ class ADORecordset_informix72 extends ADORecordSet {
|
||||
var $canSeek = true;
|
||||
var $_fieldprops = false;
|
||||
|
||||
function ADORecordset_informix72($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
$this->fetchMode = $mode;
|
||||
return $this->ADORecordSet($id);
|
||||
return parent::__construct($id);
|
||||
}
|
||||
|
||||
|
||||
@@ -443,8 +493,11 @@ class ADORecordset_informix72 extends ADORecordSet {
|
||||
is running. All associated result memory for the specified result identifier will automatically be freed. */
|
||||
function _close()
|
||||
{
|
||||
if($this->_queryID) {
|
||||
return ifx_free_result($this->_queryID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
/** !Eos
|
||||
@@ -470,6 +523,3 @@ function ifx_props($coltype,$collength){
|
||||
}
|
||||
return array($mtype,$length,$precision,$nullable);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -43,7 +45,7 @@ class ADODB_ldap extends ADOConnection {
|
||||
# error on binding, eg. "Binding: invalid credentials"
|
||||
var $_bind_errmsg = "Binding: %s";
|
||||
|
||||
function ADODB_ldap()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -55,7 +57,7 @@ class ADODB_ldap extends ADOConnection {
|
||||
|
||||
if ( !function_exists( 'ldap_connect' ) ) return null;
|
||||
|
||||
if (strpos('ldap://',$host) === 0 || strpos('ldaps://',$host) === 0) {
|
||||
if (strpos($host,'ldap://') === 0 || strpos($host,'ldaps://') === 0) {
|
||||
$this->_connectionID = @ldap_connect($host);
|
||||
} else {
|
||||
$conn_info = array( $host,$this->port);
|
||||
@@ -185,7 +187,10 @@ class ADODB_ldap extends ADOConnection {
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
if( !empty( $this->version ) ) return $this->version;
|
||||
if( !empty( $this->version ) ) {
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
$version = array();
|
||||
/*
|
||||
Determines how aliases are handled during search.
|
||||
@@ -241,8 +246,8 @@ class ADODB_ldap extends ADOConnection {
|
||||
$version['LDAP_OPT_REFERRALS'] = 'LDAP_OPT_OFF';
|
||||
} else {
|
||||
$version['LDAP_OPT_REFERRALS'] = 'LDAP_OPT_ON';
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Determines whether LDAP I/O operations are automatically restarted if they abort prematurely.
|
||||
LDAP_OPT_ON
|
||||
@@ -254,8 +259,8 @@ class ADODB_ldap extends ADOConnection {
|
||||
$version['LDAP_OPT_RESTART'] = 'LDAP_OPT_OFF';
|
||||
} else {
|
||||
$version['LDAP_OPT_RESTART'] = 'LDAP_OPT_ON';
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
This option indicates the version of the LDAP protocol used when communicating with the primary LDAP server.
|
||||
LDAP_VERSION2 (2)
|
||||
@@ -267,8 +272,8 @@ class ADODB_ldap extends ADOConnection {
|
||||
$version['LDAP_OPT_PROTOCOL_VERSION'] = 'LDAP_VERSION2';
|
||||
} else {
|
||||
$version['LDAP_OPT_PROTOCOL_VERSION'] = 'LDAP_VERSION3';
|
||||
|
||||
}
|
||||
|
||||
/* The host name (or list of hosts) for the primary LDAP server. */
|
||||
ldap_get_option( $this->_connectionID, LDAP_OPT_HOST_NAME, $version['LDAP_OPT_HOST_NAME'] );
|
||||
ldap_get_option( $this->_connectionID, LDAP_OPT_ERROR_NUMBER, $version['LDAP_OPT_ERROR_NUMBER'] );
|
||||
@@ -276,7 +281,6 @@ class ADODB_ldap extends ADOConnection {
|
||||
ldap_get_option( $this->_connectionID, LDAP_OPT_MATCHED_DN, $version['LDAP_OPT_MATCHED_DN'] );
|
||||
|
||||
return $this->version = $version;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +294,7 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
var $canSeek = false;
|
||||
var $_entryID; /* keeps track of the entry resource identifier */
|
||||
|
||||
function ADORecordSet_ldap($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -311,7 +315,7 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
break;
|
||||
}
|
||||
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function _initrs()
|
||||
@@ -322,7 +326,6 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
GetAssoc() function
|
||||
*/
|
||||
$this->_numOfRows = ldap_count_entries( $this->connection->_connectionID, $this->_queryID );
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -348,7 +351,7 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
return $results;
|
||||
}
|
||||
|
||||
function GetRowAssoc()
|
||||
function GetRowAssoc($upper = ADODB_ASSOC_CASE)
|
||||
{
|
||||
$results = array();
|
||||
foreach ( $this->fields as $k=>$v ) {
|
||||
@@ -385,8 +388,9 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
|
||||
function _fetch()
|
||||
{
|
||||
if ( $this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0 )
|
||||
if ( $this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $this->_currentRow == 0 ) {
|
||||
$this->_entryID = ldap_first_entry( $this->connection->_connectionID, $this->_queryID );
|
||||
@@ -396,6 +400,7 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
|
||||
$this->fields = ldap_get_attributes( $this->connection->_connectionID, $this->_entryID );
|
||||
$this->_numOfFields = $this->fields['count'];
|
||||
|
||||
switch ( $this->fetchMode ) {
|
||||
|
||||
case LDAP_ASSOC:
|
||||
@@ -411,7 +416,8 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
$this->fields = $this->GetRowNums();
|
||||
break;
|
||||
}
|
||||
return ( is_array( $this->fields ) );
|
||||
|
||||
return is_array( $this->fields );
|
||||
}
|
||||
|
||||
function _close() {
|
||||
@@ -420,4 +426,3 @@ class ADORecordSet_ldap extends ADORecordSet{
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -76,7 +78,7 @@ class ADODB_mssql extends ADOConnection {
|
||||
var $dataProvider = "mssql";
|
||||
var $replaceQuote = "''"; // string to use to replace quotes
|
||||
var $fmtDate = "'Y-m-d'";
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $fmtTimeStamp = "'Y-m-d\TH:i:s'";
|
||||
var $hasInsertID = true;
|
||||
var $substr = "substring";
|
||||
var $length = 'len';
|
||||
@@ -84,7 +86,7 @@ class ADODB_mssql extends ADOConnection {
|
||||
var $metaDatabasesSQL = "select name from sysdatabases where name <> 'master'";
|
||||
var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE','dtproperties'))";
|
||||
var $metaColumnsSQL = # xtype==61 is datetime
|
||||
"select c.name,t.name,c.length,
|
||||
"select c.name,t.name,c.length,c.isnullable, c.status,
|
||||
(case when c.xusertype=61 then 0 else c.xprec end),
|
||||
(case when c.xusertype=61 then 0 else c.xscale end)
|
||||
from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
|
||||
@@ -105,7 +107,7 @@ class ADODB_mssql extends ADOConnection {
|
||||
var $_bindInputArray = true;
|
||||
var $forceNewConnect = false;
|
||||
|
||||
function ADODB_mssql()
|
||||
function __construct()
|
||||
{
|
||||
$this->_has_mssql_init = (strnatcmp(PHP_VERSION,'4.1.0')>=0);
|
||||
}
|
||||
@@ -180,7 +182,7 @@ class ADODB_mssql extends ADOConnection {
|
||||
}
|
||||
|
||||
// undo magic quotes for " unless sybase is on
|
||||
$sybase = @ini_get('magic_quotes_sybase');
|
||||
$sybase = ini_get('magic_quotes_sybase');
|
||||
if (!$sybase) {
|
||||
$s = str_replace('\\"','"',$s);
|
||||
if ($this->replaceQuote == "\\'") // ' already quoted, no need to change anything
|
||||
@@ -366,13 +368,72 @@ class ADODB_mssql extends ADOConnection {
|
||||
|
||||
See http://www.swynk.com/friends/achigrik/SQL70Locks.asp
|
||||
*/
|
||||
function RowLock($tables,$where,$col='top 1 null as ignore')
|
||||
function RowLock($tables,$where,$col='1 as adodbignore')
|
||||
{
|
||||
if ($col == '1 as adodbignore') $col = 'top 1 null as ignore';
|
||||
if (!$this->transCnt) $this->BeginTrans();
|
||||
return $this->GetOne("select $col from $tables with (ROWLOCK,HOLDLOCK) where $where");
|
||||
}
|
||||
|
||||
|
||||
function MetaColumns($table, $normalize=true)
|
||||
{
|
||||
// $arr = ADOConnection::MetaColumns($table);
|
||||
// return $arr;
|
||||
|
||||
$this->_findschema($table,$schema);
|
||||
if ($schema) {
|
||||
$dbName = $this->database;
|
||||
$this->SelectDB($schema);
|
||||
}
|
||||
global $ADODB_FETCH_MODE;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
|
||||
if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
|
||||
$rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
|
||||
|
||||
if ($schema) {
|
||||
$this->SelectDB($dbName);
|
||||
}
|
||||
|
||||
if (isset($savem)) $this->SetFetchMode($savem);
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
if (!is_object($rs)) {
|
||||
$false = false;
|
||||
return $false;
|
||||
}
|
||||
|
||||
$retarr = array();
|
||||
while (!$rs->EOF){
|
||||
$fld = new ADOFieldObject();
|
||||
$fld->name = $rs->fields[0];
|
||||
$fld->type = $rs->fields[1];
|
||||
|
||||
$fld->not_null = (!$rs->fields[3]);
|
||||
$fld->auto_increment = ($rs->fields[4] == 128); // sys.syscolumns status field. 0x80 = 128 ref: http://msdn.microsoft.com/en-us/library/ms186816.aspx
|
||||
|
||||
if (isset($rs->fields[5]) && $rs->fields[5]) {
|
||||
if ($rs->fields[5]>0) $fld->max_length = $rs->fields[5];
|
||||
$fld->scale = $rs->fields[6];
|
||||
if ($fld->scale>0) $fld->max_length += 1;
|
||||
} else
|
||||
$fld->max_length = $rs->fields[2];
|
||||
|
||||
if ($save == ADODB_FETCH_NUM) {
|
||||
$retarr[] = $fld;
|
||||
} else {
|
||||
$retarr[strtoupper($fld->name)] = $fld;
|
||||
}
|
||||
$rs->MoveNext();
|
||||
}
|
||||
|
||||
$rs->Close();
|
||||
return $retarr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function MetaIndexes($table,$primary=false, $owner=false)
|
||||
{
|
||||
$table = $this->qstr($table);
|
||||
@@ -476,7 +537,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
// "Stein-Aksel Basma" <basma@accelero.no>
|
||||
// tested with MSSQL 2000
|
||||
function MetaPrimaryKeys($table)
|
||||
function MetaPrimaryKeys($table, $owner=false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -591,7 +652,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
return array($sql,$this->qstr($sql2),$max,$sql2);
|
||||
}
|
||||
|
||||
function PrepareSP($sql)
|
||||
function PrepareSP($sql,$param=true)
|
||||
{
|
||||
if (!$this->_has_mssql_init) {
|
||||
ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
|
||||
@@ -806,7 +867,7 @@ class ADORecordset_mssql extends ADORecordSet {
|
||||
var $hasFetchAssoc; // see http://phplens.com/lens/lensforum/msgs.php?id=6083
|
||||
// _mths works only in non-localised system
|
||||
|
||||
function ADORecordset_mssql($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
// freedts check...
|
||||
$this->hasFetchAssoc = function_exists('mssql_fetch_assoc');
|
||||
@@ -817,7 +878,7 @@ class ADORecordset_mssql extends ADORecordSet {
|
||||
|
||||
}
|
||||
$this->fetchMode = $mode;
|
||||
return $this->ADORecordSet($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
|
||||
@@ -911,11 +972,19 @@ class ADORecordset_mssql extends ADORecordSet {
|
||||
if (is_array($this->fields)) {
|
||||
if (ADODB_ASSOC_CASE == 0) {
|
||||
foreach($this->fields as $k=>$v) {
|
||||
$this->fields[strtolower($k)] = $v;
|
||||
$kn = strtolower($k);
|
||||
if ($kn <> $k) {
|
||||
unset($this->fields[$k]);
|
||||
$this->fields[$kn] = $v;
|
||||
}
|
||||
}
|
||||
} else if (ADODB_ASSOC_CASE == 1) {
|
||||
foreach($this->fields as $k=>$v) {
|
||||
$this->fields[strtoupper($k)] = $v;
|
||||
$kn = strtoupper($k);
|
||||
if ($kn <> $k) {
|
||||
unset($this->fields[$k]);
|
||||
$this->fields[$kn] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -956,11 +1025,19 @@ class ADORecordset_mssql extends ADORecordSet {
|
||||
if (!$this->fields) {
|
||||
} else if (ADODB_ASSOC_CASE == 0) {
|
||||
foreach($this->fields as $k=>$v) {
|
||||
$this->fields[strtolower($k)] = $v;
|
||||
$kn = strtolower($k);
|
||||
if ($kn <> $k) {
|
||||
unset($this->fields[$k]);
|
||||
$this->fields[$kn] = $v;
|
||||
}
|
||||
}
|
||||
} else if (ADODB_ASSOC_CASE == 1) {
|
||||
foreach($this->fields as $k=>$v) {
|
||||
$this->fields[strtoupper($k)] = $v;
|
||||
$kn = strtoupper($k);
|
||||
if ($kn <> $k) {
|
||||
unset($this->fields[$k]);
|
||||
$this->fields[$kn] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -974,10 +1051,14 @@ class ADORecordset_mssql extends ADORecordSet {
|
||||
|
||||
function _close()
|
||||
{
|
||||
if($this->_queryID) {
|
||||
$rez = mssql_free_result($this->_queryID);
|
||||
$this->_queryID = false;
|
||||
return $rez;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// mssql uses a default date like Dec 30 2000 12:00AM
|
||||
static function UnixDate($v)
|
||||
{
|
||||
@@ -993,9 +1074,9 @@ class ADORecordset_mssql extends ADORecordSet {
|
||||
|
||||
|
||||
class ADORecordSet_array_mssql extends ADORecordSet_array {
|
||||
function ADORecordSet_array_mssql($id=-1,$mode=false)
|
||||
function __construct($id=-1,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_array($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
// mssql uses a default date like Dec 30 2000 12:00AM
|
||||
@@ -1095,5 +1176,3 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
|
||||
|
||||
http://www.databasejournal.com/scripts/article.php/1440551
|
||||
*/
|
||||
|
||||
?>
|
||||
@@ -9,7 +9,7 @@
|
||||
// ADOdb - Database Abstraction Library for PHP //
|
||||
// http://adodb.sourceforge.net/ //
|
||||
// //
|
||||
// Copyright (C) 2000-2009 John Lim (jlim\@natsoft.com.my) //
|
||||
// Copyright (c) 2000-2014 John Lim (jlim\@natsoft.com.my) //
|
||||
// All rights reserved. //
|
||||
// Released under both BSD license and LGPL library license. //
|
||||
// Whenever there is any discrepancy between the two licenses, //
|
||||
@@ -53,11 +53,6 @@ include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php');
|
||||
class ADODB_mssql_n extends ADODB_mssql {
|
||||
var $databaseType = "mssql_n";
|
||||
|
||||
function ADODB_mssqlpo()
|
||||
{
|
||||
ADODB_mssql::ADODB_mssql();
|
||||
}
|
||||
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
$sql = $this->_appendN($sql);
|
||||
@@ -70,102 +65,185 @@ class ADODB_mssql_n extends ADODB_mssql {
|
||||
* and ODBTP) keeping SQL compatibility at ADOdb level (instead of hacking every project to add
|
||||
* the "N" notation when working against MSSQL.
|
||||
*
|
||||
* Note that this hack only must be used if ALL the char-based columns in your DB are of type nchar,
|
||||
* nvarchar and ntext
|
||||
* The orginal note indicated that this hack should only be used if ALL the char-based columns
|
||||
* in your DB are of type nchar, nvarchar and ntext, but testing seems to indicate that SQL server
|
||||
* doesn't seem to care if the statement is used against char etc fields.
|
||||
*
|
||||
* @todo This function should raise an ADOdb error if one of the transformations fail
|
||||
*
|
||||
* @param mixed $inboundData Either a string containing an SQL statement
|
||||
* or an array with resources from prepared statements
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function _appendN($sql) {
|
||||
function _appendN($inboundData) {
|
||||
|
||||
$result = $sql;
|
||||
$inboundIsArray = false;
|
||||
|
||||
/// Check we have some single quote in the query. Exit ok.
|
||||
if (strpos($sql, SINGLEQUOTE) === false) {
|
||||
return $sql;
|
||||
if (is_array($inboundData))
|
||||
{
|
||||
$inboundIsArray = true;
|
||||
$inboundArray = $inboundData;
|
||||
} else
|
||||
$inboundArray = (array)$inboundData;
|
||||
|
||||
/*
|
||||
* All changes will be placed here
|
||||
*/
|
||||
$outboundArray = $inboundArray;
|
||||
|
||||
foreach($inboundArray as $inboundKey=>$inboundValue)
|
||||
{
|
||||
|
||||
if (is_resource($inboundValue))
|
||||
{
|
||||
/*
|
||||
* Prepared statement resource
|
||||
*/
|
||||
if ($this->debug)
|
||||
ADOConnection::outp("{$this->databaseType} index $inboundKey value is resource, continue");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/// Check we haven't an odd number of single quotes (this can cause problems below
|
||||
/// and should be considered one wrong SQL). Exit with debug info.
|
||||
if ((substr_count($sql, SINGLEQUOTE) & 1)) {
|
||||
if ($this->debug) {
|
||||
if (strpos($inboundValue, SINGLEQUOTE) === false)
|
||||
{
|
||||
/*
|
||||
* Check we have something to manipulate
|
||||
*/
|
||||
if ($this->debug)
|
||||
ADOConnection::outp("{$this->databaseType} index $inboundKey value $inboundValue has no single quotes, continue");
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check we haven't an odd number of single quotes (this can cause problems below
|
||||
* and should be considered one wrong SQL). Exit with debug info.
|
||||
*/
|
||||
if ((substr_count($inboundValue, SINGLEQUOTE) & 1))
|
||||
{
|
||||
if ($this->debug)
|
||||
ADOConnection::outp("{$this->databaseType} internal transformation: not converted. Wrong number of quotes (odd)");
|
||||
}
|
||||
return $sql;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/// Check we haven't any backslash + single quote combination. It should mean wrong
|
||||
/// backslashes use (bad magic_quotes_sybase?). Exit with debug info.
|
||||
/*
|
||||
* Check we haven't any backslash + single quote combination. It should mean wrong
|
||||
* backslashes use (bad magic_quotes_sybase?). Exit with debug info.
|
||||
*/
|
||||
$regexp = '/(\\\\' . SINGLEQUOTE . '[^' . SINGLEQUOTE . '])/';
|
||||
if (preg_match($regexp, $sql)) {
|
||||
if ($this->debug) {
|
||||
if (preg_match($regexp, $inboundValue))
|
||||
{
|
||||
if ($this->debug)
|
||||
ADOConnection::outp("{$this->databaseType} internal transformation: not converted. Found bad use of backslash + single quote");
|
||||
}
|
||||
return $sql;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/// Remove pairs of single-quotes
|
||||
/*
|
||||
* Remove pairs of single-quotes
|
||||
*/
|
||||
$pairs = array();
|
||||
$regexp = '/(' . SINGLEQUOTE . SINGLEQUOTE . ')/';
|
||||
preg_match_all($regexp, $result, $list_of_pairs);
|
||||
if ($list_of_pairs) {
|
||||
foreach (array_unique($list_of_pairs[0]) as $key=>$value) {
|
||||
preg_match_all($regexp, $inboundValue, $list_of_pairs);
|
||||
|
||||
if ($list_of_pairs)
|
||||
{
|
||||
foreach (array_unique($list_of_pairs[0]) as $key=>$value)
|
||||
$pairs['<@#@#@PAIR-'.$key.'@#@#@>'] = $value;
|
||||
}
|
||||
if (!empty($pairs)) {
|
||||
$result = str_replace($pairs, array_keys($pairs), $result);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($pairs))
|
||||
$inboundValue = str_replace($pairs, array_keys($pairs), $inboundValue);
|
||||
|
||||
}
|
||||
|
||||
/// Remove the rest of literals present in the query
|
||||
/*
|
||||
* Remove the rest of literals present in the query
|
||||
*/
|
||||
$literals = array();
|
||||
$regexp = '/(N?' . SINGLEQUOTE . '.*?' . SINGLEQUOTE . ')/is';
|
||||
preg_match_all($regexp, $result, $list_of_literals);
|
||||
if ($list_of_literals) {
|
||||
foreach (array_unique($list_of_literals[0]) as $key=>$value) {
|
||||
preg_match_all($regexp, $inboundValue, $list_of_literals);
|
||||
|
||||
if ($list_of_literals)
|
||||
{
|
||||
foreach (array_unique($list_of_literals[0]) as $key=>$value)
|
||||
$literals['<#@#@#LITERAL-'.$key.'#@#@#>'] = $value;
|
||||
}
|
||||
if (!empty($literals)) {
|
||||
$result = str_replace($literals, array_keys($literals), $result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Analyse literals to prepend the N char to them if their contents aren't numeric
|
||||
if (!empty($literals)) {
|
||||
if (!empty($literals))
|
||||
$inboundValue = str_replace($literals, array_keys($literals), $inboundValue);
|
||||
}
|
||||
|
||||
/*
|
||||
* Analyse literals to prepend the N char to them if their contents aren't numeric
|
||||
*/
|
||||
if (!empty($literals))
|
||||
{
|
||||
foreach ($literals as $key=>$value) {
|
||||
if (!is_numeric(trim($value, SINGLEQUOTE))) {
|
||||
/// Non numeric string, prepend our dear N
|
||||
$literals[$key] = 'N' . trim($value, 'N'); //Trimming potentially existing previous "N"
|
||||
}
|
||||
if (!is_numeric(trim($value, SINGLEQUOTE)))
|
||||
/*
|
||||
* Non numeric string, prepend our dear N, whilst
|
||||
* Trimming potentially existing previous "N"
|
||||
*/
|
||||
$literals[$key] = 'N' . trim($value, 'N');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// Re-apply literals to the text
|
||||
if (!empty($literals)) {
|
||||
$result = str_replace(array_keys($literals), $literals, $result);
|
||||
/*
|
||||
* Re-apply literals to the text
|
||||
*/
|
||||
if (!empty($literals))
|
||||
$inboundValue = str_replace(array_keys($literals), $literals, $inboundValue);
|
||||
|
||||
|
||||
/*
|
||||
* Any pairs followed by N' must be switched to N' followed by those pairs
|
||||
* (or strings beginning with single quotes will fail)
|
||||
*/
|
||||
$inboundValue = preg_replace("/((<@#@#@PAIR-(\d+)@#@#@>)+)N'/", "N'$1", $inboundValue);
|
||||
|
||||
/*
|
||||
* Re-apply pairs of single-quotes to the text
|
||||
*/
|
||||
if (!empty($pairs))
|
||||
$inboundValue = str_replace(array_keys($pairs), $pairs, $inboundValue);
|
||||
|
||||
|
||||
/*
|
||||
* Print transformation if debug = on
|
||||
*/
|
||||
if (strcmp($inboundValue,$inboundArray[$inboundKey]) <> 0 && $this->debug)
|
||||
ADOConnection::outp("{$this->databaseType} internal transformation: {$inboundArray[$inboundKey]} to {$inboundValue}");
|
||||
|
||||
if (strcmp($inboundValue,$inboundArray[$inboundKey]) <> 0)
|
||||
/*
|
||||
* Place the transformed value into the outbound array
|
||||
*/
|
||||
$outboundArray[$inboundKey] = $inboundValue;
|
||||
}
|
||||
|
||||
/// Any pairs followed by N' must be switched to N' followed by those pairs
|
||||
/// (or strings beginning with single quotes will fail)
|
||||
$result = preg_replace("/((<@#@#@PAIR-(\d+)@#@#@>)+)N'/", "N'$1", $result);
|
||||
/*
|
||||
* Any transformations are in the $outboundArray
|
||||
*/
|
||||
if ($inboundIsArray)
|
||||
return $outboundArray;
|
||||
|
||||
/*
|
||||
* We passed a string in originally
|
||||
*/
|
||||
return $outboundArray[0];
|
||||
|
||||
/// Re-apply pairs of single-quotes to the text
|
||||
if (!empty($pairs)) {
|
||||
$result = str_replace(array_keys($pairs), $pairs, $result);
|
||||
}
|
||||
|
||||
/// Print transformation if debug = on
|
||||
if ($result != $sql && $this->debug) {
|
||||
ADOConnection::outp("{$this->databaseType} internal transformation:<br>{$sql}<br>to<br>{$result}");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
class ADORecordset_mssql_n extends ADORecordset_mssql {
|
||||
var $databaseType = "mssql_n";
|
||||
function ADORecordset_mssql_n($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordset_mssql($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -78,32 +80,12 @@ if (ADODB_PHPVER >= 0x4300) {
|
||||
'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Call this to autoset $ADODB_mssql_date_order at the beginning of your code,
|
||||
// just after you connect to the database. Supports mdy and dmy only.
|
||||
// Not required for PHP 4.2.0 and above.
|
||||
function AutoDetect_MSSQL_Date_Order($conn)
|
||||
{
|
||||
global $ADODB_mssql_date_order;
|
||||
$adate = $conn->GetOne('select getdate()');
|
||||
if ($adate) {
|
||||
$anum = (int) $adate;
|
||||
if ($anum > 0) {
|
||||
if ($anum > 31) {
|
||||
//ADOConnection::outp( "MSSQL: YYYY-MM-DD date format not supported currently");
|
||||
} else
|
||||
$ADODB_mssql_date_order = 'dmy';
|
||||
} else
|
||||
$ADODB_mssql_date_order = 'mdy';
|
||||
}
|
||||
}
|
||||
|
||||
class ADODB_mssqlnative extends ADOConnection {
|
||||
var $databaseType = "mssqlnative";
|
||||
var $dataProvider = "mssqlnative";
|
||||
var $replaceQuote = "''"; // string to use to replace quotes
|
||||
var $fmtDate = "'Y-m-d'";
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $fmtTimeStamp = "'Y-m-d\TH:i:s'";
|
||||
var $hasInsertID = true;
|
||||
var $substr = "substring";
|
||||
var $length = 'len';
|
||||
@@ -111,11 +93,23 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
var $poorAffectedRows = false;
|
||||
var $metaDatabasesSQL = "select name from sys.sysdatabases where name <> 'master'";
|
||||
var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE','dtproperties'))";
|
||||
var $metaColumnsSQL = # xtype==61 is datetime
|
||||
"select c.name,t.name,c.length,
|
||||
(case when c.xusertype=61 then 0 else c.xprec end),
|
||||
(case when c.xusertype=61 then 0 else c.xscale end)
|
||||
from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
|
||||
var $metaColumnsSQL =
|
||||
"select c.name,
|
||||
t.name as type,
|
||||
c.length,
|
||||
c.xprec as precision,
|
||||
c.xscale as scale,
|
||||
c.isnullable as nullable,
|
||||
c.cdefault as default_value,
|
||||
c.xtype,
|
||||
t.length as type_length,
|
||||
sc.is_identity
|
||||
from syscolumns c
|
||||
join systypes t on t.xusertype=c.xusertype
|
||||
join sysobjects o on o.id=c.id
|
||||
join sys.tables st on st.name=o.name
|
||||
join sys.columns sc on sc.object_id = st.object_id and sc.name=c.name
|
||||
where o.name='%s'";
|
||||
var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE
|
||||
var $hasGenID = true;
|
||||
var $sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
|
||||
@@ -130,32 +124,61 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
var $uniqueOrderBy = true;
|
||||
var $_bindInputArray = true;
|
||||
var $_dropSeqSQL = "drop table %s";
|
||||
var $connectionInfo = array();
|
||||
var $sequences = false;
|
||||
var $mssql_version = '';
|
||||
|
||||
function ADODB_mssqlnative()
|
||||
function __construct()
|
||||
{
|
||||
if ($this->debug) {
|
||||
error_log("<pre>");
|
||||
ADOConnection::outp("<pre>");
|
||||
sqlsrv_set_error_handling( SQLSRV_ERRORS_LOG_ALL );
|
||||
sqlsrv_log_set_severity( SQLSRV_LOG_SEVERITY_ALL );
|
||||
sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
|
||||
sqlsrv_configure('warnings_return_as_errors', 0);
|
||||
sqlsrv_configure('WarningsReturnAsErrors', 0);
|
||||
} else {
|
||||
sqlsrv_set_error_handling(0);
|
||||
sqlsrv_log_set_severity(0);
|
||||
sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
|
||||
sqlsrv_configure('warnings_return_as_errors', 0);
|
||||
sqlsrv_configure('WarningsReturnAsErrors', 0);
|
||||
}
|
||||
}
|
||||
function ServerVersion() {
|
||||
$data = $this->ServerInfo();
|
||||
if (preg_match('/^09/',$data['version'])){
|
||||
/*
|
||||
* SQL Server 2005
|
||||
*/
|
||||
$this->mssql_version = 9;
|
||||
} elseif (preg_match('/^10/',$data['version'])){
|
||||
/*
|
||||
* SQL Server 2008
|
||||
*/
|
||||
$this->mssql_version = 10;
|
||||
} elseif (preg_match('/^11/',$data['version'])){
|
||||
/*
|
||||
* SQL Server 2012
|
||||
*/
|
||||
$this->mssql_version = 11;
|
||||
} else
|
||||
die("SQL SERVER VERSION {$data['version']} NOT SUPPORTED IN mssqlnative DRIVER");
|
||||
}
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
function ServerInfo() {
|
||||
global $ADODB_FETCH_MODE;
|
||||
static $arr = false;
|
||||
if (is_array($arr))
|
||||
return $arr;
|
||||
if ($this->fetchMode === false) {
|
||||
$savem = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
} elseif ($this->fetchMode >=0 && $this->fetchMode <=2) {
|
||||
$savem = $this->fetchMode;
|
||||
} else
|
||||
$savem = $this->SetFetchMode(ADODB_FETCH_NUM);
|
||||
|
||||
$arrServerInfo = sqlsrv_server_info($this->_connectionID);
|
||||
$ADODB_FETCH_MODE = $savem;
|
||||
$arr['description'] = $arrServerInfo['SQLServerName'].' connected to '.$arrServerInfo['CurrentDatabase'];
|
||||
$arr['version'] = $arrServerInfo['SQLServerVersion'];//ADOConnection::_findvers($arr['description']);
|
||||
return $arr;
|
||||
@@ -173,23 +196,58 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
// the same scope. A scope is a module -- a stored procedure, trigger,
|
||||
// function, or batch. Thus, two statements are in the same scope if
|
||||
// they are in the same stored procedure, function, or batch.
|
||||
return $this->GetOne($this->identitySQL);
|
||||
return $this->lastInsertID;
|
||||
}
|
||||
|
||||
function _affectedrows()
|
||||
{
|
||||
return @sqlsrv_rows_affected($this->_queryID);
|
||||
if ($this->_queryID)
|
||||
return sqlsrv_rows_affected($this->_queryID);
|
||||
}
|
||||
|
||||
function GenID($seq='adodbseq',$start=1) {
|
||||
if (!$this->mssql_version)
|
||||
$this->ServerVersion();
|
||||
switch($this->mssql_version){
|
||||
case 9:
|
||||
case 10:
|
||||
return $this->GenID2008();
|
||||
break;
|
||||
case 11:
|
||||
return $this->GenID2012();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CreateSequence($seq='adodbseq',$start=1)
|
||||
{
|
||||
if($this->debug) error_log("<hr>CreateSequence($seq,$start)");
|
||||
if (!$this->mssql_vesion)
|
||||
$this->ServerVersion();
|
||||
|
||||
switch($this->mssql_version){
|
||||
case 9:
|
||||
case 10:
|
||||
return $this->CreateSequence2008();
|
||||
break;
|
||||
case 11:
|
||||
return $this->CreateSequence2012();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* For Server 2005,2008, duplicate a sequence with an identity table
|
||||
*/
|
||||
function CreateSequence2008($seq='adodbseq',$start=1)
|
||||
{
|
||||
if($this->debug) ADOConnection::outp("<hr>CreateSequence($seq,$start)");
|
||||
sqlsrv_begin_transaction($this->_connectionID);
|
||||
$start -= 1;
|
||||
$this->Execute("create table $seq (id int)");//was float(53)
|
||||
$ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
|
||||
if (!$ok) {
|
||||
if($this->debug) error_log("<hr>Error: ROLLBACK");
|
||||
if($this->debug) ADOConnection::outp("<hr>Error: ROLLBACK");
|
||||
sqlsrv_rollback($this->_connectionID);
|
||||
return false;
|
||||
}
|
||||
@@ -197,25 +255,68 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
return true;
|
||||
}
|
||||
|
||||
function GenID($seq='adodbseq',$start=1)
|
||||
/**
|
||||
* Proper Sequences Only available to Server 2012 and up
|
||||
*/
|
||||
function CreateSequence2012($seq='adodb',$start=1){
|
||||
if (!$this->sequences){
|
||||
$sql = "SELECT name FROM sys.sequences";
|
||||
$this->sequences = $this->GetCol($sql);
|
||||
}
|
||||
$ok = $this->Execute("CREATE SEQUENCE $seq START WITH $start INCREMENT BY 1");
|
||||
if (!$ok)
|
||||
die("CANNOT CREATE SEQUENCE" . print_r(sqlsrv_errors(),true));
|
||||
$this->sequences[] = $seq;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Server 2005,2008, duplicate a sequence with an identity table
|
||||
*/
|
||||
function GenID2008($seq='adodbseq',$start=1)
|
||||
{
|
||||
if($this->debug) error_log("<hr>GenID($seq,$start)");
|
||||
if($this->debug) ADOConnection::outp("<hr>CreateSequence($seq,$start)");
|
||||
sqlsrv_begin_transaction($this->_connectionID);
|
||||
$ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1");
|
||||
if (!$ok) {
|
||||
$this->Execute("create table $seq (id int)");
|
||||
$start -= 1;
|
||||
$this->Execute("create table $seq (id int)");//was float(53)
|
||||
$ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
|
||||
if (!$ok) {
|
||||
if($this->debug) error_log("<hr>Error: ROLLBACK");
|
||||
if($this->debug) ADOConnection::outp("<hr>Error: ROLLBACK");
|
||||
sqlsrv_rollback($this->_connectionID);
|
||||
return false;
|
||||
}
|
||||
sqlsrv_commit($this->_connectionID);
|
||||
return $start;
|
||||
}
|
||||
$num = $this->GetOne("select id from $seq");
|
||||
sqlsrv_commit($this->_connectionID);
|
||||
if($this->debug) error_log(" Returning: $num");
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Only available to Server 2012 and up
|
||||
* Cannot do this the normal adodb way by trapping an error if the
|
||||
* sequence does not exist because sql server will auto create a
|
||||
* sequence with the starting number of -9223372036854775808
|
||||
*/
|
||||
function GenID2012($seq='adodbseq',$start=1)
|
||||
{
|
||||
|
||||
/*
|
||||
* First time in create an array of sequence names that we
|
||||
* can use in later requests to see if the sequence exists
|
||||
* the overhead is creating a list of sequences every time
|
||||
* we need access to at least 1. If we really care about
|
||||
* performance, we could maybe flag a 'nocheck' class variable
|
||||
*/
|
||||
if (!$this->sequences){
|
||||
$sql = "SELECT name FROM sys.sequences";
|
||||
$this->sequences = $this->GetCol($sql);
|
||||
}
|
||||
if (!is_array($this->sequences)
|
||||
|| is_array($this->sequences) && !in_array($seq,$this->sequences)){
|
||||
$this->CreateSequence2012($seq='adodbseq',$start=1);
|
||||
|
||||
}
|
||||
$num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
|
||||
return $num;
|
||||
}
|
||||
|
||||
@@ -284,7 +385,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
{
|
||||
if ($this->transOff) return true;
|
||||
$this->transCnt += 1;
|
||||
if ($this->debug) error_log('<hr>begin transaction');
|
||||
if ($this->debug) ADOConnection::outp('<hr>begin transaction');
|
||||
sqlsrv_begin_transaction($this->_connectionID);
|
||||
return true;
|
||||
}
|
||||
@@ -292,7 +393,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
function CommitTrans($ok=true)
|
||||
{
|
||||
if ($this->transOff) return true;
|
||||
if ($this->debug) error_log('<hr>commit transaction');
|
||||
if ($this->debug) ADOConnection::outp('<hr>commit transaction');
|
||||
if (!$ok) return $this->RollbackTrans();
|
||||
if ($this->transCnt) $this->transCnt -= 1;
|
||||
sqlsrv_commit($this->_connectionID);
|
||||
@@ -301,7 +402,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
function RollbackTrans()
|
||||
{
|
||||
if ($this->transOff) return true;
|
||||
if ($this->debug) error_log('<hr>rollback transaction');
|
||||
if ($this->debug) ADOConnection::outp('<hr>rollback transaction');
|
||||
if ($this->transCnt) $this->transCnt -= 1;
|
||||
sqlsrv_rollback($this->_connectionID);
|
||||
return true;
|
||||
@@ -377,15 +478,22 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
if (!function_exists('sqlsrv_connect')) return null;
|
||||
$connectionInfo = array("Database"=>$argDatabasename,'UID'=>$argUsername,'PWD'=>$argPassword);
|
||||
if ($this->debug) error_log("<hr>connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
|
||||
//if ($this->debug) error_log("<hr>_connectionID before: ".serialize($this->_connectionID));
|
||||
$connectionInfo = $this->connectionInfo;
|
||||
$connectionInfo["Database"]=$argDatabasename;
|
||||
$connectionInfo["UID"]=$argUsername;
|
||||
$connectionInfo["PWD"]=$argPassword;
|
||||
|
||||
foreach ($this->connectionParameters as $parameter=>$value)
|
||||
$connectionInfo[$parameter] = $value;
|
||||
|
||||
if ($this->debug) ADOConnection::outp("<hr>connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
|
||||
//if ($this->debug) ADOConnection::outp("<hr>_connectionID before: ".serialize($this->_connectionID));
|
||||
if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
|
||||
if ($this->debug) error_log( "<hr><b>errors</b>: ".print_r( sqlsrv_errors(), true));
|
||||
if ($this->debug) ADOConnection::outp( "<hr><b>errors</b>: ".print_r( sqlsrv_errors(), true));
|
||||
return false;
|
||||
}
|
||||
//if ($this->debug) error_log(" _connectionID after: ".serialize($this->_connectionID));
|
||||
//if ($this->debug) error_log("<hr>defined functions: <pre>".var_export(get_defined_functions(),true)."</pre>");
|
||||
//if ($this->debug) ADOConnection::outp(" _connectionID after: ".serialize($this->_connectionID));
|
||||
//if ($this->debug) ADOConnection::outp("<hr>defined functions: <pre>".var_export(get_defined_functions(),true)."</pre>");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -398,6 +506,8 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
|
||||
function Prepare($sql)
|
||||
{
|
||||
return $sql; // prepare does not work properly with bind parameters as bind parameters are managed by sqlsrv_prepare!
|
||||
|
||||
$stmt = sqlsrv_prepare( $this->_connectionID, $sql);
|
||||
if (!$stmt) return $sql;
|
||||
return array($sql,$stmt);
|
||||
@@ -454,23 +564,32 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
$this->_errorMsg = false;
|
||||
if (is_array($inputarr)) {
|
||||
|
||||
if (is_array($sql)) $sql = $sql[1];
|
||||
|
||||
$insert = false;
|
||||
// handle native driver flaw for retrieving the last insert ID
|
||||
if(preg_match('/^\W*insert\s(?:(?:(?:\'\')*\'[^\']+\'(?:\'\')*)|[^;\'])*;?$/i', $sql)) {
|
||||
$insert = true;
|
||||
$sql .= '; '.$this->identitySQL; // select scope_identity()
|
||||
}
|
||||
if($inputarr) {
|
||||
$rez = sqlsrv_query($this->_connectionID, $sql, $inputarr);
|
||||
} else if (is_array($sql)) {
|
||||
$rez = sqlsrv_query($this->_connectionID,$sql[1],$inputarr);
|
||||
} else {
|
||||
$rez = sqlsrv_query($this->_connectionID,$sql);
|
||||
}
|
||||
if ($this->debug) error_log("<hr>running query: ".var_export($sql,true)."<hr>input array: ".var_export($inputarr,true)."<hr>result: ".var_export($rez,true));//"<hr>connection: ".serialize($this->_connectionID)
|
||||
//fix for returning true on anything besides select statements
|
||||
if (is_array($sql)) $sql = $sql[1];
|
||||
$sql = ltrim($sql);
|
||||
if(stripos($sql, 'SELECT') !== 0 && $rez !== false) {
|
||||
if ($this->debug) error_log(" isn't a select query, returning boolean true");
|
||||
return true;
|
||||
|
||||
if ($this->debug) ADOConnection::outp("<hr>running query: ".var_export($sql,true)."<hr>input array: ".var_export($inputarr,true)."<hr>result: ".var_export($rez,true));
|
||||
|
||||
if(!$rez) {
|
||||
$rez = false;
|
||||
} else if ($insert) {
|
||||
// retrieve the last insert ID (where applicable)
|
||||
while ( sqlsrv_next_result($rez) ) {
|
||||
sqlsrv_fetch($rez);
|
||||
$this->lastInsertID = sqlsrv_get_field($rez, 0);
|
||||
}
|
||||
}
|
||||
//end fix
|
||||
if(!$rez) $rez = false;
|
||||
return $rez;
|
||||
}
|
||||
|
||||
@@ -486,15 +605,15 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
// mssql uses a default date like Dec 30 2000 12:00AM
|
||||
static function UnixDate($v)
|
||||
{
|
||||
return ADORecordSet_array_mssql::UnixDate($v);
|
||||
return ADORecordSet_array_mssqlnative::UnixDate($v);
|
||||
}
|
||||
|
||||
static function UnixTimeStamp($v)
|
||||
{
|
||||
return ADORecordSet_array_mssql::UnixTimeStamp($v);
|
||||
return ADORecordSet_array_mssqlnative::UnixTimeStamp($v);
|
||||
}
|
||||
|
||||
function &MetaIndexes($table,$primary=false)
|
||||
function MetaIndexes($table,$primary=false, $owner = false)
|
||||
{
|
||||
$table = $this->qstr($table);
|
||||
|
||||
@@ -592,7 +711,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
|
||||
// "Stein-Aksel Basma" <basma@accelero.no>
|
||||
// tested with MSSQL 2000
|
||||
function &MetaPrimaryKeys($table)
|
||||
function MetaPrimaryKeys($table, $owner=false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -617,7 +736,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
}
|
||||
|
||||
|
||||
function &MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
if ($mask) {
|
||||
$save = $this->metaTablesSQL;
|
||||
@@ -631,6 +750,87 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
function MetaColumns($table, $upper=true, $schema=false){
|
||||
|
||||
# start adg
|
||||
static $cached_columns = array();
|
||||
if ($this->cachedSchemaFlush)
|
||||
$cached_columns = array();
|
||||
|
||||
if (array_key_exists($table,$cached_columns)){
|
||||
return $cached_columns[$table];
|
||||
}
|
||||
# end adg
|
||||
|
||||
if (!$this->mssql_version)
|
||||
$this->ServerVersion();
|
||||
|
||||
$this->_findschema($table,$schema);
|
||||
if ($schema) {
|
||||
$dbName = $this->database;
|
||||
$this->SelectDB($schema);
|
||||
}
|
||||
global $ADODB_FETCH_MODE;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
|
||||
if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
|
||||
$rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
|
||||
|
||||
if ($schema) {
|
||||
$this->SelectDB($dbName);
|
||||
}
|
||||
|
||||
if (isset($savem)) $this->SetFetchMode($savem);
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
if (!is_object($rs)) {
|
||||
$false = false;
|
||||
return $false;
|
||||
}
|
||||
|
||||
$retarr = array();
|
||||
while (!$rs->EOF){
|
||||
|
||||
$fld = new ADOFieldObject();
|
||||
if (array_key_exists(0,$rs->fields)) {
|
||||
$fld->name = $rs->fields[0];
|
||||
$fld->type = $rs->fields[1];
|
||||
$fld->max_length = $rs->fields[2];
|
||||
$fld->precision = $rs->fields[3];
|
||||
$fld->scale = $rs->fields[4];
|
||||
$fld->not_null =!$rs->fields[5];
|
||||
$fld->has_default = $rs->fields[6];
|
||||
$fld->xtype = $rs->fields[7];
|
||||
$fld->type_length = $rs->fields[8];
|
||||
$fld->auto_increment= $rs->fields[9];
|
||||
} else {
|
||||
$fld->name = $rs->fields['name'];
|
||||
$fld->type = $rs->fields['type'];
|
||||
$fld->max_length = $rs->fields['length'];
|
||||
$fld->precision = $rs->fields['precision'];
|
||||
$fld->scale = $rs->fields['scale'];
|
||||
$fld->not_null =!$rs->fields['nullable'];
|
||||
$fld->has_default = $rs->fields['default_value'];
|
||||
$fld->xtype = $rs->fields['xtype'];
|
||||
$fld->type_length = $rs->fields['type_length'];
|
||||
$fld->auto_increment= $rs->fields['is_identity'];
|
||||
}
|
||||
|
||||
if ($save == ADODB_FETCH_NUM)
|
||||
$retarr[] = $fld;
|
||||
else
|
||||
$retarr[strtoupper($fld->name)] = $fld;
|
||||
|
||||
$rs->MoveNext();
|
||||
|
||||
}
|
||||
$rs->Close();
|
||||
# start adg
|
||||
$cached_columns[$table] = $retarr;
|
||||
# end adg
|
||||
return $retarr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------
|
||||
@@ -644,7 +844,7 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
var $fieldOffset = 0;
|
||||
// _mths works only in non-localised system
|
||||
|
||||
function ADORecordset_mssqlnative($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -652,21 +852,30 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
|
||||
}
|
||||
$this->fetchMode = $mode;
|
||||
return $this->ADORecordSet($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
|
||||
function _initrs()
|
||||
{
|
||||
global $ADODB_COUNTRECS;
|
||||
if ($this->connection->debug) error_log("(before) ADODB_COUNTRECS: {$ADODB_COUNTRECS} _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
|
||||
# KMN # if ($this->connection->debug) ADOConnection::outp("(before) ADODB_COUNTRECS: {$ADODB_COUNTRECS} _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
|
||||
/*$retRowsAff = sqlsrv_rows_affected($this->_queryID);//"If you need to determine the number of rows a query will return before retrieving the actual results, appending a SELECT COUNT ... query would let you get that information, and then a call to next_result would move you to the "real" results."
|
||||
error_log("rowsaff: ".serialize($retRowsAff));
|
||||
ADOConnection::outp("rowsaff: ".serialize($retRowsAff));
|
||||
$this->_numOfRows = ($ADODB_COUNTRECS)? $retRowsAff:-1;*/
|
||||
$this->_numOfRows = -1;//not supported
|
||||
$fieldmeta = sqlsrv_field_metadata($this->_queryID);
|
||||
$this->_numOfFields = ($fieldmeta)? count($fieldmeta):-1;
|
||||
if ($this->connection->debug) error_log("(after) _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
|
||||
# KMN # if ($this->connection->debug) ADOConnection::outp("(after) _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
|
||||
/*
|
||||
* Copy the oracle method and cache the metadata at init time
|
||||
*/
|
||||
if ($this->_numOfFields>0) {
|
||||
$this->_fieldobjs = array();
|
||||
$max = $this->_numOfFields;
|
||||
for ($i=0;$i<$max; $i++) $this->_fieldobjs[] = $this->_FetchField($i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -700,9 +909,10 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
/* Returns: an object containing field information.
|
||||
Get column information in the Recordset object. fetchField() can be used in order to obtain information about
|
||||
fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
|
||||
fetchField() is retrieved. */
|
||||
|
||||
function &FetchField($fieldOffset = -1)
|
||||
fetchField() is retrieved.
|
||||
Designed By jcortinap#jc.com.mx
|
||||
*/
|
||||
function _FetchField($fieldOffset = -1)
|
||||
{
|
||||
$_typeConversion = array(
|
||||
-155 => 'datetimeoffset',
|
||||
@@ -771,6 +981,18 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
return $f;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetchfield copies the oracle method, it loads the field information
|
||||
* into the _fieldobjs array once, to save multiple calls to the
|
||||
* sqlsrv_field_metadata function
|
||||
*
|
||||
* @author KM Newnham
|
||||
* @date 02/20/2013
|
||||
*/
|
||||
function FetchField($fieldOffset = -1)
|
||||
{
|
||||
return $this->_fieldobjs[$fieldOffset];
|
||||
}
|
||||
|
||||
function _seek($row)
|
||||
{
|
||||
@@ -780,16 +1002,16 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
// speedup
|
||||
function MoveNext()
|
||||
{
|
||||
if ($this->connection->debug) error_log("movenext()");
|
||||
//if ($this->connection->debug) error_log("eof (beginning): ".$this->EOF);
|
||||
//# KMN # if ($this->connection->debug) ADOConnection::outp("movenext()");
|
||||
//# KMN # if ($this->connection->debug) ADOConnection::outp("eof (beginning): ".$this->EOF);
|
||||
if ($this->EOF) return false;
|
||||
|
||||
$this->_currentRow++;
|
||||
if ($this->connection->debug) error_log("_currentRow: ".$this->_currentRow);
|
||||
// # KMN # if ($this->connection->debug) ADOConnection::outp("_currentRow: ".$this->_currentRow);
|
||||
|
||||
if ($this->_fetch()) return true;
|
||||
$this->EOF = true;
|
||||
//if ($this->connection->debug) error_log("eof (end): ".$this->EOF);
|
||||
//# KMN # if ($this->connection->debug) ADOConnection::outp("eof (end): ".$this->EOF);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -799,16 +1021,17 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
// also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot!
|
||||
function _fetch($ignore_fields=false)
|
||||
{
|
||||
if ($this->connection->debug) error_log("_fetch()");
|
||||
# KMN # if ($this->connection->debug) ADOConnection::outp("_fetch()");
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
if ($this->fetchMode & ADODB_FETCH_NUM) {
|
||||
if ($this->connection->debug) error_log("fetch mode: both");
|
||||
//# KMN # if ($this->connection->debug) ADOConnection::outp("fetch mode: both");
|
||||
$this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_BOTH);
|
||||
} else {
|
||||
if ($this->connection->debug) error_log("fetch mode: assoc");
|
||||
//# KMN # if ($this->connection->debug) ADOConnection::outp("fetch mode: assoc");
|
||||
$this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_ASSOC);
|
||||
}
|
||||
|
||||
if (is_array($this->fields)) {
|
||||
if (ADODB_ASSOC_CASE == 0) {
|
||||
foreach($this->fields as $k=>$v) {
|
||||
$this->fields[strtolower($k)] = $v;
|
||||
@@ -818,8 +1041,9 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
$this->fields[strtoupper($k)] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($this->connection->debug) error_log("fetch mode: num");
|
||||
//# KMN # if ($this->connection->debug) ADOConnection::outp("fetch mode: num");
|
||||
$this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_NUMERIC);
|
||||
}
|
||||
if(is_array($this->fields) && array_key_exists(1,$this->fields) && !array_key_exists(0,$this->fields)) {//fix fetch numeric keys since they're not 0 based
|
||||
@@ -831,18 +1055,18 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
$arrFixed[$key] = $value;
|
||||
}
|
||||
}
|
||||
//if($this->connection->debug) error_log("<hr>fixing non 0 based return array, old: ".print_r($this->fields,true)." new: ".print_r($arrFixed,true));
|
||||
//if($this->connection->debug) ADOConnection::outp("<hr>fixing non 0 based return array, old: ".print_r($this->fields,true)." new: ".print_r($arrFixed,true));
|
||||
$this->fields = $arrFixed;
|
||||
}
|
||||
if(is_array($this->fields)) {
|
||||
foreach($this->fields as $key=>$value) {
|
||||
if (is_object($value) && method_exists($value, 'format')) {//is DateTime object
|
||||
$this->fields[$key] = $value->format("Y-m-d H:i:s");
|
||||
$this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");
|
||||
}
|
||||
}
|
||||
}
|
||||
if($this->fields === null) $this->fields = false;
|
||||
if ($this->connection->debug) error_log("<hr>after _fetch, fields: <pre>".print_r($this->fields,true)." backtrace: ".adodb_backtrace(false));
|
||||
# KMN # if ($this->connection->debug) ADOConnection::outp("<hr>after _fetch, fields: <pre>".print_r($this->fields,true)." backtrace: ".adodb_backtrace(false));
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
@@ -850,10 +1074,13 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
is running. All associated result memory for the specified result identifier will automatically be freed. */
|
||||
function _close()
|
||||
{
|
||||
if($this->_queryID) {
|
||||
$rez = sqlsrv_free_stmt($this->_queryID);
|
||||
$this->_queryID = false;
|
||||
return $rez;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// mssql uses a default date like Dec 30 2000 12:00AM
|
||||
static function UnixDate($v)
|
||||
@@ -869,9 +1096,9 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
|
||||
|
||||
class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
|
||||
function ADORecordSet_array_mssqlnative($id=-1,$mode=false)
|
||||
function __construct($id=-1,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_array($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
// mssql uses a default date like Dec 30 2000 12:00AM
|
||||
@@ -903,7 +1130,7 @@ class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
|
||||
$themth = $ADODB_mssql_mths[$themth];
|
||||
if ($themth <= 0) return false;
|
||||
// h-m-s-MM-DD-YY
|
||||
return mktime(0,0,0,$themth,$theday,$rr[3]);
|
||||
return adodb_mktime(0,0,0,$themth,$theday,$rr[3]);
|
||||
}
|
||||
|
||||
static function UnixTimeStamp($v)
|
||||
@@ -944,7 +1171,7 @@ class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
|
||||
break;
|
||||
}
|
||||
// h-m-s-MM-DD-YY
|
||||
return mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
|
||||
return adodb_mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -971,5 +1198,3 @@ class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
|
||||
|
||||
http://www.databasejournal.com/scripts/article.php/1440551
|
||||
*/
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -28,12 +30,7 @@ class ADODB_mssqlpo extends ADODB_mssql {
|
||||
var $databaseType = "mssqlpo";
|
||||
var $concat_operator = '||';
|
||||
|
||||
function ADODB_mssqlpo()
|
||||
{
|
||||
ADODB_mssql::ADODB_mssql();
|
||||
}
|
||||
|
||||
function PrepareSP($sql)
|
||||
function PrepareSP($sql, $param = true)
|
||||
{
|
||||
if (!$this->_has_mssql_init) {
|
||||
ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
|
||||
@@ -54,9 +51,8 @@ class ADODB_mssqlpo extends ADODB_mssql {
|
||||
|
||||
class ADORecordset_mssqlpo extends ADORecordset_mssql {
|
||||
var $databaseType = "mssqlpo";
|
||||
function ADORecordset_mssqlpo($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordset_mssql($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,12 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 8.
|
||||
|
||||
MySQL code that does not support transactions. Use mysqlt if you need transactions.
|
||||
This driver only supports the original non-transactional MySQL driver. It
|
||||
is deprected in PHP version 5.5 and removed in PHP version 7. It is deprecated
|
||||
as of ADOdb version 5.20.0. Use the mysqli driver instead, which supports both
|
||||
transactional and non-transactional updates
|
||||
|
||||
Requires mysql client. Works on Windows and Unix.
|
||||
|
||||
28 Feb 2001: MetaColumns bug fix - suggested by Freek Dijkstra (phpeverywhere@macfreek.com)
|
||||
@@ -23,7 +29,11 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
var $dataProvider = 'mysql';
|
||||
var $hasInsertID = true;
|
||||
var $hasAffectedRows = true;
|
||||
var $metaTablesSQL = "SHOW TABLES";
|
||||
var $metaTablesSQL = "SELECT
|
||||
TABLE_NAME,
|
||||
CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA=";
|
||||
var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $hasLimit = true;
|
||||
@@ -36,15 +46,35 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
var $forceNewConnect = false;
|
||||
var $poorAffectedRows = true;
|
||||
var $clientFlags = 0;
|
||||
var $charSet = '';
|
||||
var $substr = "substring";
|
||||
var $nameQuote = '`'; /// string to use to quote identifiers and names
|
||||
var $compat323 = false; // true if compat with mysql 3.23
|
||||
|
||||
function ADODB_mysql()
|
||||
function __construct()
|
||||
{
|
||||
if (defined('ADODB_EXTENSION')) $this->rsPrefix .= 'ext_';
|
||||
}
|
||||
|
||||
|
||||
// SetCharSet - switch the client encoding
|
||||
function SetCharSet($charset_name)
|
||||
{
|
||||
if (!function_exists('mysql_set_charset')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->charSet !== $charset_name) {
|
||||
$ok = @mysql_set_charset($charset_name,$this->_connectionID);
|
||||
if ($ok) {
|
||||
$this->charSet = $charset_name;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
$arr['description'] = ADOConnection::GetOne("select version()");
|
||||
@@ -57,17 +87,84 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
return " IFNULL($field, $ifNull) "; // if MySQL
|
||||
}
|
||||
|
||||
function MetaProcedures($NamePattern = false, $catalog = null, $schemaPattern = null)
|
||||
{
|
||||
// save old fetch mode
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
$false = false;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
|
||||
if ($this->fetchMode !== FALSE) {
|
||||
$savem = $this->SetFetchMode(FALSE);
|
||||
}
|
||||
|
||||
$procedures = array ();
|
||||
|
||||
// get index details
|
||||
|
||||
$likepattern = '';
|
||||
if ($NamePattern) {
|
||||
$likepattern = " LIKE '".$NamePattern."'";
|
||||
}
|
||||
$rs = $this->Execute('SHOW PROCEDURE STATUS'.$likepattern);
|
||||
if (is_object($rs)) {
|
||||
|
||||
// parse index data into array
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$procedures[$row[1]] = array(
|
||||
'type' => 'PROCEDURE',
|
||||
'catalog' => '',
|
||||
'schema' => '',
|
||||
'remarks' => $row[7],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$rs = $this->Execute('SHOW FUNCTION STATUS'.$likepattern);
|
||||
if (is_object($rs)) {
|
||||
// parse index data into array
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$procedures[$row[1]] = array(
|
||||
'type' => 'FUNCTION',
|
||||
'catalog' => '',
|
||||
'schema' => '',
|
||||
'remarks' => $row[7]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// restore fetchmode
|
||||
if (isset($savem)) {
|
||||
$this->SetFetchMode($savem);
|
||||
}
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
return $procedures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of tables based on given criteria
|
||||
*
|
||||
* @param string $ttype Table type = 'TABLE', 'VIEW' or false=both (default)
|
||||
* @param string $showSchema schema name, false = current schema (default)
|
||||
* @param string $mask filters the table by name
|
||||
*
|
||||
* @return array list of tables
|
||||
*/
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
$save = $this->metaTablesSQL;
|
||||
if ($showSchema && is_string($showSchema)) {
|
||||
$this->metaTablesSQL .= " from $showSchema";
|
||||
$this->metaTablesSQL .= $this->qstr($showSchema);
|
||||
} else {
|
||||
$this->metaTablesSQL .= "schema()";
|
||||
}
|
||||
|
||||
if ($mask) {
|
||||
$mask = $this->qstr($mask);
|
||||
$this->metaTablesSQL .= " like $mask";
|
||||
$this->metaTablesSQL .= " AND table_name LIKE $mask";
|
||||
}
|
||||
$ret = ADOConnection::MetaTables($ttype,$showSchema);
|
||||
|
||||
@@ -158,11 +255,12 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
|
||||
function GetOne($sql,$inputarr=false)
|
||||
{
|
||||
global $ADODB_GETONE_EOF;
|
||||
if ($this->compat323 == false && strncasecmp($sql,'sele',4) == 0) {
|
||||
$rs = $this->SelectLimit($sql,1,-1,$inputarr);
|
||||
if ($rs) {
|
||||
$rs->Close();
|
||||
if ($rs->EOF) return null;
|
||||
if ($rs->EOF) return $ADODB_GETONE_EOF;
|
||||
return reset($rs->fields);
|
||||
}
|
||||
} else {
|
||||
@@ -184,10 +282,10 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
// See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
|
||||
// Reference on Last_Insert_ID on the recommended way to simulate sequences
|
||||
var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
|
||||
var $_genSeqSQL = "create table %s (id int not null)";
|
||||
var $_genSeqSQL = "create table if not exists %s (id int not null)";
|
||||
var $_genSeqCountSQL = "select count(*) from %s";
|
||||
var $_genSeq2SQL = "insert into %s values (%s)";
|
||||
var $_dropSeqSQL = "drop table %s";
|
||||
var $_dropSeqSQL = "drop table if exists %s";
|
||||
|
||||
function CreateSequence($seqname='adodbseq',$startID=1)
|
||||
{
|
||||
@@ -501,10 +599,15 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
// returns queryID or false
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
//global $ADODB_COUNTRECS;
|
||||
//if($ADODB_COUNTRECS)
|
||||
|
||||
return mysql_query($sql,$this->_connectionID);
|
||||
//else return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
|
||||
/*
|
||||
global $ADODB_COUNTRECS;
|
||||
if($ADODB_COUNTRECS)
|
||||
return mysql_query($sql,$this->_connectionID);
|
||||
else
|
||||
return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
|
||||
*/
|
||||
}
|
||||
|
||||
/* Returns: the last error message from previous database operation */
|
||||
@@ -529,6 +632,8 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
function _close()
|
||||
{
|
||||
@mysql_close($this->_connectionID);
|
||||
|
||||
$this->charSet = '';
|
||||
$this->_connectionID = false;
|
||||
}
|
||||
|
||||
@@ -561,7 +666,9 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
$a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
|
||||
if ($associative) {
|
||||
$create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
|
||||
} else $create_sql = $a_create_table[1];
|
||||
} else {
|
||||
$create_sql = $a_create_table[1];
|
||||
}
|
||||
|
||||
$matches = array();
|
||||
|
||||
@@ -607,7 +714,7 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
var $databaseType = "mysql";
|
||||
var $canSeek = true;
|
||||
|
||||
function ADORecordSet_mysql($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -623,7 +730,7 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
$this->fetchMode = MYSQL_BOTH; break;
|
||||
}
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function _initrs()
|
||||
@@ -643,19 +750,23 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
//$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
|
||||
if ($o) $o->binary = (strpos($f,'binary')!== false);
|
||||
}
|
||||
else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
|
||||
else { /* The $fieldOffset argument is not provided thus its -1 */
|
||||
$o = @mysql_fetch_field($this->_queryID);
|
||||
if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
|
||||
//$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
|
||||
//if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
|
||||
$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
|
||||
}
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
function GetRowAssoc($upper=true)
|
||||
function GetRowAssoc($upper = ADODB_ASSOC_CASE)
|
||||
{
|
||||
if ($this->fetchMode == MYSQL_ASSOC && !$upper) $row = $this->fields;
|
||||
else $row = ADORecordSet::GetRowAssoc($upper);
|
||||
if ($this->fetchMode == MYSQL_ASSOC && $upper == ADODB_ASSOC_CASE_LOWER) {
|
||||
$row = $this->fields;
|
||||
}
|
||||
else {
|
||||
$row = ADORecordSet::GetRowAssoc($upper);
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
@@ -686,6 +797,7 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
//return adodb_movenext($this);
|
||||
//if (defined('ADODB_EXTENSION')) return adodb_movenext($this);
|
||||
if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
|
||||
$this->_updatefields();
|
||||
$this->_currentRow += 1;
|
||||
return true;
|
||||
}
|
||||
@@ -699,6 +811,7 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
function _fetch()
|
||||
{
|
||||
$this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode);
|
||||
$this->_updatefields();
|
||||
return is_array($this->fields);
|
||||
}
|
||||
|
||||
@@ -764,23 +877,9 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
}
|
||||
|
||||
class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
|
||||
function ADORecordSet_ext_mysql($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
switch ($mode)
|
||||
{
|
||||
case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
|
||||
case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
|
||||
case ADODB_FETCH_DEFAULT:
|
||||
case ADODB_FETCH_BOTH:
|
||||
default:
|
||||
$this->fetchMode = MYSQL_BOTH; break;
|
||||
}
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID,$mode);
|
||||
}
|
||||
|
||||
function MoveNext()
|
||||
@@ -789,6 +888,4 @@ if (! defined("_ADODB_MYSQL_LAYER")) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,12 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 8.
|
||||
|
||||
MySQL code that does not support transactions. Use mysqlt if you need transactions.
|
||||
This is the preferred driver for MySQL connections, and supports both transactional
|
||||
and non-transactional table types. You can use this as a drop-in replacement for both
|
||||
the mysql and mysqlt drivers. As of ADOdb Version 5.20.0, all other native MySQL drivers
|
||||
are deprecated
|
||||
|
||||
Requires mysql client. Works on Windows and Unix.
|
||||
|
||||
21 October 2003: MySQLi extension implementation by Arjen de Rijke (a.de.rijke@xs4all.nl)
|
||||
@@ -28,10 +34,14 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
|
||||
class ADODB_mysqli extends ADOConnection {
|
||||
var $databaseType = 'mysqli';
|
||||
var $dataProvider = 'native';
|
||||
var $dataProvider = 'mysql';
|
||||
var $hasInsertID = true;
|
||||
var $hasAffectedRows = true;
|
||||
var $metaTablesSQL = "SHOW TABLES";
|
||||
var $metaTablesSQL = "SELECT
|
||||
TABLE_NAME,
|
||||
CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA=";
|
||||
var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $hasLimit = true;
|
||||
@@ -45,19 +55,18 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
var $poorAffectedRows = true;
|
||||
var $clientFlags = 0;
|
||||
var $substr = "substring";
|
||||
var $port = false;
|
||||
var $socket = false;
|
||||
var $port = 3306; //Default to 3306 to fix HHVM bug
|
||||
var $socket = ''; //Default to empty string to fix HHVM bug
|
||||
var $_bindInputArray = false;
|
||||
var $nameQuote = '`'; /// string to use to quote identifiers and names
|
||||
var $optionFlags = array(array(MYSQLI_READ_DEFAULT_GROUP,0));
|
||||
var $arrayClass = 'ADORecordSet_array_mysqli';
|
||||
var $multiQuery = false;
|
||||
|
||||
function ADODB_mysqli()
|
||||
function __construct()
|
||||
{
|
||||
// if(!extension_loaded("mysqli"))
|
||||
;//trigger_error("You must have the mysqli extension installed.", E_USER_ERROR);
|
||||
|
||||
//trigger_error("You must have the mysqli extension installed.", E_USER_ERROR);
|
||||
}
|
||||
|
||||
function SetTransactionMode( $transaction_mode )
|
||||
@@ -86,8 +95,9 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
|
||||
if (is_null($this->_connectionID)) {
|
||||
// mysqli_init only fails if insufficient memory
|
||||
if ($this->debug)
|
||||
if ($this->debug) {
|
||||
ADOConnection::outp("mysqli_init() failed : " . $this->ErrorMsg());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
@@ -99,13 +109,17 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
mysqli_options($this->_connectionID,$arr[0],$arr[1]);
|
||||
}
|
||||
|
||||
//http ://php.net/manual/en/mysqli.persistconns.php
|
||||
if ($persist && PHP_VERSION > 5.2 && strncmp($argHostname,'p:',2) != 0) $argHostname = 'p:'.$argHostname;
|
||||
|
||||
#if (!empty($this->port)) $argHostname .= ":".$this->port;
|
||||
$ok = mysqli_real_connect($this->_connectionID,
|
||||
$argHostname,
|
||||
$argUsername,
|
||||
$argPassword,
|
||||
$argDatabasename,
|
||||
$this->port,
|
||||
# PHP7 compat: port must be int. Use default port if cast yields zero
|
||||
(int)$this->port != 0 ? (int)$this->port : 3306,
|
||||
$this->socket,
|
||||
$this->clientFlags);
|
||||
|
||||
@@ -113,8 +127,9 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
if ($argDatabasename) return $this->SelectDB($argDatabasename);
|
||||
return true;
|
||||
} else {
|
||||
if ($this->debug)
|
||||
if ($this->debug) {
|
||||
ADOConnection::outp("Could't connect : " . $this->ErrorMsg());
|
||||
}
|
||||
$this->_connectionID = null;
|
||||
return false;
|
||||
}
|
||||
@@ -125,7 +140,6 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename, true);
|
||||
|
||||
}
|
||||
|
||||
// When is this used? Close old connection first?
|
||||
@@ -145,12 +159,13 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
function GetOne($sql,$inputarr=false)
|
||||
{
|
||||
global $ADODB_GETONE_EOF;
|
||||
|
||||
$ret = false;
|
||||
$rs = $this->Execute($sql,$inputarr);
|
||||
if ($rs) {
|
||||
if ($rs->EOF) $ret = $ADODB_GETONE_EOF;
|
||||
else $ret = reset($rs->fields);
|
||||
$rs->Close();
|
||||
if ($rs->EOF) return $ADODB_GETONE_EOF;
|
||||
return reset($rs->fields);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
@@ -197,7 +212,7 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function RowLock($tables,$where='',$col='1 as adodb_ignore')
|
||||
function RowLock($tables,$where='',$col='1 as adodbignore')
|
||||
{
|
||||
if ($this->transCnt==0) $this->BeginTrans();
|
||||
if ($where) $where = ' where '.$where;
|
||||
@@ -205,25 +220,31 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
return !empty($rs);
|
||||
}
|
||||
|
||||
// if magic quotes disabled, use mysql_real_escape_string()
|
||||
// From readme.htm:
|
||||
// Quotes a string to be sent to the database. The $magic_quotes_enabled
|
||||
// parameter may look funny, but the idea is if you are quoting a
|
||||
// string extracted from a POST/GET variable, then
|
||||
// pass get_magic_quotes_gpc() as the second parameter. This will
|
||||
// ensure that the variable is not quoted twice, once by qstr and once
|
||||
// by the magic_quotes_gpc.
|
||||
//
|
||||
//Eg. $s = $db->qstr(_GET['name'],get_magic_quotes_gpc());
|
||||
/**
|
||||
* Quotes a string to be sent to the database
|
||||
* When there is no active connection,
|
||||
* @param string $s The string to quote
|
||||
* @param boolean $magic_quotes If false, use mysqli_real_escape_string()
|
||||
* if you are quoting a string extracted from a POST/GET variable,
|
||||
* then pass get_magic_quotes_gpc() as the second parameter. This will
|
||||
* ensure that the variable is not quoted twice, once by qstr() and
|
||||
* once by the magic_quotes_gpc.
|
||||
* Eg. $s = $db->qstr(_GET['name'],get_magic_quotes_gpc());
|
||||
* @return string Quoted string
|
||||
*/
|
||||
function qstr($s, $magic_quotes = false)
|
||||
{
|
||||
if (is_null($s)) return 'NULL';
|
||||
if (!$magic_quotes) {
|
||||
if (PHP_VERSION >= 5)
|
||||
// mysqli_real_escape_string() throws a warning when the given
|
||||
// connection is invalid
|
||||
if (PHP_VERSION >= 5 && $this->_connectionID) {
|
||||
return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";
|
||||
}
|
||||
|
||||
if ($this->replaceQuote[0] == '\\')
|
||||
if ($this->replaceQuote[0] == '\\') {
|
||||
$s = adodb_str_replace(array('\\',"\0"), array('\\\\',"\\\0") ,$s);
|
||||
}
|
||||
return "'" . str_replace("'", $this->replaceQuote, $s) . "'";
|
||||
}
|
||||
// undo magic quotes for "
|
||||
@@ -253,10 +274,10 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
// See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
|
||||
// Reference on Last_Insert_ID on the recommended way to simulate sequences
|
||||
var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
|
||||
var $_genSeqSQL = "create table %s (id int not null)";
|
||||
var $_genSeqSQL = "create table if not exists %s (id int not null)";
|
||||
var $_genSeqCountSQL = "select count(*) from %s";
|
||||
var $_genSeq2SQL = "insert into %s values (%s)";
|
||||
var $_dropSeqSQL = "drop table %s";
|
||||
var $_dropSeqSQL = "drop table if exists %s";
|
||||
|
||||
function CreateSequence($seqname='adodbseq',$startID=1)
|
||||
{
|
||||
@@ -311,7 +332,7 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
}
|
||||
|
||||
|
||||
function MetaIndexes ($table, $primary = FALSE)
|
||||
function MetaIndexes ($table, $primary = FALSE, $owner = false)
|
||||
{
|
||||
// save old fetch mode
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -466,16 +487,84 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
// return "from_unixtime(unix_timestamp($date)+$fraction)";
|
||||
}
|
||||
|
||||
function MetaProcedures($NamePattern = false, $catalog = null, $schemaPattern = null)
|
||||
{
|
||||
// save old fetch mode
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
$false = false;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
|
||||
if ($this->fetchMode !== FALSE) {
|
||||
$savem = $this->SetFetchMode(FALSE);
|
||||
}
|
||||
|
||||
$procedures = array ();
|
||||
|
||||
// get index details
|
||||
|
||||
$likepattern = '';
|
||||
if ($NamePattern) {
|
||||
$likepattern = " LIKE '".$NamePattern."'";
|
||||
}
|
||||
$rs = $this->Execute('SHOW PROCEDURE STATUS'.$likepattern);
|
||||
if (is_object($rs)) {
|
||||
|
||||
// parse index data into array
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$procedures[$row[1]] = array(
|
||||
'type' => 'PROCEDURE',
|
||||
'catalog' => '',
|
||||
'schema' => '',
|
||||
'remarks' => $row[7],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$rs = $this->Execute('SHOW FUNCTION STATUS'.$likepattern);
|
||||
if (is_object($rs)) {
|
||||
// parse index data into array
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$procedures[$row[1]] = array(
|
||||
'type' => 'FUNCTION',
|
||||
'catalog' => '',
|
||||
'schema' => '',
|
||||
'remarks' => $row[7]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// restore fetchmode
|
||||
if (isset($savem)) {
|
||||
$this->SetFetchMode($savem);
|
||||
}
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
|
||||
return $procedures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of tables based on given criteria
|
||||
*
|
||||
* @param string $ttype Table type = 'TABLE', 'VIEW' or false=both (default)
|
||||
* @param string $showSchema schema name, false = current schema (default)
|
||||
* @param string $mask filters the table by name
|
||||
*
|
||||
* @return array list of tables
|
||||
*/
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
$save = $this->metaTablesSQL;
|
||||
if ($showSchema && is_string($showSchema)) {
|
||||
$this->metaTablesSQL .= " from $showSchema";
|
||||
$this->metaTablesSQL .= $this->qstr($showSchema);
|
||||
} else {
|
||||
$this->metaTablesSQL .= "schema()";
|
||||
}
|
||||
|
||||
if ($mask) {
|
||||
$mask = $this->qstr($mask);
|
||||
$this->metaTablesSQL .= " like $mask";
|
||||
$this->metaTablesSQL .= " AND table_name LIKE $mask";
|
||||
}
|
||||
$ret = ADOConnection::MetaTables($ttype,$showSchema);
|
||||
|
||||
@@ -749,7 +838,6 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this is a set of functions for managing client encoding - very important if the encodings
|
||||
// of your database and your output target (i.e. HTML) don't match
|
||||
// for instance, you may have UTF8 database and server it on-site as latin1 etc.
|
||||
@@ -774,19 +862,17 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
// SetCharSet - switch the client encoding
|
||||
function SetCharSet($charset_name)
|
||||
{
|
||||
if (!method_exists($this->_connectionID,'set_charset'))
|
||||
if (!method_exists($this->_connectionID,'set_charset')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->charSet !== $charset_name) {
|
||||
$if = @$this->_connectionID->set_charset($charset_name);
|
||||
if ($if == "0" & $this->GetCharSet() == $charset_name) {
|
||||
return ($if === true & $this->GetCharSet() == $charset_name);
|
||||
} else {
|
||||
return true;
|
||||
} else return false;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -799,16 +885,14 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
var $databaseType = "mysqli";
|
||||
var $canSeek = true;
|
||||
|
||||
function ADORecordSet_mysqli($queryID, $mode = false)
|
||||
{
|
||||
if ($mode === false)
|
||||
function __construct($queryID, $mode = false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
switch ($mode) {
|
||||
case ADODB_FETCH_NUM:
|
||||
$this->fetchMode = MYSQLI_NUM;
|
||||
break;
|
||||
@@ -822,7 +906,7 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
break;
|
||||
}
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function _initrs()
|
||||
@@ -861,6 +945,11 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
}
|
||||
$o = @mysqli_fetch_field($this->_queryID);
|
||||
if (!$o) return false;
|
||||
|
||||
//Fix for HHVM
|
||||
if ( !isset($o->flags) ) {
|
||||
$o->flags = 0;
|
||||
}
|
||||
/* Properties of an ADOFieldObject as set by MetaColumns */
|
||||
$o->primary_key = $o->flags & MYSQLI_PRI_KEY_FLAG;
|
||||
$o->not_null = $o->flags & MYSQLI_NOT_NULL_FLAG;
|
||||
@@ -872,10 +961,11 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
return $o;
|
||||
}
|
||||
|
||||
function GetRowAssoc($upper = true)
|
||||
function GetRowAssoc($upper = ADODB_ASSOC_CASE)
|
||||
{
|
||||
if ($this->fetchMode == MYSQLI_ASSOC && !$upper)
|
||||
if ($this->fetchMode == MYSQLI_ASSOC && $upper == ADODB_ASSOC_CASE_LOWER) {
|
||||
return $this->fields;
|
||||
}
|
||||
$row = ADORecordSet::GetRowAssoc($upper);
|
||||
return $row;
|
||||
}
|
||||
@@ -883,8 +973,9 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
/* Use associative array to get fields array */
|
||||
function Fields($colname)
|
||||
{
|
||||
if ($this->fetchMode != MYSQLI_NUM)
|
||||
if ($this->fetchMode != MYSQLI_NUM) {
|
||||
return @$this->fields[$colname];
|
||||
}
|
||||
|
||||
if (!$this->bind) {
|
||||
$this->bind = array();
|
||||
@@ -898,11 +989,9 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
|
||||
function _seek($row)
|
||||
{
|
||||
if ($this->_numOfRows == 0)
|
||||
return false;
|
||||
|
||||
if ($row < 0)
|
||||
if ($this->_numOfRows == 0 || $row < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mysqli_data_seek($this->_queryID, $row);
|
||||
$this->EOF = false;
|
||||
@@ -945,7 +1034,10 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
$this->_currentRow++;
|
||||
$this->fields = @mysqli_fetch_array($this->_queryID,$this->fetchMode);
|
||||
|
||||
if (is_array($this->fields)) return true;
|
||||
if (is_array($this->fields)) {
|
||||
$this->_updatefields();
|
||||
return true;
|
||||
}
|
||||
$this->EOF = true;
|
||||
return false;
|
||||
}
|
||||
@@ -953,6 +1045,7 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
function _fetch()
|
||||
{
|
||||
$this->fields = mysqli_fetch_array($this->_queryID,$this->fetchMode);
|
||||
$this->_updatefields();
|
||||
return is_array($this->fields);
|
||||
}
|
||||
|
||||
@@ -961,17 +1054,15 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
//if results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014
|
||||
//only a problem with persistant connections
|
||||
|
||||
//mysqli_next_result($this->connection->_connectionID); trashes the DB side attached results.
|
||||
|
||||
if($this->connection->_connectionID) {
|
||||
while(mysqli_more_results($this->connection->_connectionID)){
|
||||
@mysqli_next_result($this->connection->_connectionID);
|
||||
mysqli_next_result($this->connection->_connectionID);
|
||||
}
|
||||
}
|
||||
|
||||
//Because you can have one attached result, without tripping mysqli_more_results
|
||||
@mysqli_next_result($this->connection->_connectionID);
|
||||
|
||||
|
||||
if($this->_queryID instanceof mysqli_result) {
|
||||
mysqli_free_result($this->_queryID);
|
||||
}
|
||||
$this->_queryID = false;
|
||||
}
|
||||
|
||||
@@ -1036,7 +1127,6 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
case 'MEDIUMTEXT':
|
||||
return 'X';
|
||||
|
||||
|
||||
// php_mysql extension always returns 'blob' even if 'text'
|
||||
// so we have to check whether binary...
|
||||
case 'IMAGE':
|
||||
@@ -1047,13 +1137,12 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
case MYSQLI_TYPE_BLOB :
|
||||
case MYSQLI_TYPE_LONG_BLOB :
|
||||
case MYSQLI_TYPE_MEDIUM_BLOB :
|
||||
|
||||
return !empty($fieldobj->binary) ? 'B' : 'X';
|
||||
|
||||
case 'YEAR':
|
||||
case 'DATE':
|
||||
case MYSQLI_TYPE_DATE :
|
||||
case MYSQLI_TYPE_YEAR :
|
||||
|
||||
return 'D';
|
||||
|
||||
case 'TIME':
|
||||
@@ -1064,7 +1153,6 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
case MYSQLI_TYPE_NEWDATE :
|
||||
case MYSQLI_TYPE_TIME :
|
||||
case MYSQLI_TYPE_TIMESTAMP :
|
||||
|
||||
return 'T';
|
||||
|
||||
case 'INT':
|
||||
@@ -1079,12 +1167,9 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
case MYSQLI_TYPE_LONGLONG :
|
||||
case MYSQLI_TYPE_SHORT :
|
||||
case MYSQLI_TYPE_TINY :
|
||||
|
||||
if (!empty($fieldobj->primary_key)) return 'R';
|
||||
|
||||
return 'I';
|
||||
|
||||
|
||||
// Added floating-point types
|
||||
// Maybe not necessery.
|
||||
case 'FLOAT':
|
||||
@@ -1106,9 +1191,9 @@ if (! defined("_ADODB_MYSQLI_LAYER")) {
|
||||
|
||||
class ADORecordSet_array_mysqli extends ADORecordSet_array {
|
||||
|
||||
function ADORecordSet_array_mysqli($id=-1,$mode=false)
|
||||
function __construct($id=-1,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_array($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
function MetaType($t, $len = -1, $fieldobj = false)
|
||||
@@ -1143,7 +1228,6 @@ class ADORecordSet_array_mysqli extends ADORecordSet_array {
|
||||
case 'MEDIUMTEXT':
|
||||
return 'X';
|
||||
|
||||
|
||||
// php_mysql extension always returns 'blob' even if 'text'
|
||||
// so we have to check whether binary...
|
||||
case 'IMAGE':
|
||||
@@ -1207,5 +1291,3 @@ class ADORecordSet_array_mysqli extends ADORecordSet_array {
|
||||
} // function
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -10,6 +12,11 @@
|
||||
MySQL code that supports transactions. For MySQL 3.23 or later.
|
||||
Code from James Poon <jpoon88@yahoo.com>
|
||||
|
||||
This driver extends the deprecated mysql driver, and was originally designed to be a
|
||||
portable driver in the same manner as oci8po and mssqlpo. Its functionality
|
||||
is exactly duplicated in the mysqlt driver, which is itself deprecated.
|
||||
This driver will be removed in ADOdb version 6.0.0.
|
||||
|
||||
Requires mysql client. Works on Windows and Unix.
|
||||
*/
|
||||
|
||||
@@ -25,7 +32,7 @@ class ADODB_mysqlt extends ADODB_mysql {
|
||||
var $hasTransactions = true;
|
||||
var $autoRollback = true; // apparently mysql does not autorollback properly
|
||||
|
||||
function ADODB_mysqlt()
|
||||
function __construct()
|
||||
{
|
||||
global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
|
||||
}
|
||||
@@ -59,7 +66,7 @@ class ADODB_mysqlt extends ADODB_mysql {
|
||||
return true;
|
||||
}
|
||||
|
||||
function RowLock($tables,$where='',$col='1 as adodb_ignore')
|
||||
function RowLock($tables,$where='',$col='1 as adodbignore')
|
||||
{
|
||||
if ($this->transCnt==0) $this->BeginTrans();
|
||||
if ($where) $where = ' where '.$where;
|
||||
@@ -72,7 +79,7 @@ class ADODB_mysqlt extends ADODB_mysql {
|
||||
class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
||||
var $databaseType = "mysqlt";
|
||||
|
||||
function ADORecordSet_mysqlt($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -90,7 +97,7 @@ class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
||||
}
|
||||
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function MoveNext()
|
||||
@@ -109,24 +116,9 @@ class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
||||
|
||||
class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
|
||||
|
||||
function ADORecordSet_ext_mysqlt($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
switch ($mode)
|
||||
{
|
||||
case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
|
||||
case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
|
||||
|
||||
case ADODB_FETCH_DEFAULT:
|
||||
case ADODB_FETCH_BOTH:
|
||||
default:
|
||||
$this->fetchMode = MYSQL_BOTH; break;
|
||||
}
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID,$mode);
|
||||
}
|
||||
|
||||
function MoveNext()
|
||||
@@ -134,5 +126,3 @@ class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
|
||||
return adodb_movenext($this);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 8.
|
||||
|
||||
MySQL code that supports transactions. For MySQL 3.23 or later.
|
||||
Code from James Poon <jpoon88@yahoo.com>
|
||||
This driver only supports the original MySQL driver in transactional mode. It
|
||||
is deprected in PHP version 5.5 and removed in PHP version 7. It is deprecated
|
||||
as of ADOdb version 5.20.0. Use the mysqli driver instead, which supports both
|
||||
transactional and non-transactional updates
|
||||
|
||||
Requires mysql client. Works on Windows and Unix.
|
||||
*/
|
||||
@@ -25,7 +29,7 @@ class ADODB_mysqlt extends ADODB_mysql {
|
||||
var $hasTransactions = true;
|
||||
var $autoRollback = true; // apparently mysql does not autorollback properly
|
||||
|
||||
function ADODB_mysqlt()
|
||||
function __construct()
|
||||
{
|
||||
global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
|
||||
}
|
||||
@@ -76,7 +80,7 @@ class ADODB_mysqlt extends ADODB_mysql {
|
||||
return $ok ? true : false;
|
||||
}
|
||||
|
||||
function RowLock($tables,$where='',$col='1 as adodb_ignore')
|
||||
function RowLock($tables,$where='',$col='1 as adodbignore')
|
||||
{
|
||||
if ($this->transCnt==0) $this->BeginTrans();
|
||||
if ($where) $where = ' where '.$where;
|
||||
@@ -89,7 +93,7 @@ class ADODB_mysqlt extends ADODB_mysql {
|
||||
class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
||||
var $databaseType = "mysqlt";
|
||||
|
||||
function ADORecordSet_mysqlt($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -107,7 +111,7 @@ class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
||||
}
|
||||
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function MoveNext()
|
||||
@@ -126,30 +130,8 @@ class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
||||
|
||||
class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
|
||||
|
||||
function ADORecordSet_ext_mysqlt($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
switch ($mode)
|
||||
{
|
||||
case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
|
||||
case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
|
||||
|
||||
case ADODB_FETCH_DEFAULT:
|
||||
case ADODB_FETCH_BOTH:
|
||||
default:
|
||||
$this->fetchMode = MYSQL_BOTH; break;
|
||||
}
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
}
|
||||
|
||||
function MoveNext()
|
||||
{
|
||||
return adodb_movenext($this);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
|
||||
Based on the previous postgres drivers.
|
||||
@@ -48,7 +50,7 @@ class ADODB_netezza extends ADODB_postgres64 {
|
||||
// http://bugs.php.net/bug.php?id=25404
|
||||
|
||||
|
||||
function ADODB_netezza()
|
||||
function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -139,32 +141,17 @@ class ADORecordSet_netezza extends ADORecordSet_postgres64
|
||||
var $databaseType = "netezza";
|
||||
var $canSeek = true;
|
||||
|
||||
function ADORecordSet_netezza($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
switch ($mode)
|
||||
{
|
||||
case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
|
||||
case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
|
||||
|
||||
case ADODB_FETCH_DEFAULT:
|
||||
case ADODB_FETCH_BOTH:
|
||||
default: $this->fetchMode = PGSQL_BOTH; break;
|
||||
}
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID,$mode);
|
||||
}
|
||||
|
||||
// _initrs modified to disable blob handling
|
||||
function _initrs()
|
||||
{
|
||||
global $ADODB_COUNTRECS;
|
||||
$this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($this->_queryID):-1;
|
||||
$this->_numOfFields = @pg_numfields($this->_queryID);
|
||||
$this->_numOfRows = ($ADODB_COUNTRECS)? @pg_num_rows($this->_queryID):-1;
|
||||
$this->_numOfFields = @pg_num_fields($this->_queryID);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V5.06 16 Oct 2008 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @version v5.20.4 30-Mar-2016
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
* Whenever there is any discrepancy between the two licenses,
|
||||
* the BSD license will take precedence.
|
||||
@@ -21,11 +23,6 @@ class ADODB_oci805 extends ADODB_oci8 {
|
||||
var $databaseType = "oci805";
|
||||
var $connectSID = true;
|
||||
|
||||
function ADODB_oci805()
|
||||
{
|
||||
$this->ADODB_oci8();
|
||||
}
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
// seems that oracle only supports 1 hint comment in 8i
|
||||
@@ -51,9 +48,8 @@ class ADODB_oci805 extends ADODB_oci8 {
|
||||
|
||||
class ADORecordset_oci805 extends ADORecordset_oci8 {
|
||||
var $databaseType = "oci805";
|
||||
function ADORecordset_oci805($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordset_oci8($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim. All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -28,13 +30,13 @@ class ADODB_oci8po extends ADODB_oci8 {
|
||||
var $metaColumnsSQL = "select lower(cname),coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
|
||||
var $metaTablesSQL = "select lower(table_name),table_type from cat where table_type in ('TABLE','VIEW')";
|
||||
|
||||
function ADODB_oci8po()
|
||||
function __construct()
|
||||
{
|
||||
$this->_hasOCIFetchStatement = ADODB_PHPVER >= 0x4200;
|
||||
# oci8po does not support adodb extension: adodb_movenext()
|
||||
}
|
||||
|
||||
function Param($name)
|
||||
function Param($name,$type='C')
|
||||
{
|
||||
return '?';
|
||||
}
|
||||
@@ -49,6 +51,11 @@ class ADODB_oci8po extends ADODB_oci8 {
|
||||
return ADODB_oci8::Prepare($sql,$cursor);
|
||||
}
|
||||
|
||||
function Execute($sql,$inputarr=false)
|
||||
{
|
||||
return ADOConnection::Execute($sql,$inputarr);
|
||||
}
|
||||
|
||||
// emulate handling of parameters ? ?, replacing with :bind0 :bind1
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
@@ -59,11 +66,22 @@ class ADODB_oci8po extends ADODB_oci8 {
|
||||
$arr['bind'.$i++] = $v;
|
||||
}
|
||||
} else {
|
||||
// Need to identify if the ? is inside a quoted string, and if
|
||||
// so not use it as a bind variable
|
||||
preg_match_all('/".*\??"|\'.*\?.*?\'/', $sql, $matches);
|
||||
foreach($matches[0] as $qmMatch){
|
||||
$qmReplace = str_replace('?', '-QUESTIONMARK-', $qmMatch);
|
||||
$sql = str_replace($qmMatch, $qmReplace, $sql);
|
||||
}
|
||||
|
||||
$sqlarr = explode('?',$sql);
|
||||
$sql = $sqlarr[0];
|
||||
|
||||
foreach($inputarr as $k => $v) {
|
||||
$sql .= ":$k" . $sqlarr[++$i];
|
||||
}
|
||||
|
||||
$sql = str_replace('-QUESTIONMARK-', '?', $sql);
|
||||
}
|
||||
}
|
||||
return ADODB_oci8::_query($sql,$inputarr);
|
||||
@@ -78,9 +96,9 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
|
||||
|
||||
var $databaseType = 'oci8po';
|
||||
|
||||
function ADORecordset_oci8po($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
$this->ADORecordset_oci8($queryID,$mode);
|
||||
parent::__construct($queryID,$mode);
|
||||
}
|
||||
|
||||
function Fields($colname)
|
||||
@@ -103,29 +121,19 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
|
||||
$fld = new ADOFieldObject;
|
||||
$fieldOffset += 1;
|
||||
$fld->name = OCIcolumnname($this->_queryID, $fieldOffset);
|
||||
if (ADODB_ASSOC_CASE == 0) $fld->name = strtolower($fld->name);
|
||||
if (ADODB_ASSOC_CASE == ADODB_ASSOC_CASE_LOWER) {
|
||||
$fld->name = strtolower($fld->name);
|
||||
}
|
||||
$fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
|
||||
$fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
|
||||
if ($fld->type == 'NUMBER') {
|
||||
//$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
|
||||
$sc = OCIColumnScale($this->_queryID, $fieldOffset);
|
||||
if ($sc == 0) $fld->type = 'INT';
|
||||
if ($sc == 0) {
|
||||
$fld->type = 'INT';
|
||||
}
|
||||
}
|
||||
return $fld;
|
||||
}
|
||||
/*
|
||||
function MoveNext()
|
||||
{
|
||||
if (@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
|
||||
$this->_currentRow += 1;
|
||||
return true;
|
||||
}
|
||||
if (!$this->EOF) {
|
||||
$this->_currentRow += 1;
|
||||
$this->EOF = true;
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
|
||||
// 10% speedup to move MoveNext to child class
|
||||
function MoveNext()
|
||||
@@ -133,8 +141,8 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
|
||||
if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
|
||||
global $ADODB_ANSI_PADDING_OFF;
|
||||
$this->_currentRow++;
|
||||
$this->_updatefields();
|
||||
|
||||
if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
|
||||
if (!empty($ADODB_ANSI_PADDING_OFF)) {
|
||||
foreach($this->fields as $k => $v) {
|
||||
if (is_string($v)) $this->fields[$k] = rtrim($v);
|
||||
@@ -165,7 +173,7 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
|
||||
$arr = array();
|
||||
return $arr;
|
||||
}
|
||||
if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
|
||||
$this->_updatefields();
|
||||
$results = array();
|
||||
$cnt = 0;
|
||||
while (!$this->EOF && $nrows != $cnt) {
|
||||
@@ -176,33 +184,14 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
|
||||
return $results;
|
||||
}
|
||||
|
||||
// Create associative array
|
||||
function _updatefields()
|
||||
{
|
||||
if (ADODB_ASSOC_CASE == 2) return; // native
|
||||
|
||||
$arr = array();
|
||||
$lowercase = (ADODB_ASSOC_CASE == 0);
|
||||
|
||||
foreach($this->fields as $k => $v) {
|
||||
if (is_integer($k)) $arr[$k] = $v;
|
||||
else {
|
||||
if ($lowercase)
|
||||
$arr[strtolower($k)] = $v;
|
||||
else
|
||||
$arr[strtoupper($k)] = $v;
|
||||
}
|
||||
}
|
||||
$this->fields = $arr;
|
||||
}
|
||||
|
||||
function _fetch()
|
||||
{
|
||||
$ret = @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode);
|
||||
if ($ret) {
|
||||
global $ADODB_ANSI_PADDING_OFF;
|
||||
|
||||
if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
|
||||
$ret = @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode);
|
||||
if ($ret) {
|
||||
$this->_updatefields();
|
||||
|
||||
if (!empty($ADODB_ANSI_PADDING_OFF)) {
|
||||
foreach($this->fields as $k => $v) {
|
||||
if (is_string($v)) $this->fields[$k] = rtrim($v);
|
||||
@@ -213,6 +202,3 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
|
||||
Portable version of oci8 driver, to make it more similar to other database drivers.
|
||||
The main differences are
|
||||
|
||||
1. that the OCI_ASSOC names are in lowercase instead of uppercase.
|
||||
2. bind variables are mapped using ? instead of :<bindvar>
|
||||
|
||||
Should some emulation of RecordCount() be implemented?
|
||||
|
||||
*/
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
|
||||
|
||||
class ADODB_oci8quercus extends ADODB_oci8 {
|
||||
var $databaseType = 'oci8quercus';
|
||||
var $dataProvider = 'oci8';
|
||||
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------
|
||||
Class Name: Recordset
|
||||
--------------------------------------------------------------------------------------*/
|
||||
|
||||
class ADORecordset_oci8quercus extends ADORecordset_oci8 {
|
||||
|
||||
var $databaseType = 'oci8quercus';
|
||||
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
parent::__construct($queryID,$mode);
|
||||
}
|
||||
|
||||
function _FetchField($fieldOffset = -1)
|
||||
{
|
||||
global $QUERCUS;
|
||||
$fld = new ADOFieldObject;
|
||||
|
||||
if (!empty($QUERCUS)) {
|
||||
$fld->name = oci_field_name($this->_queryID, $fieldOffset);
|
||||
$fld->type = oci_field_type($this->_queryID, $fieldOffset);
|
||||
$fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
|
||||
|
||||
//if ($fld->name == 'VAL6_NUM_12_4') $fld->type = 'NUMBER';
|
||||
switch($fld->type) {
|
||||
case 'string': $fld->type = 'VARCHAR'; break;
|
||||
case 'real': $fld->type = 'NUMBER'; break;
|
||||
}
|
||||
} else {
|
||||
$fieldOffset += 1;
|
||||
$fld->name = oci_field_name($this->_queryID, $fieldOffset);
|
||||
$fld->type = oci_field_type($this->_queryID, $fieldOffset);
|
||||
$fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
|
||||
}
|
||||
switch($fld->type) {
|
||||
case 'NUMBER':
|
||||
$p = oci_field_precision($this->_queryID, $fieldOffset);
|
||||
$sc = oci_field_scale($this->_queryID, $fieldOffset);
|
||||
if ($p != 0 && $sc == 0) $fld->type = 'INT';
|
||||
$fld->scale = $p;
|
||||
break;
|
||||
|
||||
case 'CLOB':
|
||||
case 'NCLOB':
|
||||
case 'BLOB':
|
||||
$fld->max_length = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return $fld;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -39,7 +41,7 @@ class ADODB_odbc extends ADOConnection {
|
||||
var $_lastAffectedRows = 0;
|
||||
var $uCaseTables = true; // for meta* functions, uppercase table names
|
||||
|
||||
function ADODB_odbc()
|
||||
function __construct()
|
||||
{
|
||||
$this->_haserrorfunctions = ADODB_PHPVER >= 0x4050;
|
||||
$this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
|
||||
@@ -52,9 +54,13 @@ class ADODB_odbc extends ADOConnection {
|
||||
|
||||
if (!function_exists('odbc_connect')) return null;
|
||||
|
||||
if ($this->debug && $argDatabasename && $this->databaseType != 'vfp') {
|
||||
ADOConnection::outp("For odbc Connect(), $argDatabasename is not used. Place dsn in 1st parameter.");
|
||||
if (!empty($argDatabasename) && stristr($argDSN, 'Database=') === false) {
|
||||
$argDSN = trim($argDSN);
|
||||
$endDSN = substr($argDSN, strlen($argDSN) - 1);
|
||||
if ($endDSN != ';') $argDSN .= ';';
|
||||
$argDSN .= 'Database='.$argDatabasename;
|
||||
}
|
||||
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
|
||||
else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode);
|
||||
@@ -128,7 +134,7 @@ class ADODB_odbc extends ADOConnection {
|
||||
}
|
||||
|
||||
var $_dropSeqSQL = 'drop table %s';
|
||||
function DropSequence($seqname)
|
||||
function DropSequence($seqname = 'adodbseq')
|
||||
{
|
||||
if (empty($this->_dropSeqSQL)) return false;
|
||||
return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
|
||||
@@ -161,6 +167,12 @@ class ADODB_odbc extends ADOConnection {
|
||||
$num += 1;
|
||||
$this->genID = $num;
|
||||
return $num;
|
||||
} elseif ($this->affected_rows() == 0) {
|
||||
// some drivers do not return a valid value => try with another method
|
||||
$value = $this->GetOne("select id from $seq");
|
||||
if ($value == $num + 1) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fn = $this->raiseErrorFn) {
|
||||
@@ -230,7 +242,7 @@ class ADODB_odbc extends ADOConnection {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function MetaPrimaryKeys($table)
|
||||
function MetaPrimaryKeys($table,$owner=false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -264,7 +276,7 @@ class ADODB_odbc extends ADOConnection {
|
||||
|
||||
|
||||
|
||||
function MetaTables($ttype=false)
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -596,7 +608,7 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
var $useFetchArray;
|
||||
var $_has_stupid_odbc_fetch_api_change;
|
||||
|
||||
function ADORecordSet_odbc($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -609,7 +621,7 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
// the following is required for mysql odbc driver in 4.3.1 -- why?
|
||||
$this->EOF = false;
|
||||
$this->_currentRow = -1;
|
||||
//$this->ADORecordSet($id);
|
||||
//parent::__construct($id);
|
||||
}
|
||||
|
||||
|
||||
@@ -673,7 +685,7 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
$this->fetchMode = $savem;
|
||||
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
|
||||
$results = array();
|
||||
@@ -691,17 +703,7 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
{
|
||||
if ($this->_numOfRows != 0 && !$this->EOF) {
|
||||
$this->_currentRow++;
|
||||
|
||||
if ($this->_has_stupid_odbc_fetch_api_change)
|
||||
$rez = @odbc_fetch_into($this->_queryID,$this->fields);
|
||||
else {
|
||||
$row = 0;
|
||||
$rez = @odbc_fetch_into($this->_queryID,$row,$this->fields);
|
||||
}
|
||||
if ($rez) {
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
}
|
||||
if( $this->_fetch() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -712,7 +714,7 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
|
||||
function _fetch()
|
||||
{
|
||||
|
||||
$this->fields = false;
|
||||
if ($this->_has_stupid_odbc_fetch_api_change)
|
||||
$rez = @odbc_fetch_into($this->_queryID,$this->fields);
|
||||
else {
|
||||
@@ -721,11 +723,10 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
}
|
||||
if ($rez) {
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
$this->fields = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -735,4 +736,3 @@ class ADORecordSet_odbc extends ADORecordSet {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -110,10 +112,10 @@ if (!defined('ADODB_ODBC_DB2')){
|
||||
var $hasInsertID = true;
|
||||
var $rsPrefix = 'ADORecordset_odbc_';
|
||||
|
||||
function ADODB_DB2()
|
||||
function __construct()
|
||||
{
|
||||
if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC;
|
||||
$this->ADODB_odbc();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function IfNull( $field, $ifNull )
|
||||
@@ -134,7 +136,7 @@ if (!defined('ADODB_ODBC_DB2')){
|
||||
return $this->GetOne($this->identitySQL);
|
||||
}
|
||||
|
||||
function RowLock($tables,$where,$col='1 as ignore')
|
||||
function RowLock($tables,$where,$col='1 as adodbignore')
|
||||
{
|
||||
if ($this->_autocommit) $this->BeginTrans();
|
||||
return $this->GetOne("select $col from $tables where $where for update");
|
||||
@@ -278,7 +280,7 @@ if (!defined('ADODB_ODBC_DB2')){
|
||||
}
|
||||
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
|
||||
function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0)
|
||||
{
|
||||
$nrows = (integer) $nrows;
|
||||
if ($offset <= 0) {
|
||||
@@ -304,9 +306,9 @@ if (!defined('ADODB_ODBC_DB2')){
|
||||
|
||||
var $databaseType = "db2";
|
||||
|
||||
function ADORecordSet_db2($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_odbc($id,$mode);
|
||||
parent::__construct($id,$mode);
|
||||
}
|
||||
|
||||
function MetaType($t,$len=-1,$fieldobj=false)
|
||||
@@ -365,4 +367,3 @@ if (!defined('ADODB_ODBC_DB2')){
|
||||
}
|
||||
|
||||
} //define
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -23,10 +25,15 @@ if (!defined('_ADODB_ODBC_LAYER')) {
|
||||
class ADODB_odbc_mssql extends ADODB_odbc {
|
||||
var $databaseType = 'odbc_mssql';
|
||||
var $fmtDate = "'Y-m-d'";
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $fmtTimeStamp = "'Y-m-d\TH:i:s'";
|
||||
var $_bindInputArray = true;
|
||||
var $metaDatabasesSQL = "select name from sysdatabases where name <> 'master'";
|
||||
var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE'))";
|
||||
var $metaColumnsSQL = "select c.name,t.name,c.length from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
|
||||
var $metaColumnsSQL = # xtype==61 is datetime
|
||||
"select c.name,t.name,c.length,c.isnullable, c.status,
|
||||
(case when c.xusertype=61 then 0 else c.xprec end),
|
||||
(case when c.xusertype=61 then 0 else c.xscale end)
|
||||
from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
|
||||
var $hasTop = 'top'; // support mssql/interbase SELECT TOP 10 * FROM TABLE
|
||||
var $sysDate = 'GetDate()';
|
||||
var $sysTimeStamp = 'GetDate()';
|
||||
@@ -35,14 +42,14 @@ class ADODB_odbc_mssql extends ADODB_odbc {
|
||||
var $substr = 'substring';
|
||||
var $length = 'len';
|
||||
var $ansiOuter = true; // for mssql7 or later
|
||||
var $identitySQL = 'select @@identity'; // 'select SCOPE_IDENTITY'; # for mssql 2000
|
||||
var $identitySQL = 'select SCOPE_IDENTITY()'; // 'select SCOPE_IDENTITY'; # for mssql 2000
|
||||
var $hasInsertID = true;
|
||||
var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # When SET CONCAT_NULL_YIELDS_NULL is ON,
|
||||
# concatenating a null value with a string yields a NULL result
|
||||
|
||||
function ADODB_odbc_mssql()
|
||||
function __construct()
|
||||
{
|
||||
$this->ADODB_odbc();
|
||||
parent::__construct();
|
||||
//$this->curmode = SQL_CUR_USE_ODBC;
|
||||
}
|
||||
|
||||
@@ -50,9 +57,10 @@ class ADODB_odbc_mssql extends ADODB_odbc {
|
||||
function ServerInfo()
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
$save=$this->SetFetchMode(ADODB_FETCH_NUM);
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
$row = $this->GetRow("execute sp_server_info 2");
|
||||
$this->SetFetchMode($save);
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
if (!is_array($row)) return false;
|
||||
$arr['description'] = $row[2];
|
||||
$arr['version'] = ADOConnection::_findvers($arr['description']);
|
||||
@@ -116,7 +124,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
if ($mask) {
|
||||
if ($mask) {//$this->debug=1;
|
||||
$save = $this->metaTablesSQL;
|
||||
$mask = $this->qstr($mask);
|
||||
$this->metaTablesSQL .= " AND name like $mask";
|
||||
@@ -131,8 +139,59 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
function MetaColumns($table, $normalize=true)
|
||||
{
|
||||
$arr = ADOConnection::MetaColumns($table);
|
||||
return $arr;
|
||||
|
||||
$this->_findschema($table,$schema);
|
||||
if ($schema) {
|
||||
$dbName = $this->database;
|
||||
$this->SelectDB($schema);
|
||||
}
|
||||
global $ADODB_FETCH_MODE;
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
|
||||
if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
|
||||
$rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
|
||||
|
||||
if ($schema) {
|
||||
$this->SelectDB($dbName);
|
||||
}
|
||||
|
||||
if (isset($savem)) $this->SetFetchMode($savem);
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
if (!is_object($rs)) {
|
||||
$false = false;
|
||||
return $false;
|
||||
}
|
||||
|
||||
$retarr = array();
|
||||
while (!$rs->EOF){
|
||||
$fld = new ADOFieldObject();
|
||||
$fld->name = $rs->fields[0];
|
||||
$fld->type = $rs->fields[1];
|
||||
|
||||
$fld->not_null = (!$rs->fields[3]);
|
||||
$fld->auto_increment = ($rs->fields[4] == 128); // sys.syscolumns status field. 0x80 = 128 ref: http://msdn.microsoft.com/en-us/library/ms186816.aspx
|
||||
|
||||
|
||||
if (isset($rs->fields[5]) && $rs->fields[5]) {
|
||||
if ($rs->fields[5]>0) $fld->max_length = $rs->fields[5];
|
||||
$fld->scale = $rs->fields[6];
|
||||
if ($fld->scale>0) $fld->max_length += 1;
|
||||
} else
|
||||
$fld->max_length = $rs->fields[2];
|
||||
|
||||
|
||||
if ($save == ADODB_FETCH_NUM) {
|
||||
$retarr[] = $fld;
|
||||
} else {
|
||||
$retarr[strtoupper($fld->name)] = $fld;
|
||||
}
|
||||
$rs->MoveNext();
|
||||
}
|
||||
|
||||
$rs->Close();
|
||||
return $retarr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +254,7 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
// "Stein-Aksel Basma" <basma@accelero.no>
|
||||
// tested with MSSQL 2000
|
||||
function MetaPrimaryKeys($table)
|
||||
function MetaPrimaryKeys($table, $owner = false)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -297,9 +356,8 @@ class ADORecordSet_odbc_mssql extends ADORecordSet_odbc {
|
||||
|
||||
var $databaseType = 'odbc_mssql';
|
||||
|
||||
function ADORecordSet_odbc_mssql($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbc($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -31,12 +33,7 @@ class ADODB_odbc_oracle extends ADODB_odbc {
|
||||
|
||||
//var $_bindInputArray = false;
|
||||
|
||||
function ADODB_odbc_oracle()
|
||||
{
|
||||
$this->ADODB_odbc();
|
||||
}
|
||||
|
||||
function MetaTables()
|
||||
function MetaTables($ttype = false, $showSchema = false, $mask = false)
|
||||
{
|
||||
$false = false;
|
||||
$rs = $this->Execute($this->metaTablesSQL);
|
||||
@@ -107,9 +104,8 @@ class ADORecordSet_odbc_oracle extends ADORecordSet_odbc {
|
||||
|
||||
var $databaseType = 'odbc_oracle';
|
||||
|
||||
function ADORecordSet_odbc_oracle($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbc($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -33,7 +35,7 @@ class ADODB_odbtp extends ADOConnection{
|
||||
var $_canPrepareSP = false;
|
||||
var $_dontPoolDBC = true;
|
||||
|
||||
function ADODB_odbtp()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -120,7 +122,7 @@ class ADODB_odbtp extends ADOConnection{
|
||||
return $this->Execute("insert into adodb_seq values('$seqname',$start)");
|
||||
}
|
||||
|
||||
function DropSequence($seqname)
|
||||
function DropSequence($seqname = 'adodbseq')
|
||||
{
|
||||
if (empty($this->_dropSeqSQL)) return false;
|
||||
return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
|
||||
@@ -172,6 +174,9 @@ class ADODB_odbtp extends ADOConnection{
|
||||
//if uid & pwd can be separate
|
||||
function _connect($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='')
|
||||
{
|
||||
if ($argPassword && stripos($UserOrDSN,'DRIVER=') !== false) {
|
||||
$this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN.';PWD='.$argPassword);
|
||||
} else
|
||||
$this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN,$argPassword,$argDatabase);
|
||||
if ($this->_connectionID === false) {
|
||||
$this->_errorMsg = $this->ErrorMsg() ;
|
||||
@@ -472,7 +477,7 @@ class ADODB_odbtp extends ADOConnection{
|
||||
return array($sql,$stmt,false);
|
||||
}
|
||||
|
||||
function PrepareSP($sql)
|
||||
function PrepareSP($sql, $param = true)
|
||||
{
|
||||
if (!$this->_canPrepareSP) return $sql; // Can't prepare procedures
|
||||
|
||||
@@ -551,7 +556,7 @@ class ADODB_odbtp extends ADOConnection{
|
||||
}
|
||||
}
|
||||
|
||||
function MetaIndexes_mssql($table,$primary=false)
|
||||
function MetaIndexes_mssql($table,$primary=false, $owner = false)
|
||||
{
|
||||
$table = strtolower($this->qstr($table));
|
||||
|
||||
@@ -665,14 +670,14 @@ class ADORecordSet_odbtp extends ADORecordSet {
|
||||
var $databaseType = 'odbtp';
|
||||
var $canSeek = true;
|
||||
|
||||
function ADORecordSet_odbtp($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
$mode = $ADODB_FETCH_MODE;
|
||||
}
|
||||
$this->fetchMode = $mode;
|
||||
$this->ADORecordSet($queryID);
|
||||
parent::__construct($queryID);
|
||||
}
|
||||
|
||||
function _initrs()
|
||||
@@ -788,9 +793,9 @@ class ADORecordSet_odbtp_mssql extends ADORecordSet_odbtp {
|
||||
|
||||
var $databaseType = 'odbtp_mssql';
|
||||
|
||||
function ADORecordSet_odbtp_mssql($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbtp($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,9 +803,9 @@ class ADORecordSet_odbtp_access extends ADORecordSet_odbtp {
|
||||
|
||||
var $databaseType = 'odbtp_access';
|
||||
|
||||
function ADORecordSet_odbtp_access($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbtp($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,9 +813,9 @@ class ADORecordSet_odbtp_vfp extends ADORecordSet_odbtp {
|
||||
|
||||
var $databaseType = 'odbtp_vfp';
|
||||
|
||||
function ADORecordSet_odbtp_vfp($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbtp($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,9 +823,9 @@ class ADORecordSet_odbtp_oci8 extends ADORecordSet_odbtp {
|
||||
|
||||
var $databaseType = 'odbtp_oci8';
|
||||
|
||||
function ADORecordSet_odbtp_oci8($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbtp($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -828,9 +833,8 @@ class ADORecordSet_odbtp_sybase extends ADORecordSet_odbtp {
|
||||
|
||||
var $databaseType = 'odbtp_sybase';
|
||||
|
||||
function ADORecordSet_odbtp_sybase($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
return $this->ADORecordSet_odbtp($id,$mode);
|
||||
return parent::__construct($id,$mode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
@@ -30,10 +32,4 @@ if (!defined('_ADODB_ODBTP_LAYER')) {
|
||||
class ADODB_odbtp_unicode extends ADODB_odbtp {
|
||||
var $databaseType = 'odbtp';
|
||||
var $_useUnicodeSQL = true;
|
||||
|
||||
function ADODB_odbtp_unicode()
|
||||
{
|
||||
$this->ADODB_odbtp();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -27,12 +29,12 @@ class ADODB_oracle extends ADOConnection {
|
||||
var $sysTimeStamp = 'SYSDATE';
|
||||
var $connectSID = true;
|
||||
|
||||
function ADODB_oracle()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
// format and return date string in database date format
|
||||
function DBDate($d)
|
||||
function DBDate($d, $isfld = false)
|
||||
{
|
||||
if (is_string($d)) $d = ADORecordSet::UnixDate($d);
|
||||
if (is_object($d)) $ds = $d->format($this->fmtDate);
|
||||
@@ -41,7 +43,7 @@ class ADODB_oracle extends ADOConnection {
|
||||
}
|
||||
|
||||
// format and return date string in database timestamp format
|
||||
function DBTimeStamp($ts)
|
||||
function DBTimeStamp($ts, $isfld = false)
|
||||
{
|
||||
|
||||
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
|
||||
@@ -219,7 +221,7 @@ class ADORecordset_oracle extends ADORecordSet {
|
||||
var $databaseType = "oracle";
|
||||
var $bind = false;
|
||||
|
||||
function ADORecordset_oracle($queryID,$mode=false)
|
||||
function __construct($queryID,$mode=false)
|
||||
{
|
||||
|
||||
if ($mode === false) {
|
||||
@@ -303,7 +305,7 @@ class ADORecordset_oracle extends ADORecordSet {
|
||||
return @ora_close($this->_queryID);
|
||||
}
|
||||
|
||||
function MetaType($t,$len=-1)
|
||||
function MetaType($t, $len = -1, $fieldobj = false)
|
||||
{
|
||||
if (is_object($t)) {
|
||||
$fieldobj = $t;
|
||||
@@ -339,4 +341,3 @@ class ADORecordset_oracle extends ADORecordSet {
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,9 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
/**
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
@@ -14,6 +18,7 @@
|
||||
Where is float/decimal type in pdo_param_type
|
||||
LOB handling for CLOB/BLOB differs significantly
|
||||
*/
|
||||
|
||||
// security - hide paths
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
@@ -57,14 +62,7 @@ function adodb_pdo_type($t)
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------------*/
|
||||
|
||||
////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
class ADODB_pdo extends ADOConnection {
|
||||
@@ -75,7 +73,9 @@ class ADODB_pdo extends ADOConnection {
|
||||
var $replaceQuote = "''"; // string to use to replace quotes
|
||||
var $hasAffectedRows = true;
|
||||
var $_bindInputArray = true;
|
||||
var $_genIDSQL;
|
||||
var $_genSeqSQL = "create table %s (id integer)";
|
||||
var $_dropSeqSQL;
|
||||
var $_autocommit = true;
|
||||
var $_haserrorfunctions = true;
|
||||
var $_lastAffectedRows = 0;
|
||||
@@ -85,8 +85,9 @@ class ADODB_pdo extends ADOConnection {
|
||||
|
||||
var $dsnType = '';
|
||||
var $stmt = false;
|
||||
var $_driver;
|
||||
|
||||
function ADODB_pdo()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -112,11 +113,17 @@ class ADODB_pdo extends ADOConnection {
|
||||
|
||||
function Time()
|
||||
{
|
||||
if (!empty($this->_driver->_hasdual)) $sql = "select $this->sysTimeStamp from dual";
|
||||
else $sql = "select $this->sysTimeStamp";
|
||||
if (!empty($this->_driver->_hasdual)) {
|
||||
$sql = "select $this->sysTimeStamp from dual";
|
||||
}
|
||||
else {
|
||||
$sql = "select $this->sysTimeStamp";
|
||||
}
|
||||
|
||||
$rs = $this->_Execute($sql);
|
||||
if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
|
||||
if ($rs && !$rs->EOF) {
|
||||
return $this->UnixTimeStamp(reset($rs->fields));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -128,8 +135,19 @@ class ADODB_pdo extends ADOConnection {
|
||||
$this->dsnType = substr($argDSN,0,$at);
|
||||
|
||||
if ($argDatabasename) {
|
||||
switch($this->dsnType){
|
||||
case 'sqlsrv':
|
||||
$argDSN .= ';database='.$argDatabasename;
|
||||
break;
|
||||
case 'mssql':
|
||||
case 'mysql':
|
||||
case 'oci':
|
||||
case 'pgsql':
|
||||
case 'sqlite':
|
||||
default:
|
||||
$argDSN .= ';dbname='.$argDatabasename;
|
||||
}
|
||||
}
|
||||
try {
|
||||
$this->_connectionID = new PDO($argDSN, $argUsername, $argPassword);
|
||||
} catch (Exception $e) {
|
||||
@@ -142,10 +160,16 @@ class ADODB_pdo extends ADOConnection {
|
||||
|
||||
if ($this->_connectionID) {
|
||||
switch(ADODB_ASSOC_CASE){
|
||||
case 0: $m = PDO::CASE_LOWER; break;
|
||||
case 1: $m = PDO::CASE_UPPER; break;
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
$m = PDO::CASE_LOWER;
|
||||
break;
|
||||
case ADODB_ASSOC_CASE_UPPER:
|
||||
$m = PDO::CASE_UPPER;
|
||||
break;
|
||||
default:
|
||||
case 2: $m = PDO::CASE_NATURAL; break;
|
||||
case ADODB_ASSOC_CASE_NATIVE:
|
||||
$m = PDO::CASE_NATURAL;
|
||||
break;
|
||||
}
|
||||
|
||||
//$this->_connectionID->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_SILENT );
|
||||
@@ -154,18 +178,21 @@ class ADODB_pdo extends ADOConnection {
|
||||
$class = 'ADODB_pdo_'.$this->dsnType;
|
||||
//$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
|
||||
switch($this->dsnType) {
|
||||
case 'oci':
|
||||
case 'mysql':
|
||||
case 'pgsql':
|
||||
case 'mssql':
|
||||
case 'mysql':
|
||||
case 'oci':
|
||||
case 'pgsql':
|
||||
case 'sqlite':
|
||||
case 'sqlsrv':
|
||||
include_once(ADODB_DIR.'/drivers/adodb-pdo_'.$this->dsnType.'.inc.php');
|
||||
break;
|
||||
}
|
||||
if (class_exists($class))
|
||||
if (class_exists($class)) {
|
||||
$this->_driver = new $class();
|
||||
else
|
||||
}
|
||||
else {
|
||||
$this->_driver = new ADODB_pdo_base();
|
||||
}
|
||||
|
||||
$this->_driver->_connectionID = $this->_connectionID;
|
||||
$this->_UpdatePDO();
|
||||
@@ -178,9 +205,13 @@ class ADODB_pdo extends ADOConnection {
|
||||
function Concat()
|
||||
{
|
||||
$args = func_get_args();
|
||||
if(method_exists($this->_driver, 'Concat'))
|
||||
if(method_exists($this->_driver, 'Concat')) {
|
||||
return call_user_func_array(array($this->_driver, 'Concat'), $args);
|
||||
}
|
||||
|
||||
if (PHP_VERSION >= 5.3) {
|
||||
return call_user_func_array('parent::Concat', $args);
|
||||
}
|
||||
return call_user_func_array(array($this,'parent::Concat'), $args);
|
||||
}
|
||||
|
||||
@@ -222,8 +253,12 @@ class ADODB_pdo extends ADOConnection {
|
||||
function InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false)
|
||||
{
|
||||
$obj = $stmt[1];
|
||||
if ($type) $obj->bindParam($name,$var,$type,$maxLen);
|
||||
else $obj->bindParam($name, $var);
|
||||
if ($type) {
|
||||
$obj->bindParam($name, $var, $type, $maxLen);
|
||||
}
|
||||
else {
|
||||
$obj->bindParam($name, $var);
|
||||
}
|
||||
}
|
||||
|
||||
function OffsetDate($dayFraction,$date=false)
|
||||
@@ -233,65 +268,108 @@ class ADODB_pdo extends ADOConnection {
|
||||
|
||||
function ErrorMsg()
|
||||
{
|
||||
if ($this->_errormsg !== false) return $this->_errormsg;
|
||||
if (!empty($this->_stmt)) $arr = $this->_stmt->errorInfo();
|
||||
else if (!empty($this->_connectionID)) $arr = $this->_connectionID->errorInfo();
|
||||
else return 'No Connection Established';
|
||||
|
||||
if ($this->_errormsg !== false) {
|
||||
return $this->_errormsg;
|
||||
}
|
||||
if (!empty($this->_stmt)) {
|
||||
$arr = $this->_stmt->errorInfo();
|
||||
}
|
||||
else if (!empty($this->_connectionID)) {
|
||||
$arr = $this->_connectionID->errorInfo();
|
||||
}
|
||||
else {
|
||||
return 'No Connection Established';
|
||||
}
|
||||
|
||||
if ($arr) {
|
||||
if (sizeof($arr)<2) return '';
|
||||
if ((integer)$arr[1]) return $arr[2];
|
||||
else return '';
|
||||
} else return '-1';
|
||||
if (sizeof($arr)<2) {
|
||||
return '';
|
||||
}
|
||||
if ((integer)$arr[0]) {
|
||||
return $arr[2];
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
return '-1';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ErrorNo()
|
||||
{
|
||||
if ($this->_errorno !== false) return $this->_errorno;
|
||||
if (!empty($this->_stmt)) $err = $this->_stmt->errorCode();
|
||||
if ($this->_errorno !== false) {
|
||||
return $this->_errorno;
|
||||
}
|
||||
if (!empty($this->_stmt)) {
|
||||
$err = $this->_stmt->errorCode();
|
||||
}
|
||||
else if (!empty($this->_connectionID)) {
|
||||
$arr = $this->_connectionID->errorInfo();
|
||||
if (isset($arr[0])) $err = $arr[0];
|
||||
else $err = -1;
|
||||
} else
|
||||
if (isset($arr[0])) {
|
||||
$err = $arr[0];
|
||||
}
|
||||
else {
|
||||
$err = -1;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($err == '00000') return 0; // allows empty check
|
||||
if ($err == '00000') {
|
||||
return 0; // allows empty check
|
||||
}
|
||||
return $err;
|
||||
}
|
||||
|
||||
function SetTransactionMode($transaction_mode)
|
||||
{
|
||||
if(method_exists($this->_driver, 'SetTransactionMode'))
|
||||
if(method_exists($this->_driver, 'SetTransactionMode')) {
|
||||
return $this->_driver->SetTransactionMode($transaction_mode);
|
||||
}
|
||||
|
||||
return parent::SetTransactionMode($seqname);
|
||||
}
|
||||
|
||||
function BeginTrans()
|
||||
{
|
||||
if(method_exists($this->_driver, 'BeginTrans'))
|
||||
if(method_exists($this->_driver, 'BeginTrans')) {
|
||||
return $this->_driver->BeginTrans();
|
||||
}
|
||||
|
||||
if (!$this->hasTransactions) return false;
|
||||
if ($this->transOff) return true;
|
||||
if (!$this->hasTransactions) {
|
||||
return false;
|
||||
}
|
||||
if ($this->transOff) {
|
||||
return true;
|
||||
}
|
||||
$this->transCnt += 1;
|
||||
$this->_autocommit = false;
|
||||
$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,false);
|
||||
|
||||
return $this->_connectionID->beginTransaction();
|
||||
}
|
||||
|
||||
function CommitTrans($ok=true)
|
||||
{
|
||||
if(method_exists($this->_driver, 'CommitTrans'))
|
||||
if(method_exists($this->_driver, 'CommitTrans')) {
|
||||
return $this->_driver->CommitTrans($ok);
|
||||
}
|
||||
|
||||
if (!$this->hasTransactions) return false;
|
||||
if ($this->transOff) return true;
|
||||
if (!$ok) return $this->RollbackTrans();
|
||||
if ($this->transCnt) $this->transCnt -= 1;
|
||||
if (!$this->hasTransactions) {
|
||||
return false;
|
||||
}
|
||||
if ($this->transOff) {
|
||||
return true;
|
||||
}
|
||||
if (!$ok) {
|
||||
return $this->RollbackTrans();
|
||||
}
|
||||
if ($this->transCnt) {
|
||||
$this->transCnt -= 1;
|
||||
}
|
||||
$this->_autocommit = true;
|
||||
|
||||
$ret = $this->_connectionID->commit();
|
||||
@@ -301,12 +379,19 @@ class ADODB_pdo extends ADOConnection {
|
||||
|
||||
function RollbackTrans()
|
||||
{
|
||||
if(method_exists($this->_driver, 'RollbackTrans'))
|
||||
if(method_exists($this->_driver, 'RollbackTrans')) {
|
||||
return $this->_driver->RollbackTrans();
|
||||
}
|
||||
|
||||
if (!$this->hasTransactions) return false;
|
||||
if ($this->transOff) return true;
|
||||
if ($this->transCnt) $this->transCnt -= 1;
|
||||
if (!$this->hasTransactions) {
|
||||
return false;
|
||||
}
|
||||
if ($this->transOff) {
|
||||
return true;
|
||||
}
|
||||
if ($this->transCnt) {
|
||||
$this->transCnt -= 1;
|
||||
}
|
||||
$this->_autocommit = true;
|
||||
|
||||
$ret = $this->_connectionID->rollback();
|
||||
@@ -317,7 +402,9 @@ class ADODB_pdo extends ADOConnection {
|
||||
function Prepare($sql)
|
||||
{
|
||||
$this->_stmt = $this->_connectionID->prepare($sql);
|
||||
if ($this->_stmt) return array($sql,$this->_stmt);
|
||||
if ($this->_stmt) {
|
||||
return array($sql,$this->_stmt);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -325,31 +412,36 @@ class ADODB_pdo extends ADOConnection {
|
||||
function PrepareStmt($sql)
|
||||
{
|
||||
$stmt = $this->_connectionID->prepare($sql);
|
||||
if (!$stmt) return false;
|
||||
if (!$stmt) {
|
||||
return false;
|
||||
}
|
||||
$obj = new ADOPDOStatement($stmt,$this);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
function CreateSequence($seqname='adodbseq',$startID=1)
|
||||
{
|
||||
if(method_exists($this->_driver, 'CreateSequence'))
|
||||
if(method_exists($this->_driver, 'CreateSequence')) {
|
||||
return $this->_driver->CreateSequence($seqname, $startID);
|
||||
}
|
||||
|
||||
return parent::CreateSequence($seqname, $startID);
|
||||
}
|
||||
|
||||
function DropSequence($seqname='adodbseq')
|
||||
{
|
||||
if(method_exists($this->_driver, 'DropSequence'))
|
||||
if(method_exists($this->_driver, 'DropSequence')) {
|
||||
return $this->_driver->DropSequence($seqname);
|
||||
}
|
||||
|
||||
return parent::DropSequence($seqname);
|
||||
}
|
||||
|
||||
function GenID($seqname='adodbseq',$startID=1)
|
||||
{
|
||||
if(method_exists($this->_driver, 'GenID'))
|
||||
if(method_exists($this->_driver, 'GenID')) {
|
||||
return $this->_driver->GenID($seqname, $startID);
|
||||
}
|
||||
|
||||
return parent::GenID($seqname, $startID);
|
||||
}
|
||||
@@ -367,8 +459,12 @@ class ADODB_pdo extends ADOConnection {
|
||||
#var_dump($this->_bindInputArray);
|
||||
if ($stmt) {
|
||||
$this->_driver->debug = $this->debug;
|
||||
if ($inputarr) $ok = $stmt->execute($inputarr);
|
||||
else $ok = $stmt->execute();
|
||||
if ($inputarr) {
|
||||
$ok = $stmt->execute($inputarr);
|
||||
}
|
||||
else {
|
||||
$ok = $stmt->execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -436,12 +532,12 @@ class ADODB_pdo_base extends ADODB_pdo {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function MetaTables()
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function MetaColumns()
|
||||
function MetaColumns($table,$normalize=true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -454,7 +550,7 @@ class ADOPDOStatement {
|
||||
var $_stmt;
|
||||
var $_connectionID;
|
||||
|
||||
function ADOPDOStatement($stmt,$connection)
|
||||
function __construct($stmt,$connection)
|
||||
{
|
||||
$this->_stmt = $stmt;
|
||||
$this->_connectionID = $connection;
|
||||
@@ -471,8 +567,12 @@ class ADOPDOStatement {
|
||||
function InParameter(&$var,$name,$maxLen=4000,$type=false)
|
||||
{
|
||||
|
||||
if ($type) $this->_stmt->bindParam($name,$var,$type,$maxLen);
|
||||
else $this->_stmt->bindParam($name, $var);
|
||||
if ($type) {
|
||||
$this->_stmt->bindParam($name,$var,$type,$maxLen);
|
||||
}
|
||||
else {
|
||||
$this->_stmt->bindParam($name, $var);
|
||||
}
|
||||
}
|
||||
|
||||
function Affected_Rows()
|
||||
@@ -482,13 +582,23 @@ class ADOPDOStatement {
|
||||
|
||||
function ErrorMsg()
|
||||
{
|
||||
if ($this->_stmt) $arr = $this->_stmt->errorInfo();
|
||||
else $arr = $this->_connectionID->errorInfo();
|
||||
if ($this->_stmt) {
|
||||
$arr = $this->_stmt->errorInfo();
|
||||
}
|
||||
else {
|
||||
$arr = $this->_connectionID->errorInfo();
|
||||
}
|
||||
|
||||
if (is_array($arr)) {
|
||||
if ((integer) $arr[0] && isset($arr[2])) return $arr[2];
|
||||
else return '';
|
||||
} else return '-1';
|
||||
if ((integer) $arr[0] && isset($arr[2])) {
|
||||
return $arr[2];
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '-1';
|
||||
}
|
||||
}
|
||||
|
||||
function NumCols()
|
||||
@@ -498,8 +608,12 @@ class ADOPDOStatement {
|
||||
|
||||
function ErrorNo()
|
||||
{
|
||||
if ($this->_stmt) return $this->_stmt->errorCode();
|
||||
else return $this->_connectionID->errorInfo();
|
||||
if ($this->_stmt) {
|
||||
return $this->_stmt->errorCode();
|
||||
}
|
||||
else {
|
||||
return $this->_connectionID->errorInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,7 +627,7 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
var $databaseType = "pdo";
|
||||
var $dataProvider = "pdo";
|
||||
|
||||
function ADORecordSet_pdo($id,$mode=false)
|
||||
function __construct($id,$mode=false)
|
||||
{
|
||||
if ($mode === false) {
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -530,15 +644,19 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
$this->fetchMode = $mode;
|
||||
|
||||
$this->_queryID = $id;
|
||||
$this->ADORecordSet($id);
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
|
||||
function Init()
|
||||
{
|
||||
if ($this->_inited) return;
|
||||
if ($this->_inited) {
|
||||
return;
|
||||
}
|
||||
$this->_inited = true;
|
||||
if ($this->_queryID) @$this->_initrs();
|
||||
if ($this->_queryID) {
|
||||
@$this->_initrs();
|
||||
}
|
||||
else {
|
||||
$this->_numOfRows = 0;
|
||||
$this->_numOfFields = 0;
|
||||
@@ -558,7 +676,9 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
global $ADODB_COUNTRECS;
|
||||
|
||||
$this->_numOfRows = ($ADODB_COUNTRECS) ? @$this->_queryID->rowCount() : -1;
|
||||
if (!$this->_numOfRows) $this->_numOfRows = -1;
|
||||
if (!$this->_numOfRows) {
|
||||
$this->_numOfRows = -1;
|
||||
}
|
||||
$this->_numOfFields = $this->_queryID->columnCount();
|
||||
}
|
||||
|
||||
@@ -579,13 +699,23 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
}
|
||||
//adodb_pr($arr);
|
||||
$o->name = $arr['name'];
|
||||
if (isset($arr['native_type']) && $arr['native_type'] <> "null") $o->type = $arr['native_type'];
|
||||
else $o->type = adodb_pdo_type($arr['pdo_type']);
|
||||
if (isset($arr['native_type']) && $arr['native_type'] <> "null") {
|
||||
$o->type = $arr['native_type'];
|
||||
}
|
||||
else {
|
||||
$o->type = adodb_pdo_type($arr['pdo_type']);
|
||||
}
|
||||
$o->max_length = $arr['len'];
|
||||
$o->precision = $arr['precision'];
|
||||
|
||||
if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
|
||||
else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
|
||||
switch(ADODB_ASSOC_CASE) {
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
$o->name = strtolower($o->name);
|
||||
break;
|
||||
case ADODB_ASSOC_CASE_UPPER:
|
||||
$o->name = strtoupper($o->name);
|
||||
break;
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
@@ -596,7 +726,9 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
|
||||
function _fetch()
|
||||
{
|
||||
if (!$this->_queryID) return false;
|
||||
if (!$this->_queryID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->fields = $this->_queryID->fetch($this->fetchMode);
|
||||
return !empty($this->fields);
|
||||
@@ -609,7 +741,9 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
|
||||
function Fields($colname)
|
||||
{
|
||||
if ($this->adodbFetchMode != ADODB_FETCH_NUM) return @$this->fields[$colname];
|
||||
if ($this->adodbFetchMode != ADODB_FETCH_NUM) {
|
||||
return @$this->fields[$colname];
|
||||
}
|
||||
|
||||
if (!$this->bind) {
|
||||
$this->bind = array();
|
||||
@@ -622,5 +756,3 @@ class ADORecordSet_pdo extends ADORecordSet {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -58,4 +60,3 @@ class ADODB_pdo_mssql extends ADODB_pdo {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -11,7 +11,12 @@ if (!defined('ADODB_DIR')) die();
|
||||
*/
|
||||
|
||||
class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
var $metaTablesSQL = "SHOW TABLES";
|
||||
|
||||
var $metaTablesSQL = "SELECT
|
||||
TABLE_NAME,
|
||||
CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA=";
|
||||
var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
|
||||
var $sysDate = 'CURDATE()';
|
||||
var $sysTimeStamp = 'NOW()';
|
||||
@@ -23,7 +28,6 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
|
||||
function _init($parentDriver)
|
||||
{
|
||||
|
||||
$parentDriver->hasTransactions = false;
|
||||
#$parentDriver->_bindInputArray = false;
|
||||
$parentDriver->hasInsertID = true;
|
||||
@@ -33,27 +37,31 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
// dayFraction is a day in floating point
|
||||
function OffsetDate($dayFraction, $date=false)
|
||||
{
|
||||
if (!$date) $date = $this->sysDate;
|
||||
if (!$date) {
|
||||
$date = $this->sysDate;
|
||||
}
|
||||
|
||||
$fraction = $dayFraction * 24 * 3600;
|
||||
return $date . ' + INTERVAL ' . $fraction . ' SECOND';
|
||||
|
||||
// return "from_unixtime(unix_timestamp($date)+$fraction)";
|
||||
}
|
||||
|
||||
function Concat()
|
||||
{
|
||||
$s = "";
|
||||
$s = '';
|
||||
$arr = func_get_args();
|
||||
|
||||
// suggestion by andrew005#mnogo.ru
|
||||
$s = implode(',', $arr);
|
||||
if (strlen($s) > 0) return "CONCAT($s)"; return '';
|
||||
if (strlen($s) > 0) {
|
||||
return "CONCAT($s)";
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function ServerInfo()
|
||||
{
|
||||
$arr['description'] = ADOConnection::GetOne("select version()");
|
||||
$arr['description'] = ADOConnection::GetOne('select version()');
|
||||
$arr['version'] = ADOConnection::_findvers($arr['description']);
|
||||
return $arr;
|
||||
}
|
||||
@@ -82,8 +90,10 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
$this->Execute('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ');
|
||||
return;
|
||||
}
|
||||
if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
|
||||
$this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
|
||||
if (!stristr($transaction_mode, 'isolation')) {
|
||||
$transaction_mode = 'ISOLATION LEVEL ' . $transaction_mode;
|
||||
}
|
||||
$this->Execute('SET SESSION TRANSACTION ' . $transaction_mode);
|
||||
}
|
||||
|
||||
function MetaColumns($table, $normalize=true)
|
||||
@@ -97,14 +107,18 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
$save = $ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
|
||||
|
||||
if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
|
||||
if ($this->fetchMode !== false) {
|
||||
$savem = $this->SetFetchMode(false);
|
||||
}
|
||||
$rs = $this->Execute(sprintf($this->metaColumnsSQL, $table));
|
||||
|
||||
if ($schema) {
|
||||
$this->SelectDB($dbName);
|
||||
}
|
||||
|
||||
if (isset($savem)) $this->SetFetchMode($savem);
|
||||
if (isset($savem)) {
|
||||
$this->SetFetchMode($savem);
|
||||
}
|
||||
$ADODB_FETCH_MODE = $save;
|
||||
if (!is_object($rs)) {
|
||||
$false = false;
|
||||
@@ -119,18 +133,18 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
|
||||
// split type into type(length):
|
||||
$fld->scale = null;
|
||||
if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
|
||||
if (preg_match('/^(.+)\((\d+),(\d+)/', $type, $query_array)) {
|
||||
$fld->type = $query_array[1];
|
||||
$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
|
||||
$fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
|
||||
} elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
|
||||
} elseif (preg_match('/^(.+)\((\d+)/', $type, $query_array)) {
|
||||
$fld->type = $query_array[1];
|
||||
$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
|
||||
} elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
|
||||
} elseif (preg_match('/^(enum)\((.*)\)$/i', $type, $query_array)) {
|
||||
$fld->type = $query_array[1];
|
||||
$arr = explode(",",$query_array[2]);
|
||||
$arr = explode(',', $query_array[2]);
|
||||
$fld->enums = $arr;
|
||||
$zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
|
||||
$zlen = max(array_map('strlen', $arr)) - 2; // PHP >= 4.0.6
|
||||
$fld->max_length = ($zlen > 0) ? $zlen : 1;
|
||||
} else {
|
||||
$fld->type = $type;
|
||||
@@ -164,19 +178,123 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
return $retarr;
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
function SelectDB($dbName)
|
||||
{
|
||||
$this->database = $dbName;
|
||||
$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
|
||||
$try = $this->Execute('use ' . $dbName);
|
||||
return ($try !== false);
|
||||
}
|
||||
|
||||
// parameters use PostgreSQL convention, not MySQL
|
||||
function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs=0)
|
||||
{
|
||||
$offsetStr =($offset>=0) ? "$offset," : '';
|
||||
// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
|
||||
if ($nrows < 0) $nrows = '18446744073709551615';
|
||||
if ($nrows < 0) {
|
||||
$nrows = '18446744073709551615';
|
||||
}
|
||||
|
||||
if ($secs)
|
||||
if ($secs) {
|
||||
$rs = $this->CacheExecute($secs, $sql . " LIMIT $offsetStr$nrows", $inputarr);
|
||||
else
|
||||
} else {
|
||||
$rs = $this->Execute($sql . " LIMIT $offsetStr$nrows", $inputarr);
|
||||
}
|
||||
return $rs;
|
||||
}
|
||||
|
||||
function SQLDate($fmt, $col=false)
|
||||
{
|
||||
if (!$col) {
|
||||
$col = $this->sysTimeStamp;
|
||||
}
|
||||
$s = 'DATE_FORMAT(' . $col . ",'";
|
||||
$concat = false;
|
||||
$len = strlen($fmt);
|
||||
for ($i=0; $i < $len; $i++) {
|
||||
$ch = $fmt[$i];
|
||||
switch($ch) {
|
||||
|
||||
default:
|
||||
if ($ch == '\\') {
|
||||
$i++;
|
||||
$ch = substr($fmt, $i, 1);
|
||||
}
|
||||
// FALL THROUGH
|
||||
case '-':
|
||||
case '/':
|
||||
$s .= $ch;
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
case 'y':
|
||||
$s .= '%Y';
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
$s .= '%b';
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
$s .= '%m';
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
case 'd':
|
||||
$s .= '%d';
|
||||
break;
|
||||
|
||||
case 'Q':
|
||||
case 'q':
|
||||
$s .= "'),Quarter($col)";
|
||||
|
||||
if ($len > $i+1) {
|
||||
$s .= ",DATE_FORMAT($col,'";
|
||||
} else {
|
||||
$s .= ",('";
|
||||
}
|
||||
$concat = true;
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
$s .= '%H';
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
$s .= '%I';
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
$s .= '%i';
|
||||
break;
|
||||
|
||||
case 's':
|
||||
$s .= '%s';
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
case 'A':
|
||||
$s .= '%p';
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
$s .= '%w';
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
$s .= '%U';
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
$s .= '%W';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$s .= "')";
|
||||
if ($concat) {
|
||||
$s = "CONCAT($s)";
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ADODB_DIR')) die();
|
||||
|
||||
/*
|
||||
V5.10 10 Nov 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@version v5.20.4 30-Mar-2016
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -89,5 +91,3 @@ class ADODB_pdo_oci extends ADODB_pdo_base {
|
||||
return $retarr;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user