We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17499 ☆ A M B ☆
    • 872 Posts
    Hello,

    I would like to know the way to use uninstall "resolvers" if possible.
    Example:
    When i install a manager theme, on uninstall i would like to have access to the MODx object to reset the default theme and CSS compression.

    Is it possible ?
      • 28215
      • 4,149 Posts
      splittingred Reply #2, 16 years ago
      Yes, just attach a resolver to a vehicle, and in it add a switch:

      if (!isset($object) || !isset($object->xpdo)) return false;
      
      $success = true;
      switch ($options[xPDOTransport::PACKAGE_ACTION]) {
         case xPDOTransport::ACTION_INSTALL:
            /* code to run on install only */
            $success = true;
            break;
         case xPDOTransport::ACTION_UNINSTALL:
            /* code to run on uninstall only */
            $success = true;
            break;
      }
      return $success;
      
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 17499 ☆ A M B ☆
        • 872 Posts
        The answer so fast that i missed it laugh

        Thanks!