Giter Club home page Giter Club logo

sfcachetaggingplugin's People

Contributors

fruit avatar paulkmoore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

paulkmoore

sfcachetaggingplugin's Issues

By updating one record, sometimes it's useful to increase its collection version.

Example:

List of flights with search filter. User makes a query for flights in Riga airport, where due to weather conditions is closed whole airport. List will be empty and cache tags will be:

array('Flight' => 123456789); # collection tag

After some time, operator activates all flights in closed Airport, collection will never invalidated.

Support Doctrine transaction

Transactions inner and outer

When Doctrine objects are deleted/updated inside the Doctrine transaction, object tags are not restored to pre-transaction start point if transaction was aborted or rollback-ed.

$conn = Doctrine_Manager::getInstance()->getCurrentConnection();
try
{
  $conn->beginTransaction();

  ArticleTable::getInstance()
    ->createQuery()
    ->delete()
    ->where('id > 0')
    ->execute();

  // all Article tags should be postponed for removal
  $conn->commit();
  // postponed tags is removed physically here
}
catch (Exception $e)
{
  $conn->rollback();
  // the postponed tags removal should be canceled
}

Transaction savepoints

Why Doctrine does not supports fully transaction savepoints explained on http://wiki.sahanafoundation.org/.
Then, it makes no sense to implement tag updates rollback/commit within savepoints.

Linking and unlinking objects thrown exception when cache is disabled

When cache is disabled, it is pointless to collect $tagName. Its needed tests on this issue.

#
# Class: sfCachetaggableDoctrineRecord
#
public function link ($alias, $ids, $now = false)
{
  $self = parent::link($alias, $ids, $now);

  $tagNames = $this->getTagNamesByAlias($alias, $ids);

  if ($tagNames)
  {
    sfCacheTaggingToolkit::getTaggingCache()->invalidateTags($tagNames);
  }

  return $self;
}

Create a standalone test environment

Main reason of this decision is to allow to other plugin users/developers to test plugin integrity by changing some peaces of code.

TODO:

  • Create project inside fixtures folders to keen all tests holistic.
  • Using sfTaskExtraPlugin initialize all required plugin structure and sync current plugin with new test folder organisation.
  • Add notes to README how to run plugin tests

Database level cascading will not expire related table`s record tags

There are some solutions/ideas:

โ„–Idea"+""-"
1.Enable Doctrine level delete cascading (not a great idea, when database contains many relations, and system subject to frequently record deletions). nothing to do, all works perfectlydatabase without references
2.Remove all linked to cache tags, if one of them does not exists (may be problem, when it`s first time cache request, this solutions could be easy to implement, fast in action, but could remove extra tags, that are extra).easy to implementdoes not solves the problem
3.Store tags as tree (slower, but safer not to remove tags, that is not related to root tag) - much time required to implement and rewrite most of existing tests.~long term of implementation, does not solves the problem
4.Implement own cascading deletion of tags (based on model relations), not Doctrine objects.solves the problemadditional queries (if Doctrine cascading is enabled) - solvable, pretty hard to implement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.