Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
29 Oct 2005 at 11:20 UTC
Updated:
8 Apr 2008 at 00:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
chx commentedHere is the patch. I really worked hard on change as little as possible. Because it is possible that split.php will be sentenced to contrib for Drupal 4.7 cycle, and that's fine but core should be ready for it.
Comment #2
chx commentedNew, even smaller patch. Script follows.
Comment #3
chx commentedOf course, the script got a bit bigger...
Comment #4
chx commentedWith .txt extension.
If you read the code, you'll see I do a strange dance with module.inc because I load all if its functions anyways, so why split? This way the function_exists in module_hook gets rewritten to drupal_function_exists but only in split module. So, drupal_function_exists is a) moved to split.inc b) need not to check for split_mode all the time.
Comment #5
chx commentedAnother run... drupal_get_title was a tough one. But the solution is, IMO, quite elegant.
Comment #6
chx commentedComment #7
chx commentedModified further
drupal_bootstrapso it's simpler now but still returns the remaining phases. Allowed me to remove a few bytes from index.php, so it's again under 700 bytes. Note: the comments in index.php is not up to par anymore.Comment #8
chx commentedBack to #5 -- the patch in #7 is bogus. Better docs though.
Comment #9
asimmonds commentedIs this against 4.6.3 or HEAD?, as the issue version says 4.6.3 but the patches are for HEAD.
Anyways, in trying it against HEAD, patch #8 applies and split.php #6 executes OK.
Came across 3 problems so far:
- In admin/logs, admin/path and admin/user I get: Warning: preg_replace_callback() requires argument 2, '_unicode_caseflip', to be a valid callback in \files\split\dr\drupal_strtoupper.inc on line 8
- In admin/filters/add I get: Warning: uasort(): Invalid comparison function. in \files\split\fi\filter_list_all.inc
(I think some of the split functions are not finding they callbacks)
- Apache PHP module crashes when I try to create content eg node/add/page. I don't get a entry in apache's error.log, but the last file read before the crash is: \files\split\me\menu_parent_options.inc
Everything else I tried seemed to work OK, haven't looked at the code yet.
Test enviroment is: Apache 1.3.33/PHP 4.4.0 under windows with current HEAD
Comment #10
chx commentedOf course it's against HEAD. Thanks for review. Please try ab. I added the two mentioned functions to exceptions in split.php. I will inspect the node add problem.
Comment #11
gábor hojtsyLooking at pacth #8 (not trying it, just examining the diff), my only suspicious part is the system module change. Why does that add a function_exists(), while all other parts remove these and add module_exists() and module_invoke()?
Comment #12
chx commentedI think you mean remove module_* The
module_invokecall won't work now because it callsmodule_hookwhich now checks whethermodule_existand module_list() does not contain all modules. This check is new but won't break anything else because you are not supposed to force load not switched on modules.The other function_exists are not removed but changed to module_exist because if you look into the script you'll see that function_exists gets changed to drupal_function_exists which is not module aware. Generally, you should use module_* to interact with a module.
Comment #13
chx commentedIntroducing another var,
split_dir, defaults to split. Bart is right in that I should meddle with files.Comment #14
chx commentedThe script got smaller with the new var. Yay!
Comment #15
bart jansens commentedThe patch looks good
I ran some quick tests, benchmarked the index.php page of a default drupal install. Using split mode was almost twice as fast as without. I did the same after I enabled all core modules, this time it was more than five times as fast. Of course this was a special situation; no opcode cache and a very simple page, but it shows some promising results.
I still encountered a few problems though:
- after changing the site status to offline, users get
Fatal error: Call to undefined function: drupal_site_offline() in /home/jabart/public_html/drupal/index.php on line 24
- on q=admin/comment/configure:
warning: array_filter(): An error occurred while invoking the filter callback in /home/jabart/public_html/drupal/files/split/el/element_children.inc on line 2.
warning: implode(): Bad arguments. in /home/jabart/public_html/drupal/files/split/fo/form_get_error.inc on line 7.
Comment #16
chx commentedThanks, Bart. Currently, my focus is on getting the split patch in.
Drupal_site_offline needs some thinking, but as it is very small, I will probably add it to exceptions.
I will check whether the other error occurs in HEAD... I can't see why the split mode would cause that, the relevant functon (element_child) is in exceptions, it's always loaded.
Comment #17
beginner commentedA big +1 for this feature, for the reasons highlighted here:
http://drupal.org/node/32262#comment-53036
Comment #18
eaton commented+1 for compatability so far. I haven't looked closely at the memory aspect of it, but installed it on a stock 4.7 and have been poking around the system. No problems.
Comment #19
chx commentedAs a patch, I really feel it's ready. The only change is reroll against current HEAD.
Comment #20
chx commentedStill applies with some offset. Instructions: apply http://drupal.org/files/issues/split_5.patch , create an apache writeable 'split' dir, add $conf = array('split_dir' => 'split' , 'split_mode' => 1); to settings.php and run http://drupal.org/files/issues/split.php_2.txt
Comment #21
chx commentedRerolled so that it applies without offset.
Note: script does not work with .theme files yet. I should add them. And probably .php , too.
Comment #22
tsk1979 commentedHi chx,
I am facing the drupal memory exausted problem. since I am on a shared server and cannot be allocated more than 16M of memory, this patch looked interesting. currently I am 4.6.4, is there a consise HOWTO on the steps needed to install this patch. do I have to do anything with my php installation etc., or will it work on the same PHP5 installation.
Comment #23
chx commentedcan not work w/ 4.6.4 that version does not have the necessary capabilities.
Comment #24
killes@www.drop.org commentedIt is still a feature. :)
Comment #25
Wesley Tanaka commented+1
Comment #26
beginner commentedI rerolled the patch.
A few hunks failed.
In particular, I couldn't replace the following code, because apparently the whole block has disappeared.
But I think it would work as well as the previous patch.
Comment #27
beginner commentedWell, it's probably out of sync again.
Comment #28
LAsan commentedchx: Is this patch implemented?
Moving to cvs.
Comment #29
Susurrus commentedHasn't this been superceded by the Registry?
#221964: Registry
Comment #30
Crell commentedThis has been superseded by the D6 page split and the D7 Registry.