22 Commits

Author SHA1 Message Date
Brad Dutton
01f4ed7781 remove mixed type from current(), add #[\ReturnTypeWillChange] 2022-06-04 11:56:10 -07:00
Brad Dutton
c2a70520f2 more php 8.1 updates 2022-05-13 18:44:19 -07:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
3d03ea697f Follow-on to ce34e89c89 for #1865 -
allow strings and coerce them to integers.  It might be easier to just
cast whatever comes in, but I'm worried that we'll accidentally cast
an array to an int(1) without realizing it.
2012-05-15 10:50:21 -07:00
Bharat Mediratta
ce34e89c89 Different approach to resolving #1865, this replaces 6a6b3f90f3
which was rolled back.
2012-05-15 09:50:57 -07:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta
949586c254 Oops, bug in save() -- we weren't returning the saved value! 2010-01-20 23:28:29 -08:00
Bharat Mediratta
f6c48d757c Delete MY_ORM::original(). We did not have proper containment to
generate $original when we needed it, resulting in inconsistent
behavior.
2010-01-20 22:56:37 -08:00
Bharat Mediratta
f0a290fc76 If we call original() and there's no $original yet, then consider this
to be the original.  That should be safe because we're already
guarding __set, __unset and save.
2010-01-17 13:29:36 -08:00
Bharat Mediratta
00c73a4b07 Revert "Fix for ticket #978. Don't reset the original property as part of the save processing, because that will overwrite the original values with all the new values. The problem with the original approach is that when changed event handlers used ->original(), it had already been reset as part of the save processing. Went back and forth on either leaving this alone and forcing callers to save the original prior to calling the save function, but there were a few event handlers that used ->original(). This seemed the easier change. So to reset the original you need to call reload() or clear(). There is now an optional parameter on the reload to only reload the original."
This reverts commit daeaca110d.
2010-01-15 23:53:43 -08:00
Bharat Mediratta
99073c3e20 Revert "Did the old commit then save trick"
This reverts commit e41ad23a8e.
2010-01-15 23:53:35 -08:00
Tim Almdal
e41ad23a8e Did the old commit then save trick 2010-01-13 11:47:27 -08:00
Tim Almdal
daeaca110d Fix for ticket #978. Don't reset the original property as part of the save processing, because that will overwrite the original values with all the new values. The problem with the original approach is that when changed event handlers used ->original(), it had already been reset as part of the save processing. Went back and forth on either leaving this alone and forcing callers to save the original prior to calling the save function, but there were a few event handlers that used ->original(). This seemed the easier change. So to reset the original you need to call reload() or clear(). There is now an optional parameter on the reload to only reload the original. 2010-01-13 11:27:09 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Andy Staudacher
020281d932 Adding SafeString which is going to replace p::clean() and p::purify().
Refactoring of Xss_Security_Test.
t() and t2() return a SafeString instance.

TODO:
 - Update all code to use SafeString where appropriate.
 - Update golden fole of Xss_Security_Test
 - Stop reporting CLEAN vars in Xss_Security_Test
2009-08-29 10:45:47 -07:00
Bharat Mediratta
7ad0808a11 Change the API for getting to the original state of an ORM.
Old API:  $obj->original("field_name")
  New API:  $obj->original()->field_name

This allows us to revert the varous xxx_updated events back to passing
an original ORM as well as the the updated one.  This makes for a
cleaner event API.

  Old API:  comment_updated($comment) { $comment->original("field_name") }
  Old API:  comment_updated($old, $new) { $old->field_name }
2009-08-02 12:09:00 -07:00
Bharat Mediratta
cd907c2b42 Change model_cache::clear() API to clear everything. This prevents
old ORM relationships from hanging around, which was causing problems
when doing MPTT manipulations (resulting in incorrect permission
propagation-- very bad!)
2009-07-17 12:51:27 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Bharat Mediratta
8d2782ad1d Flush the model cache as appropriate every time we call ORM::save().
Fixes ticket #301
2009-05-28 00:45:00 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00