2

symfony に独自の sfConfigCache.class.php を使用させたいのですが、オートローダー配列のデフォルト パスを変更する方法がわかりません。または、symfony に私のクラスを使用するように指示する別の方法はありますか?

4

2 に答える 2

1

これは役に立つかもしれません。

configCache をカスタマイズする方法について説明します。

于 2011-02-02T15:48:54.173 に答える
0

sfApplicationConfigurationを拡張しました。

myproject / apps / frontend / lib / sfApplicationConfigurationExtended .class.php

class sfApplicationConfigurationExtended extends sfApplicationConfiguration
{
  public function getConfigCache()
  {
    if (null === $this->configCache)
    {
      $this->configCache = new sfConfigBlobCache($this);
    }

    return $this->configCache;
  }
}

myproject / apps / frontend / config / frontendConfiguration.class.php

class frontendConfiguration extends sfApplicationConfiguration #sfApplicationConfigurationExtended // For config blob caching
{
  public function configure()
  {
  }
}
于 2012-01-26T09:30:00.480 に答える