disable example


      }
    }

    // Disable the View if we made changes.     // @todo https://www.drupal.org/node/2832558 Give better feedback for     // disabled config.     if ($changed) {
      // Force a recalculation of the dependencies if we made changes.       $this->getExecutable()->current_display = NULL;
      $this->calculateDependencies();
      $this->disable();
    }

    $this->getExecutable()->setDisplay($current_display);
    return $changed;
  }

}

      'dummy_search_type' => [
        'keys' => 'foo',
        'text' => 'Dummy search snippet to display',
      ],
    ];
    $plugins = array_keys($plugin_info);
    /** @var \Drupal\search\SearchPageInterface[] $entities */
    $entities = SearchPage::loadMultiple();
    // Disable all of the search pages.     foreach ($entities as $entity) {
      $entity->disable()->save();
    }

    // Test each plugin if it's enabled as the only search plugin.     foreach ($entities as $entity_id => $entity) {
      $this->setDefaultThroughUi($entity_id);

      // Run a search from the correct search URL.       $info = $plugin_info[$entity_id];
      $this->drupalGet('search/' . $entity->getPath()['query' => ['keys' => $info['keys']]]);
      $this->assertSession()->statusCodeEquals(200);
      $this->assertSession()->pageTextNotContains('no results');
      
$this->container->get('event_dispatcher')->dispatch($event);

        $iconCacheEnabled = $this->getSystemConfigService()->get('core.storefrontSettings.iconCache') ?? true;

        if ($iconCacheEnabled) {
            IconCacheTwigFilter::enable();
        }

        $response = Profiler::trace('twig-rendering', fn () => $this->render($view$event->getParameters()new StorefrontResponse()));

        if ($iconCacheEnabled) {
            IconCacheTwigFilter::disable();
        }

        if (!$response instanceof StorefrontResponse) {
            throw StorefrontException::unSupportStorefrontResponse();
        }

        $host = $request->attributes->get(RequestTransformer::STOREFRONT_URL);

        $seoUrlReplacer = $this->container->get(SeoUrlPlaceholderHandlerInterface::class);
        $content = $response->getContent();
        if ($content !== false) {
            
public static function Comp($op1$op2$scale = null)
    {
        $op1 = self::exponent($op1$scale);
        $op2 = self::exponent($op2$scale);
        return bccomp($op1$op2$scale);
    }
}

if (!extension_loaded('bcmath')
    || (defined('TESTS_ZEND_LOCALE_BCMATH_ENABLED') && !TESTS_ZEND_LOCALE_BCMATH_ENABLED)
) {
    Zend_Locale_Math_PhpMath::disable();
}


    /** * @throws \Doctrine\ORM\OptimisticLockException * * @return array */
    public function deactivatePlugin(Plugin $plugin)
    {
        $bootstrap = $this->getPluginBootstrap($plugin);

        $result = $bootstrap->disable();
        $result = \is_bool($result) ? ['success' => $result] : $result;

        if ($result['success'] == false) {
            throw new Exception(sprintf('Not allowed to disable plugin "%s".', $plugin->getName()));
        }

        $plugin->setActive(false);
        $this->em->flush($plugin);

        return $result;
    }

    
$format->save();
    $this->verifyTextFormat($format);

    // Add a filter_test_replace filter and save again.     $format->setFilterConfig('filter_test_replace', [
      'status' => 1,
    ]);
    $format->save();
    $this->verifyTextFormat($format);

    // Disable the text format.     $format->disable()->save();

    $formats = filter_formats();
    $this->assertTrue(!isset($formats[$format->id()]), 'filter_formats: Disabled text format no longer exists.');
  }

  /** * Tests disabling the fallback text format. */
  public function testDisableFallbackFormat() {
    $this->installConfig(['filter']);
    $message = '\LogicException with message "The fallback text format \'plain_text\' cannot be disabled." was thrown.';
    
private readonly Profiler $profiler,
        private readonly Connection $connection
    ) {
    }

    public function explainAction(
        string $profilerToken,
        string $panelName,
        string $connectionName,
        int $queryIndex
    ): Response {
        $this->profiler->disable();

        $profile = $this->profiler->loadProfile($profilerToken);

        if (!$profile) {
            return new Response('This profile does not exist.');
        }

        try {
            $collector = $profile->getCollector($panelName);
        } catch (\InvalidArgumentException) {
            return new Response('This collector does not exist.');
        }
/** * Renders the profiler panel for the given token. * * @throws NotFoundHttpException */
    public function panelAction(string $token): Response
    {
        if (null === $this->profiler) {
            throw new NotFoundHttpException('The profiler must be enabled.');
        }

        $this->profiler->disable();

        if (null === $this->matcher || null === $this->routes) {
            return new Response('The Router is not enabled.', 200, ['Content-Type' => 'text/html']);
        }

        $profile = $this->profiler->loadProfile($token);

        /** @var RequestDataCollector $request */
        $request = $profile->getCollector('request');

        return new Response($this->twig->render('@WebProfiler/Router/panel.html.twig', [
            
/** * {@inheritdoc} */
  public function getDescription() {
    return $this->t('Disabled text formats are completely removed from the administrative interface, and any content stored with that format will not be displayed. This action cannot be undone.');
  }

  /** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->entity->disable()->save();
    $this->messenger()->addStatus($this->t('Disabled text format %format.', ['%format' => $this->entity->label()]));

    $form_state->setRedirectUrl($this->getCancelUrl());
  }

}
$entity_type->getDataTable(),
      $entity_type->getRevisionTable(),
      $entity_type->getRevisionDataTable(),
    ];

    $all_views = $this->entityTypeManager->getStorage('view')->loadMultiple(NULL);
    /** @var \Drupal\views\Entity\View $view */
    foreach ($all_views as $view) {

      // First check just the base table.       if (in_array($view->get('base_table')$tables)) {
        $view->disable();
        $view->save();
      }
    }
  }

  /** * Applies a callable onto all handlers of all passed in views. * * @param \Drupal\views\Entity\View[] $all_views * All views entities. * @param callable $process * A callable which retrieves a handler config array. */
$body_value = $this->randomString();
    $node->body->value = $body_value;
    $node->body->format = $format_id;
    $node->save();

    // The format is used and we should see the static text instead of the body     // value.     $this->drupalGet($node->toUrl());
    $this->assertSession()->pageTextContains('filtered text');

    // Disable the format.     $format->disable()->save();

    $this->drupalGet($node->toUrl());

    // The format is not used anymore.     $this->assertSession()->pageTextNotContains('filtered text');
    // The text is not displayed unfiltered or escaped.     $this->assertSession()->responseNotContains($body_value);
    $this->assertSession()->assertNoEscaped($body_value);

    // Visit the dblog report page.     $this->drupalLogin($this->adminUser);
    
$plugin = $em->find(Plugin::class$id);

        $this->Application()->Events()->notify(
            'Shopware_Plugin_PreUninstall',
            [
                'subject' => $this,
                'plugin' => $bootstrap,
                'removeData' => $removeData,
            ]
        );

        $result = $bootstrap->disable();
        $capabilities = $bootstrap->getCapabilities();
        $capabilities['secureUninstall'] = !empty($capabilities['secureUninstall']);
        $success = \is_bool($result) ? $result : !empty($result['success']);

        if (!$success) {
            return $result;
        }

        $this->Application()->Events()->notify(
            'Shopware_Plugin_PostUninstall',
            [
                
$subrequest = Request::create('/test_page_display_200', 'GET');
    $response = $this->container->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
    $this->assertEquals(200, $response->getStatusCode());

    $subrequest = Request::create('/test_page_display_200', 'GET');
    \Drupal::getContainer()->get('request_stack')->push($subrequest);

    // Test accessing a disabled page for a view.     $view = Views::getView('test_page_display');
    // Disable the view, rebuild menu, and request the page again.     $view->storage->disable()->save();
    // Router rebuild would occur in a kernel terminate event so we need to     // simulate that here.     \Drupal::service('router.builder')->rebuild();

    $response = $this->container->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
    $this->assertEquals(404, $response->getStatusCode());
  }

  /** * Checks that the router items are properly registered. */
  

  public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);

    // Ensure the region is valid to mirror the behavior of block_rebuild().     // This is done primarily for backwards compatibility support of     // \Drupal\block\BlockInterface::BLOCK_REGION_NONE.     $regions = system_region_list($this->theme);
    if (!isset($regions[$this->region]) && $this->status()) {
      $this
        ->setRegion(system_default_region($this->theme))
        ->disable();
    }
  }

}
new TwigFilter('sw_icon_cache', $this->iconCache(...)),
        ];
    }

    /** * @return TwigFunction[] */
    public function getFunctions(): array
    {
        return [
            new TwigFunction('sw_icon_cache_enable', $this->enable(...)),
            new TwigFunction('sw_icon_cache_disable', $this->disable(...)),
        ];
    }

    public function iconCache(?string $icon): ?string
    {
        if (self::$enabled === false || $icon === null) {
            return $icon;
        }

        $iconId = false;
        preg_match('#id="(.*?)"#', $icon$iconId);
        
Home | Imprint | This part of the site doesn't use cookies.