Commit Graph
5668 Commits
Author SHA1 Message Date
Andy Staudacher 334cd2368d Performance improvement: Load all translations of a locale as one serialized array from the Cache.
Until now, we loaded hundreds of translation messages row by row, and unserializing one by one at bootstrap time. That amounted to a significant percentage of the complete request time. This approach is more than 10x faster.
2010-02-21 23:50:01 -08:00
Andy Staudacher 6591ea2577 Fix delete() function of DB based Cache driver. It expected a scalar key / tag value, but it was always an array of keys / tags.
(compare to system/libraries/Cache.php and the File.php driver)
2010-02-21 23:48:23 -08:00
Andy Staudacher 8e7eda9cc6 Fix progress bar / maintenance tasks for locales that use comma as decimal separator, such as German. 2010-02-21 23:23:48 -08:00
Andy Staudacher 336c3bd264 Fix Kohana's internal cache for Gallery's usage pattern. Instead of deleting the whole find_files cache when ever include_paths (=core.modules) change, keep a separate find_files cache for each set of include_paths.
Benefits for Gallery:
 - There are about 3000 is_file() invocations for a photo / album page in a vanilla Gallery installation. These are mostly triggered by Kohana::find_file().
 - Enabling internal_cache doesn't help at all (see explanation below). The number of is_file() invocations is about the same with or without this cache.
 - With this patch, more than 95% of these invocations are gone. The cache works as intended.

Kohana's internal_cache for find_file wasn't working in Gallery because
the cache would be emptied on each request after reading it from disk and
before most lookups would run.
 1. Bootstrap sets initial core.modules (= include path): forge, kohana23_compat, gallery.
 2. Kohana::setup() loads find_file cache from disk.
 3. Gallery loads list of active modules and themes, and updates the core.modules value (=include path), which forces the internal find_file cache to be empties (which makes sense).
 4. Request processing starts, and thus 80+% of all Kohana::find_file() triggered  is_file() invocations start off with an empty find_file cache.

The patch doesn't have a significant impact on performance for Kohana applications which don't change their include paths at runtime (after Kohana::setup). And the patch should benefit all Kohana applications which have modules / extensions, i.e. which first need to bootstrap Kohana before they can load a list of all active modules from the database.
2010-02-21 21:29:24 -08:00
Andy Staudacher 6cbe0f78aa Revert "Fix Kohana's internal cache for Gallery's usage pattern."
This reverts commit 5ddd7c9677.
2010-02-21 21:07:55 -08:00
Andy Staudacher 5ddd7c9677 Fix Kohana's internal cache for Gallery's usage pattern.
Adds a core.internal_cache_read_only config variable to Kohana's internals.

Kohana's internal_cache for find_file wasn't working in Gallery because the cache would be emptied on each request after reading it from disk and before most lookups would run.
 1. Bootstrap sets initial core.modules (= include path): forge, kohana23_compat, gallery.
 2. Kohana::setup() loads find_file cache from disk.
 3. Gallery loads list of active modules and themes, and updates the core.modules value (=include path), which forces the internal find_file cache to be empties (which makes sense).
 4. Request processing starts, and thus 80% of all Kohana::find_file() triggered  is_file() invocations start off with an empty find_file cache.

In the case of my small Gallery installation, we're talking about 3100 is_file() invocations per request with or without internal_cache enabled. With this fix, this number is down to 800 invocations.

The basic idea is that we treat the cache as read only and don't write any (possibly dirty) values to it in memory until we're sure that the include path won't change later on in the request processing. Once we know the list of active modules and themes, we can update core.modules and finally flip the read-only state of the cache and start writing to it.
2010-02-21 20:04:06 -08:00
Bharat Mediratta 9b7542b9f1 Add Menu::add_before() 2010-02-21 17:14:19 -08:00
Tim Almdal 9f81015053 Merge branch 'master' into talmdal_dev 2010-02-21 14:41:05 -08:00
Andy Staudacher be20309259 Merge commit 'upstream/master' 2010-02-21 13:08:06 -08:00
Andy Staudacher cb57c3912a Fix random queries (such as for the random image block) for locales that don't use a period as decimal separator of floating point numbers (such as de_DE).
(Integrating a fix Kohana's SQL generation for floating point numbers. See http://dev.kohanaframework.org/issues/2636.)
2010-02-21 13:05:48 -08:00
Bharat Mediratta 1377b2c7b3 When using rest::reply(), don't call var_export() if the response is empty. 2010-02-20 10:24:29 -08:00
Chad Kieffer f4fc245603 Add link to edit user group names. Closes ticket #1028. 2010-02-20 10:48:27 -07:00
Bharat Mediratta 5fbc472300 Fix the resize_url and file_url in as_restful_array() 2010-02-19 11:54:03 -08:00
Tim Almdal f062cc5e1a Merge branch 'master' of git@github.com:gallery/gallery3 2010-02-19 11:49:01 -08:00
Tim Almdal 10c0698949 Correct the view_fillsize permission to view_full. In addition, change the name of the field containing the url to the fullsize image to file_url instead of fullzie_url 2010-02-19 11:48:54 -08:00
Bharat Mediratta d388e4bb86 Refactor away the "display_all" construct in User_Profile_Controller.
"display_all" is too coarse, and we should be letting event handlers
make the appropriate decision on what to display and when.  This
duplicates some code, but it's now very clear in the event handlers
what's getting shown.

Throw a 404 if we try to view the user profile for a missing user.

The only feature change in this should be that we now display the
name, full name and website for a user to any other registered user,
which makes sense since these are typically public fields.

Don't show any of the edit buttons unless identity::is_writable()
2010-02-19 11:40:49 -08:00
Tim Almdal a6c3e8f0a2 Merge branch 'master' into talmdal_dev 2010-02-19 11:36:31 -08:00
Bharat Mediratta 643fffdba0 Add spaces around %name in the "create a file" text so that
double-clicking the token only selects that one word, not the word on
the line before (which happens on Chrome/Linux)
2010-02-19 09:49:05 -08:00
Chad Kieffer 3f021d3610 Merge branch 'master' of github.com:gallery/gallery3 2010-02-18 23:01:15 -07:00
Chad Kieffer 2846d81171 First pass at user profile formatting updates. Moved buttons to the top, simplified HTML and CSS. 2010-02-18 23:00:58 -07:00
Chad Kieffer 934cc8d7ee Merge branch 'master' of github.com:gallery/gallery3 2010-02-18 19:32:57 -07:00
Chad Kieffer 63ec1c5e48 Absolutely position the 'Add comment' button on the left for RTL. Fixes part of the reopened #869. 2010-02-18 19:28:13 -07:00
Chad Kieffer b103306f3d Don't need 'right' class here. Positioning is absolute to the right. 2010-02-18 19:26:07 -07:00
Andy Staudacher f116af5287 Fix for tickets #1024 and #1025: Fix formatting of album tree list in the organize dialog, and (magically) drag and drop move to another album works as well again. Tested in FF3.5, Chrome5 on Ubuntu Linux. 2010-02-18 17:54:29 -08:00
Bharat Mediratta 794660d73e Merge branch 'master' of github.com:gallery/gallery3 2010-02-18 16:34:04 -08:00
Bharat Mediratta 4c63753044 Restore the user_profile.php change from reverted
4091219425 that had this comment in the
change: "Also fixed a UI bug: No longer showing the edit user buttons
to admins in the profile view (to be consistent with the requirements
in the controller)."
2010-02-18 16:33:57 -08:00
Bharat Mediratta 0d72daf3d2 Restore the gallery_installer change from reverted dcddc68f58
that casts $powered_by_string from SafeString to string.
2010-02-18 16:33:17 -08:00
Bharat Mediratta 7d98d4b7b9 Revert "Fix for ticket #491: Make user and group names translatable."
This reverts commit 4091219425.
2010-02-18 16:20:59 -08:00
Bharat Mediratta 99c131e845 Revert "Never assign a SafeString instance to a Model member (or hell will break loose)."
This reverts commit dcddc68f58.
2010-02-18 16:20:23 -08:00
Bharat Mediratta d3e07f8a97 Revert "Fix for ticket #1017: Handle the common case of t(html::clean($var)) by casting SafeString instances to string in translate()."
This reverts commit 4ca55a90ee.
2010-02-18 16:19:41 -08:00
Andy StaudacherandBharat Mediratta 22bc871e2b Fix for tickets #1024 and #1025: Fix formatting of album tree list in the organize dialog, and (magically) drag and drop move to another album works as well again. Tested in FF3.5, Chrome5 on Ubuntu Linux. 2010-02-18 16:19:17 -08:00
Andy StaudacherandBharat Mediratta 45910ffdc0 Improve setlocale() call, using some of G2's locale fallback code to match the platform's locale names. 2010-02-18 16:19:17 -08:00
Andy Staudacher 8f39e68449 Improve setlocale() call, using some of G2's locale fallback code to match the platform's locale names. 2010-02-18 14:43:18 -08:00
Tim Almdal 74472dc83c Merge branch 'master' into talmdal_dev 2010-02-17 06:46:48 -08:00
Andy Staudacher 4ca55a90ee Fix for ticket #1017: Handle the common case of t(html::clean($var)) by casting SafeString instances to string in translate(). 2010-02-16 23:54:39 -08:00
Andy Staudacher 3b1b2bfea9 Merge commit 'upstream/master' 2010-02-16 21:58:09 -08:00
Andy Staudacher 61f8af6e4c Fix for ticket #1020: Fix RSS feed validation of album / recent items feeds. 2010-02-16 21:56:56 -08:00
Chad Kieffer c1b13ddd9f Apply zoom to g-photo and g-movie to hold height and properly position g-context-menu, closes #1018 2010-02-15 19:05:45 -07:00
Andy Staudacher 5e25d2f7f1 Put focus on password field in reauthenticate dialog. 2010-02-15 14:27:48 -08:00
Andy Staudacher 6c89bb8878 Update of reviewed XSS audit data. 2010-02-15 13:51:32 -08:00
Andy Staudacher e754bc18ea Input sanitization 2010-02-15 13:44:37 -08:00
Andy Staudacher dcddc68f58 Never assign a SafeString instance to a Model member (or hell will break loose). 2010-02-15 13:12:38 -08:00
Tim Almdal 0b0c8cbb92 Merge branch 'master' of git@github.com:gallery/gallery3 2010-02-15 12:30:05 -08:00
Tim Almdal a597b57210 return the absolute url not the relative for the full size, resize and thumb images. 2010-02-15 12:29:49 -08:00
Chad Kieffer 7b08be1139 Initialize context-menu hover using g-photo/g-movie, not the image or movie object. Closes ticket #808 2010-02-15 13:24:28 -07:00
Tim Almdal eb1cdd0376 Merge branch 'master' into talmdal_dev 2010-02-15 06:27:17 -08:00
Andy Staudacher 4091219425 Fix for ticket #491: Make user and group names translatable.
Also fixed a UI bug: No longer showing the edit user buttons to admins in the profile view (to be consistent with the requirements in the controller).
2010-02-14 19:26:34 -08:00
Andy Staudacher 667d65aea4 Fix for ticket 901: Wrap Gallery version string into bdo tag to override the BiDi algorithm. Also, properly marking the "Powere by" string for translation.
See: http://www.w3.org/International/tutorials/bidi-xhtml/#Slide0420
2010-02-14 18:33:38 -08:00
Andy Staudacher 30dcaaa236 Need to allow access to ::change_provider for CLI, to make packager work. 2010-02-14 18:33:10 -08:00
Andy Staudacher 0eb9b43a33 Enable session expiration. Currently, it's set to expire sessions after 7 days of inactivity. 2010-02-14 17:26:57 -08:00