From b8c0091390a9d0377eab80d77c9605d6b0ee428e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 20 Dec 2008 19:23:32 -0500 Subject: [PATCH] first step of phpcs-cleanup of index.php darcs-hash:20081221002332-84dde-5834e12499fff0a23a8a6a76018f8beaa5ea8a96.gz --- _darcs/inventory | 4 +- ...834e12499fff0a23a8a6a76018f8beaa5ea8a96.gz | Bin 0 -> 581 bytes _darcs/pristine/index.php | 44 +++++----- _darcs/tentative_pristine | 77 ++++++++++++------ index.php | 44 +++++----- 5 files changed, 103 insertions(+), 66 deletions(-) create mode 100644 _darcs/patches/20081221002332-84dde-5834e12499fff0a23a8a6a76018f8beaa5ea8a96.gz diff --git a/_darcs/inventory b/_darcs/inventory index c8e2b1b21e..49dc7559d3 100644 --- a/_darcs/inventory +++ b/_darcs/inventory @@ -19,4 +19,6 @@ Sarven Capadisli **20081218003302 ] [more information in subscription notices -Evan Prodromou **20081212171135] \ No newline at end of file +Evan Prodromou **20081212171135] +[first step of phpcs-cleanup of index.php +Evan Prodromou **20081221002332] \ No newline at end of file diff --git a/_darcs/patches/20081221002332-84dde-5834e12499fff0a23a8a6a76018f8beaa5ea8a96.gz b/_darcs/patches/20081221002332-84dde-5834e12499fff0a23a8a6a76018f8beaa5ea8a96.gz new file mode 100644 index 0000000000000000000000000000000000000000..ae9dc79627a0857d30a5297700175d2acf79f7d5 GIT binary patch literal 581 zcmV-L0=oSliwFP!000001FckRZ`v>v{apWws}$7)2!YV5o7k#V8XqcE)7EyM5Q>ar zf`_p)Ct>R<{`;Ha<{MlF>}T6- zqrrkm_^ef+)m)|Uj+ym`Xti!jGG|wfhS%x5>3Uwb)A4#eZv;-ink{R5x`>44NhYdL1g5&<4 z122$s3L#5?$N(szQwB8En#lyxm}%3e`%-yV@NFi@B~LgJ{1*d3WSEkW0h5bd?NDt; z>iirz@X`lsM%9Aph{W*^r32goOd_6L0!6cnW+6A(YHZs!a-LB0KkDtv_M%&~ypdsz z(1a^F;ewgK@_M=DQ(=yR_mI+j4p&gSZC&R#mI=6MnoBCupp1D!m*i3>@bF?Jij zM9vAHK)psY-EfG5F&+)^oNKK#9>LjJb%GjybFO&oYeoVk#bZ79!a2$LW}j$H9uEnv zuqUTr2}J@J6Eg*r%g}1Ul$dW`toNaHKj)zx-r-089QX{2JU!|n_I-=?5;SK>3^oO zuJC+&R1(dCv@_is_readonly()) { - if (is_array($config['db']['mirror'])) { - # "load balancing", ha ha - $k = array_rand($config['db']['mirror']); - $mirror = $config['db']['mirror'][$k]; - } else { - $mirror = $config['db']['mirror']; - } - $config['db']['database'] = $mirror; - } + + if ($config['db']['mirror'] && $action_obj->is_readonly()) { + if (is_array($config['db']['mirror'])) { + // "load balancing", ha ha + $k = array_rand($config['db']['mirror']); + + $mirror = $config['db']['mirror'][$k]; + } else { + $mirror = $config['db']['mirror']; + } + $config['db']['database'] = $mirror; + } if (call_user_func(array($action_obj, 'prepare'), $_REQUEST)) { - call_user_func(array($action_obj, 'handle'), $_REQUEST); - } + call_user_func(array($action_obj, 'handle'), $_REQUEST); + } } else { common_user_error(_('Unknown action')); } \ No newline at end of file diff --git a/_darcs/tentative_pristine b/_darcs/tentative_pristine index a4efd27bab..fa3a0e58e5 100644 --- a/_darcs/tentative_pristine +++ b/_darcs/tentative_pristine @@ -1,25 +1,52 @@ -hunk ./lib/mail.php 115 -- $headers['Subject'] = sprintf(_('%1$s is now listening to your notices on %2$s.'), $other->getBestName(), -+ $headers['Subject'] = sprintf(_('%1$s is now listening to your notices on %2$s.'), -+ $other->getBestName(), -hunk ./lib/mail.php 120 -- 'Faithfully yours,'."\n".'%4$s.'."\n"), -- $long_name, -- common_config('site', 'name'), -- $other->profileurl, -- common_config('site', 'name')); -- -+ '%4$s'. -+ '%5$s'. -+ '%6$s'. -+ "\n".'Faithfully yours,'."\n".'%7$s.'."\n\n". -+ "----\n". -+ "Change your email address or notification options at %8$s"), -+ $long_name, -+ common_config('site', 'name'), -+ $other->profileurl, -+ ($other->location) ? sprintf(_("Location: %s\n"), $other->location) : '', -+ ($other->homepage) ? sprintf(_("Homepage: %s\n"), $other->homepage) : '', -+ ($other->bio) ? sprintf(_("Bio: %s\n\n"), $other->bio) : '', -+ common_config('site', 'name'), -+ common_local_url('emailsettings')); +hunk ./index.php 2 +-/* ++/** +hunk ./index.php 23 +-require_once(INSTALLDIR . "/lib/common.php"); ++require_once INSTALLDIR . '/lib/common.php'; +hunk ./index.php 25 +-# get and cache current user ++// get and cache current user +hunk ./index.php 29 +-# initialize language env ++// initialize language env +hunk ./index.php 44 +- 'recoverpassword', 'api', 'doc', 'register'))) +-{ ++ 'recoverpassword', 'api', 'doc', 'register'))) { +hunk ./index.php 51 +- require_once($actionfile); +- $action_class = ucfirst($action)."Action"; ++ ++ include_once $actionfile; ++ ++ $action_class = ucfirst($action).'Action'; ++ +hunk ./index.php 57 +- if ($config['db']['mirror'] && $action_obj->is_readonly()) { +- if (is_array($config['db']['mirror'])) { +- # "load balancing", ha ha +- $k = array_rand($config['db']['mirror']); +- $mirror = $config['db']['mirror'][$k]; +- } else { +- $mirror = $config['db']['mirror']; +- } +- $config['db']['database'] = $mirror; +- } ++ ++ if ($config['db']['mirror'] && $action_obj->is_readonly()) { ++ if (is_array($config['db']['mirror'])) { ++ // "load balancing", ha ha ++ $k = array_rand($config['db']['mirror']); ++ ++ $mirror = $config['db']['mirror'][$k]; ++ } else { ++ $mirror = $config['db']['mirror']; ++ } ++ $config['db']['database'] = $mirror; ++ } +hunk ./index.php 70 +- call_user_func(array($action_obj, 'handle'), $_REQUEST); +- } ++ call_user_func(array($action_obj, 'handle'), $_REQUEST); ++ } diff --git a/index.php b/index.php index d387740fc2..3cecb5c8b6 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ is_readonly()) { - if (is_array($config['db']['mirror'])) { - # "load balancing", ha ha - $k = array_rand($config['db']['mirror']); - $mirror = $config['db']['mirror'][$k]; - } else { - $mirror = $config['db']['mirror']; - } - $config['db']['database'] = $mirror; - } + + if ($config['db']['mirror'] && $action_obj->is_readonly()) { + if (is_array($config['db']['mirror'])) { + // "load balancing", ha ha + $k = array_rand($config['db']['mirror']); + + $mirror = $config['db']['mirror'][$k]; + } else { + $mirror = $config['db']['mirror']; + } + $config['db']['database'] = $mirror; + } if (call_user_func(array($action_obj, 'prepare'), $_REQUEST)) { - call_user_func(array($action_obj, 'handle'), $_REQUEST); - } + call_user_func(array($action_obj, 'handle'), $_REQUEST); + } } else { common_user_error(_('Unknown action')); } \ No newline at end of file -- 2.39.5