[pLog-svn] Rewrite of getSessionValue()
Jon Daley
plogworld at jon.limedaley.com
Sat Jul 8 14:17:45 GMT 2006
We want people to upgrade, even if you did all the work, it still
takes time away from other developers.
I agree that we need a nicer way for people to be able to modify
the admin templates and not have their stuff overwritten during upgrades.
Other than that, I don't know any reason for someone to stay with an older
version of the software. With the plugin architecture, I don't know of
any reasons to modify the core code any more.
On Sat, 8 Jul 2006, Ammar Ibrahim wrote:
> Why not, I can maintain it once I'm more familiar with the project. It takes
> 10 seconds to replace this code and commit it
>
> - Ammar
>
> On 7/8/06, Mark Wu <markplace at gmail.com> wrote:
>>
>> I will suggest we just put it into 1.1 trunk. Unlese we have another sql
>> injection bug in 1.0.x series., or I think we won' t have another 1.0.x
>> version release.
>>
>> Mark
>>
>> > -----Original Message-----
>> > From: plog-svn-bounces at devel.lifetype.net
>> > [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
>> > Sent: Saturday, July 08, 2006 9:07 PM
>> > To: plog-svn at devel.lifetype.net
>> > Subject: Re: [pLog-svn] Rewrite of getSessionValue()
>> >
>> > It looks alright, though I don't think it changes
>> > anything. A even simpler version is below. We don't have a
>> > place to check stuff in for fixes to 1.0.6, do we? This
>> > particular fix should not be the one to open a new branch,
>> > though if we do end up using one, this might as well get
>> > checked in. I can put this in 1.1, definitely.
>> >
>> > > function getSessionValue( $param, $defaultValue = "" )
>> > > {
>> > > $session = HttpVars::getSession();
>> > > $viewName = $this->className();
>> > > $keyName = "{$viewName}_{$param}";
>> > >
>> > > if ( isset($session[$keyName]) &&
>> > $session[$keyName] != '' ){
>> > > return $session[$keyName];
>> > > } else {
>> > > return $defaultValue;
>> > > }
>> > > }
>> >
>> >
>> >
>> > On Sat, 8 Jul 2006, Ammar Ibrahim wrote:
>> >
>> > > While reading some code, I stumbled across getSessionValue() in
>> > > class/view/view.class.php . And I think the logic
>> > implemented is quite
>> > > complicated to do a really simple thing and there were a
>> > few mistakes
>> > > like putting a string variable between quotes. Here's a
>> > rewrite, could
>> > > someone please update the 1.0.6 branch, because I don't
>> > have SVN accesss.
>> > >
>> > > /**
>> > > * retrieves a parameter from the session
>> > > *
>> > > * @param param
>> > > * @param defaultValue
>> > > * @return The value associated to the parameter or
>> > empty if not
>> > > * found
>> > > */
>> > >
>> > > function getSessionValue( $param, $defaultValue = "" )
>> > > {
>> > > $session = HttpVars::getSession();
>> > > $viewName = $this->className();
>> > > $keyName = "{$viewName}_{$param}";
>> > >
>> > > $value = '';
>> > > if ( isset($session[$keyName]) &&
>> > $session[$keyName] != '' ){
>> > > $value = $session[$keyName];
>> > > } else {
>> > > $value = $defaultValue;
>> > > }
>> > >
>> > > return $value;
>> > > }
>> >
>> > --
>> > Jon Daley
>> > http://jon.limedaley.com/
>> >
>> > There is forgiveness through the cross.
>> > _______________________________________________
>> > pLog-svn mailing list
>> > pLog-svn at devel.lifetype.net
>> > http://devel.lifetype.net/mailman/listinfo/plog-svn
>>
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>
>
--
Jon Daley
http://jon.limedaley.com/
I always blame the software. Unless I wrote it.
Then I blame the hardware.
-- Forest Godfrey
More information about the pLog-svn
mailing list