Commit Graph

1777 Commits

Author SHA1 Message Date
tjhunt e7b818807c get_string: MDL-13816 allow third-partly modules to register sub-plugin types that have their own lang files.
I suppose to be really useful we should deal with database, capabiltities, etc. too in due course. Still, this is a start.
2009-03-30 06:13:35 +00:00
tjhunt bb45fe62c4 get_string: Refactoring, performance improvements, bug fixes and unit tests
MDL-18669 get_string refactored to elimiate duplicate code and make it easier to understand.
MDL-17763 parent language not processed correctly when getting a plugin string.
MDL-16181 more intelligent caching to avoid repeated file_exists checks.
MDL-12434 move values to array keys to improve lookup times.

The main part of the refactoring is to create a singleton string_manager class to encapsulate the cached data and the processing, while breaking the code up into more smaller methods.

Other performance improvements include:
* Cache results of plugin name -> locations to search array.
* Cache parent lang lookup.
* Skip eval if the string does not contain $ \ or %.
* Remove the unnecessary sprintf from the eval.

There is a performance testing script in lib/simpletest/getstringperformancetester.php. For now this script has the old get_string implementation copied and pasted to the end, and renamed to old_get_string to allow for comparitive timings.

There are now some unit tests for get_string in lib/simpletest/teststringmanager.php. I think I have managed to cover most of the tricky cases.
2009-03-30 02:21:27 +00:00
poltawski 9b831e01d2 lib/moodlelib.php MDL-18406 - use more robust require path
thanks to Daniel Neis
merged from MOODLE_19_STABLE
2009-03-25 09:38:41 +00:00
poltawski eac4623d29 lib/email_to_user MDL-10384 Recipeint names broken
When emailcharset is not utf8 the charset conversion was breaking
recipient/replyto names

thanks to Tatsuya Shirai
merged from MOODLE_19_STABLE
2009-03-25 09:18:19 +00:00
poltawski 2029fcf47f email_to_user: MDL-16328 - prevent empty receeipent address
Be a bit defensive as it seems to be possible for this to happen
with LDAP auth
2009-03-19 10:35:08 +00:00
stronk7 1263a0ff1d MDL-18518 user firstaccess - added suport to display user->firstaccess. Credit goes to Anthony Borrow!
Merged from 19_STABLE
2009-03-11 11:22:55 +00:00
stronk7 e0ec2d45b8 MDL-18440 email_to_user() - avoid some notices ; merged from 19_STABLE 2009-03-04 15:03:00 +00:00
skodak 8f0632f097 MDL-18318 fixed incorrect function param - thanks Aurelijus 2009-02-19 16:21:46 +00:00
skodak 9c6972d630 MDL-18293 exception and DML cleanup 2009-02-17 17:32:36 +00:00
skodak 013376dec4 MDL-18293 exception and DML cleanup 2009-02-17 17:23:56 +00:00
skodak 5e2f308b91 MDL-18293 exception and DML cleanup 2009-02-17 16:50:36 +00:00
tjhunt 0a0cf09a6f moodlelib.php: Improve the phpdoc comment for userdate. 2009-02-11 08:08:58 +00:00
nicolasconnault ec0123208d MDL-18188 Added a new function with matching unit tests, following Sam's comment in the tracker 2009-02-10 15:33:25 +00:00
skodak ed8453a625 MDL-17573 fixed problem when en_utf8 sopecified as parent 2009-02-08 22:48:17 +00:00
skodak 07f6711889 MDL-17573 added automatic downloading of parent languages 2009-02-08 22:33:54 +00:00
skodak cc8727451f MDL-17565 automatic download of parent lang + parent lang cleanup 2009-02-07 18:55:21 +00:00
skodak 3b09331066 MDL-17458 rewritten installer 2009-02-07 10:20:33 +00:00
poltawski 244d15093f mnet/forum MDL-18118 - email links were rewritten to use IDP when SITEID not 1
Switched check to use is_mnet_remote_user()
2009-02-02 17:47:12 +00:00
skodak b3d960e64a fixed whitespace 2009-02-01 13:36:07 +00:00
skodak 038a29d580 MDL-17808 more lastname support when resetting passwords; merged from MOODLE_19_STABLE 2009-01-31 21:38:12 +00:00
skodak 88582df496 MDL-17458 refactored guest and admin user creation + refactored roles install + added protection for installation hijacking + added reliable session test right before editting of admin account 2009-01-29 22:54:41 +00:00
tjhunt 285b83adf5 Fix incorrect comment. 2009-01-21 07:41:09 +00:00
tjhunt d61f7b7641 backup/restore: MDL-16614 more reliable test for when we are restoring a backup that was made of the same site that we are restoring to.
* Use this to fix a question restore bug.
* Replace older code that does something similar with the new test.
* Refactor initialisation of $CFG->siteidentifier into a function. There were about 4 copies of this code ;-)
2009-01-20 03:16:30 +00:00
moodler d44cee76fa repository/picasa MDL-17473 Use picasa description as the filename if it exists 2009-01-19 06:19:26 +00:00
skodak dd9e22f871 MDL-17942 implemented gc and timeouts for db sessions 2009-01-18 11:19:40 +00:00
skodak 56949c17de MDL-14992 refactored use of session_write_close() 2009-01-17 15:25:08 +00:00
tjhunt 4cfd5d4d8f moodlelib: MDL-17761 More consistent error handling in get_string. 2009-01-16 04:18:43 +00:00
tjhunt 94c224619c edit profile: MDL-15607 Edit profile form breaks if the list of countries in the language pack is broken.
After this patch it still breaks, unavoidably, but at least there is now an error message.
2009-01-13 06:03:26 +00:00
skodak 5c144d605e MDL-17845 now only one page per installs/upgrade :-D 2009-01-12 15:13:44 +00:00
dongsheng 034f4412bc "MDL-12077, add course delete hook for course format" 2009-01-12 06:24:00 +00:00
skodak eb6a973cdf MDL-17847 moev backup_config to config_plugin table 2009-01-11 15:49:35 +00:00
skodak 1caea91efb MDL-17457 moved a lot of code into lib/db/install.php + other refactoring and cleanup 2009-01-11 09:41:48 +00:00
skodak e70da470a7 MDL-14123 Full IPv6 support - reimplemented address_in_subnet() + added more unittests 2009-01-09 21:16:26 +00:00
skodak 65de686486 MDL-14123 cleanremoteaddr improvements and added unit tests 2009-01-09 10:16:07 +00:00
tjhunt 4413941fee course requests: MDL-6160 clean up admin option for choosing who is notified. Merged from MOODLE_19_STABLE.
Also, change the 'notifyloginfailures' setting to use the same sort of admin setting type.
2009-01-08 07:07:00 +00:00
skodak a3c13b97d8 MDL-17808 Use users lastname in password change confirmation mails, thanks Andreas Grupp 2009-01-07 19:03:38 +00:00
skodak 45dda59af2 MDL-14123 Full IPv6 support - reimplemented cleanremoteaddr(), it now accepts local ips too 2009-01-06 22:18:01 +00:00
skodak a91b910e4f MDL-17776 added new define CLI_SCRIPT that identifies all CLI scripts + cron (cli scripts do not have session and do not like HTML in output and are executed from command line, cron is an exception) 2009-01-03 14:28:02 +00:00
skodak e8b7114d5e MDL-17774 refactored USER switching in cron scripts - now standardised in cron_setup_user() 2009-01-03 13:16:59 +00:00
skodak 9bda43e6be MDL-16613 refactore session IP tracking; MDL-14213 improved message when IP changes; MDL-17754 SID is regenerated when terminating session and old session is deleted 2009-01-02 23:49:29 +00:00
skodak 93f66983cc MDL-17773 new get_login_url() function - fixes missing httpslogin tweaks 2009-01-02 22:56:48 +00:00
skodak 27df7ae8a5 MDL-17754 $USER object initialisation cleanup 2009-01-02 21:27:18 +00:00
skodak eb85959b5c MDL-16613 sesskey initialisation refactored 2009-01-02 21:20:00 +00:00
skodak b7b64ff2e0 MDL-17754 next round of session related refactoring 2009-01-02 20:32:05 +00:00
skodak 6132768ecb MDL-17767 loginas refactoring and simplification; full SESSION switching implemented 2009-01-02 15:15:26 +00:00
skodak 542797b4e8 MDL-17767 loginas internals refactoring - code moved to sessionlib.php 2009-01-02 14:53:02 +00:00
skodak 0ad6b20cb2 MDL-17754 session code refactoring; removing test cookie which will be replaced by wwwroot checks 2009-01-02 13:42:43 +00:00
skodak 27134b7dde MDL-17682 added default value for city field 2008-12-29 21:46:59 +00:00
sam_marshall 82bd6a5ea9 MDL-15499: Conditional availability of activities 2008-12-17 16:37:35 +00:00
dongsheng 94b8568628 "MDL-16954, get rid of remote_addr notice on cli, set ip = 0.0.0.0 in mdl_log table when accessed from cli, merged from 1.9" 2008-12-11 05:18:17 +00:00