Jonathan,

Yes, it is hard coded in ysfProjectConfiguration, but you can override in
the ysfConfigDimension constructor. Albeit not clean, you just have to
assign $this->dimension before call $this->setDimension();

$this->dimension = new ysfConfigDimension($this->getEventDispatcher(),
(!isset($this->debug) || (isset($this->debug) && $this->debug === true)) ?
new sfNoCache() : new sfXCache(array('prefix' =>
'symfony.dimensions.config.default:'.$this->application.':'.$this->environme
nt, 'automatic_cleaning_factor' => 0, 'lifetime' => 86400)));


Otherwise, you can extend ysfProjectsetDimension::setDimension()
{
$this->dimension = new ysfConfigDimension($this->getEventDispatcher(),
(!isset($this->debug) || (isset($this->debug) && $this->debug === true)) ?
new sfNoCache() : new sfXCache(array('prefix' =>
'symfony.dimensions.config.default:'.$this->application.':'.$this->environme
nt, 'automatic_cleaning_factor' => 0, 'lifetime' => 86400)));
parent::setDimension($dimension);
}

I will make a cleaner implementation if you file a ticket. I consider PHP5/6
to always have APC (even though that is not the case, it should).

Cheers,

Dustin


On 6/9/08 2:44 AM, "Jonathan Bryan" <[EMAIL PROTECTED]> wrote:

> 
>>> However, i found one call to APC here, which is then ignored:
>>> http://trac.symfony-project.com/browser/plugins/ysfDimensionsPlugin/branches
>>> /1
>>> .1/lib/config/ysfProjectConfiguration.class.php#L50
> 
> Looking at that line of code, it appears that the sfAPCCache is hard
> coded into sfDimensions. Is it possible to use one of the other
> symfony cache plugins?
> 
> Regards, Jonathan
> 
> 
> On 8 Jun 2008, at 00:00, Dustin Whittle wrote:
> 
>> 
>> Michael,
>> 
>>> 
>>> Thanks Dustin, that make sense regarding php code in cached files.
>>> 
>>> However, i found one call to APC here, which is then ignored:
>>> http://trac.symfony-project.com/browser/plugins/ysfDimensionsPlugin/branches
>>> /1
>>> .1/lib/config/ysfProjectConfiguration.class.php#L50
>>> 
>> 
>> This is simply passing a cache instance via constructor to create
>> ysfConfigDimension.
>> 
>>> Additionally, i think there is no "asResponse()" method inside the
>>> exception class in a standard symfony installation. I guess this is
>>> also from your branch. Here's the line:
>>> http://trac.symfony-project.com/browser/plugins/ysfDimensionsPlugin/branches
>>> /1
>>> .1/lib/config/ysfProjectConfiguration.class.php#L64
>>> 
>> 
>> Yes, this is from the trunk/my branch. I will fix for 1.1 branch
>> later this
>> week.
>> 
>> Cheers,
>> 
>> - Dustin
>> 
>>> Thanks a lot,
>>> Michael
>>> 
>>> 
>>> On 6 Jun., 20:17, Dustin Whittle <[EMAIL PROTECTED]>
>>> wrote:
>>>> Michael,
>>>> 
>>>> I am glad you fine the plugin fits your needs. The cache factory
>>>> comes from
>>>> my branch. This can be safely ignored in the sample app. There is
>>>> no setting
>>>> for caching config files in apc instead of disk. In mose cases,
>>>> this does
>>>> not make sense, as the cached files contain php code and not
>>>> cacheable data.
>>>> The apc cache in the ysfDimensionsPlugin, simply caches the
>>>> dimensions
>>>> configuration and the paths to configuration files (not the files
>>>> themselves). Since the ysfDimensionsPlugin extends the configuration
>>>> cascade, there is no reason to recalculate every request.
>>>> 
>>>> For the i18n, routing, and view_cache factories you can change the
>>>> cache
>>>> instances to use apc, see:
>>>> 
>>>> all:
>>>>  view_cache:
>>>>    class: sfAPCCache        # cache class: sfAPCCache, sfXCacheCache
>>>>    param:
>>>>      lifetime:  31556926               # default cache ttl
>>>>      prefix:    %SF_APP_DIR%/template  # prefix
>>>> 
>>>>  i18n:
>>>>    class: sfI18N
>>>>    param:
>>>>      cache:
>>>>        class: sfAPCCache
>>>>        param:
>>>>          lifetime:                  31556926
>>>>          prefix:                    %SF_APP_DIR%/i18n
>>>> 
>>>>  routing:
>>>>    class: sfPatternRouting
>>>>    param:
>>>>      cache:
>>>>        class: sfAPCCache
>>>>        param:
>>>>          lifetime:                  31556926
>>>>          prefix:                    %SF_APP_DIR%/routing
>>>> 
>>>> Please let me know if you have any questions or concerns.
>>>> 
>>>> Cheers,
>>>> 
>>>> Dustin
>>>> 
>>>> On 6/6/08 8:20 AM, "[EMAIL PROTECTED]"
>>>> 
>>>> <[EMAIL PROTECTED]> wrote:
>>>> 
>>>>> Dear Dustin,
>>>> 
>>>>> i love your plugin, once i tried it in the last days. I have a
>>>>> question regarding the cache. In the docs APC is mentioned to
>>>>> save the
>>>>> settings. In the fixtures directory there is also a complete
>>>>> example
>>>>> project and i can see, the sample app (dimensions) has an "cache"
>>>>> setting in factories.yml
>>>> 
>>>>> But ASFAIK this setting is not handled by symfony 1.1, isn't it?
>>>>> There
>>>>> is only a setting for "view_cache", which i already know. So is
>>>>> there
>>>>> anywhere a setting to force symfony to use APC cache (or any other
>>>>> opcode cacher) for all config files, instead of diskfiles?
>>>> 
>>>>> Thanks again,
>>>>> Michael
>>>> 
>> 
>> 
>> 
>>> 
> 
> 
> > 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to