643 Commits

Author SHA1 Message Date
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Petr Škoda
bff1d60c05 MDL-40676 ignore null bytes 2013-09-02 12:25:02 +08:00
Petr Škoda
9d6d32b6f0 MDL-41022 cleanup core_dml_testcase 2013-08-24 16:18:02 +02:00
Dan Poltawski
6f44a73369 Merge branch 'w33_MDL-39474_m26_debugdeveloper' of https://github.com/skodak/moodle
Conflicts:
	lib/upgrade.txt
2013-08-20 11:42:03 +08:00
Simon Coggins
be8c6d7bc8 MDL-39572: Fix sql_order_by_text() to use length argument correctly 2013-08-16 11:26:54 +12:00
Simon Coggins
be4bf53d6d MDL-39572: Fix existing tests and add more to demonstrate issue with sql_order_by_text() 2013-08-16 11:26:54 +12:00
Petr Škoda
96f81ea385 MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init 2013-08-12 13:01:47 +02:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Petr Škoda
656250de83 MDL-11270 use NVARCHAR(MAX) and VARBINARY(MAX) in SQL Server 2013-07-26 09:28:50 +02:00
Petr Škoda
d11b8d0c63 MDL-40808 remove unused DML strings 2013-07-25 12:02:29 +02:00
Petr Škoda
17601a7e12 MDL-39985 add explicit MariaDB support 2013-07-24 10:45:20 +08:00
Eloy Lafuente (stronk7)
154bc6b240 Merge branch 'w30_MDL-40642_m26_umask' of https://github.com/skodak/moodle 2013-07-23 23:42:11 +02:00
Petr Škoda
eb459f7192 MDL-40642 set more restrictive umask and use proper permission for new dirs and files 2013-07-19 09:18:44 +02:00
Petr Škoda
d8a1f4263a MDL-39846 implement new event dispatching and base event class 2013-07-19 08:43:27 +02:00
Damyon Wiese
b080d5b688 Merge branch 'wip-MDL-40490-master' of git://github.com/abgreeve/moodle 2013-07-09 10:03:22 +08:00
Adrian Greeve
b1d31f49dc MDL-40490 - database: Fixed a check on database port options.
The addition of a port for the database means that an array
would be set regardless of whether it had any information or not.
The isset() function sees an array as being set and follows through
with the rest of the if statement concatenating a colon to the end
of the database host name and throwing a connection problem if no port
number is supplied.

The if statement has now been changed to if not empty. The empty
function does see zero as an empty value, but a port shouldn't have
a value of zero anyway.
2013-07-04 15:01:53 +08:00
Dan Poltawski
b25cd1f3d5 Merge branch 'w27_MDL-40399_m26_msarrayshift' of https://github.com/skodak/moodle 2013-07-02 13:34:09 +08:00
Petr Škoda
7aed7f46ab MDL-40266 improve emulate_bound_params() for mssql driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:52:03 +02:00
Petr Škoda
b983901d48 MDL-40266 improve emulate_bound_params() for sqlsrv driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:51:35 +02:00
Martin Langhoff
4f3e38e745 MDL-40266 improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
2013-06-30 18:25:14 +02:00
Petr Škoda
8ac7cbddfc MDL-39588 require MOODLELIB Oracle package
Previously it was kind of optional, but it is now required. We also attempt to install it automatically now.
2013-06-02 11:14:43 +02:00
Dan Poltawski
e947caf4a1 Merge branch 'MDL-39389' of git://github.com/stronk7/moodle 2013-04-29 14:15:23 +01:00
Dan Poltawski
1f65889ab3 Merge branch 'MDL-39390' of git://github.com/stronk7/moodle 2013-04-29 14:12:37 +01:00
Eloy Lafuente (stronk7)
20c9916396 MDL-27071 Allow Oracle IN() to use > 1000 items
By using a pivoting strategy, we modify the list
of params (QM and NAMED supported) into a
subquery, so the 1000 limit in Oracle (ORA-01795)
is not thrown anymore.
2013-04-29 01:22:38 +02:00
Eloy Lafuente (stronk7)
9b2ebc4587 MDL-27071 Add big IN() unit tests
Let's verify how all databases perform with a big
number of parameters (10000) using IN() SQL clauses.
Both using QM and NAMED parameters.

Ideally only Oracle fails, and only it will need fixing.
2013-04-29 01:11:10 +02:00
Eloy Lafuente (stronk7)
bae2846c2c MDL-39390 delete old moodle_database column cache
With MDL-39389 all the remaining drivers have been moved
from the in-memory, per-request ::columns cache to
the MUC (databasemeta) alternative.

That makes the old cache unused, so this is, simply about to
delete it, and warn in upgrade notes for potential sites
using custom moodle_database drivers.
2013-04-28 18:33:33 +02:00
Eloy Lafuente (stronk7)
f33d4784fe MDL-39389 add databasemeta cache to pdo_sqlite
Done in a separate commit, coz this driver is not
truly supported, but considering it as a reference
for people developing drivers... it's better to
have it supporting the databasemeta cache.
2013-04-28 18:14:17 +02:00
Eloy Lafuente (stronk7)
9043466103 MDL-39389 add databasemeta cache to ms/oci drivers 2013-04-28 18:12:38 +02:00
Eloy Lafuente (stronk7)
552f00fb86 Merge branch 'w14_MDL-38750_m25_ocierrors' of git://github.com/skodak/moodle 2013-04-09 02:26:49 +02:00
Eloy Lafuente (stronk7)
13af1f0497 Merge branch 'w14_MDL-39038_m25_oracleconcat' of git://github.com/skodak/moodle 2013-04-09 02:23:36 +02:00
Eloy Lafuente (stronk7)
cf42eece55 Merge branch 'w14_MDL-39027_m25_sqlsrvdatatype' of git://github.com/skodak/moodle 2013-04-09 02:19:41 +02:00
Eloy Lafuente (stronk7)
6afbf283de Merge branch 'w14_MDL-39028_m25_sqlsrconcat' of git://github.com/skodak/moodle 2013-04-09 02:17:56 +02:00
Eloy Lafuente (stronk7)
187afd0f52 Merge branch 'w14_MDL-39019_m25_mssqldatatype' of git://github.com/skodak/moodle 2013-04-09 02:01:04 +02:00
Eloy Lafuente (stronk7)
a035bc9b6d Merge branch 'w14_MDL-39024_m25_mssqlseek' of git://github.com/skodak/moodle 2013-04-09 01:58:20 +02:00
Petr Škoda
60e9a2fe5d MDL-39027 make sure sqlsrv does not return non-string data types 2013-04-08 23:29:52 +02:00
Petr Škoda
031a6de97a MDL-39038 nasty workaround for Oracle NULL concats 2013-04-08 23:23:08 +02:00
Petr Škoda
50f743021e MDL-39028 fix sqlsrv concat type conversion 2013-04-08 13:17:56 +02:00
Petr Škoda
4c97487728 MDL-39024 fix MSSQL seek past the end of recordset 2013-04-08 10:36:37 +02:00
Petr Škoda
7a755250df MDL-39022 fix MSSQL concat type conversion 2013-04-08 10:19:51 +02:00
Petr Škoda
1b64533069 MDL-39019 make sure MSSQL does not return non-string data types 2013-04-08 10:06:55 +02:00
Petr Škoda
b1c5c4a887 MDL-38750 show errors at the end of OCI setup script
Credit goes to Damyon Wiese.
2013-04-07 19:44:46 +02:00
Petr Škoda
e788339786 MDL-37742 add debugging message when $DB->sql_empty() used 2013-03-26 22:12:17 +01:00
Petr Škoda
77a5c09354 MDL-37742 simplify dirty one-space oracle hack 2013-03-24 13:43:18 +01:00
Eloy Lafuente (stronk7)
5ab0371d74 Merge branch 'MDL-37854_master' of https://github.com/markn86/moodle 2013-02-05 11:10:48 +01:00
Mark Nelson
17222a4a25 MDL-37854 phpunit: replaced occurrence of non-existent function assertFail 2013-02-05 18:03:25 +08:00
Petr Škoda
dd8a39a881 MDL-37734 add one more recordset isolation test 2013-01-29 10:10:40 +01:00
Petr Škoda
0363b7826b MDL-37734 use prefetching workaround for MARS transaction problems 2013-01-29 10:10:09 +01:00
Petr Škoda
9e6bfb5221 MDL-37718 release low level recordsets as soon as possible 2013-01-26 17:20:43 +01:00
Aparup Banerjee
60f95aad6c Merge branch 'MDL-37585' of git://github.com/timhunt/moodle 2013-01-22 11:08:16 +08:00
Tim Hunt
74fa94b26a MDL-37585 Make $DB->set_debug(true) show run time of each query. 2013-01-21 08:48:15 +00:00