Jump to content

LimeWub

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by LimeWub

  1. Thanks for the response ^^ Q1 and Q2 are about 2 different issues actually. Q1: The 'issue' is more of an inconvenience when trying to debug/extend modules when using an IDE. Breakpoints go on one file, edits on other, things can get mixed up since the files have the same name and changes can be lost. It's more of an annoyance (I can still delete cache manually every time I run) but it's a bit tedious and I'd prefer it if I could just set to compile the module on the fly. Maybe delete the module cache every time it runs and recompile, if I've set it to (I suppose I can just write that tho?) Q2: I don't use anything extra for caching. But I'm using TemplateEngineFactory and TemplateEngineSmarty for the templates, and these also compile and store in the cache... Even so, they are mostly fine and update as they should. My only issue with them is that on this occasion (where I use the 'chunk' feature) my template variables for the chunk don't change when the template including the chunk changes. Eg. First time run: Page: About Us $title = About Chunk $title = About Second time: Page: Contact $title = Contact <--All good! Chunk $title = About <--Still 'About' D: I know it has to do with the fact TemplateEngineSmarty gets compiled first time I run and then is stored in cache; as everything works fine that first time when the compiled and cached version doesn't exist. I think this 'issue' may have to do with how I use the code, I think I'm bending it to do what I want to be honest. I am not even sure where the compiled versions of the templates get their template variables from, I am pretty sure the variables not changing for the chunk template, are what my problem is. I am rly confused on this second question...
  2. Is adding the namespace just me adding \ProcessWire\ in front of every extended class in the module? or is there some other way (maybe some config or so)? The problem is that I have my breakpoints for debugging in one file (compiled and cached), but need to edit a different file(non-compiled). Which causes confusion and lost changes.
  3. Hey, Really getting bugged with ProcessWIre's persistency to cache things constantly... so I'm making a thread on the topic, again Couple of Questions: Question A Can I temporarily disable ALL cache? By that I mean, getting PW to COMPLETELY ignore assets/cache and just do things on the fly. I don't care if it's slow at all. This is for development only. Question B Can I force a template file that's not a page, not to be cached? I have created a "chunk" which is a banner for each page and I want it to have a different title on each page. At the moment it gets cached and the title remains the same after the first page visited. I don't want this. Can I add anything, anywhere to stop it from caching this specific template and it's variables? I am using TemplateEngineFactory and TemplateEngineSmarty for my templates. Caching is SUPPOSEDLY turned off in the TemplateEngineSmarty configuration (which does stop 'TemplateEngineSmarty_cache' being generated, fair nuff) but 'TemplateEngineSmarty_compile' still gets created... thus said title variable stays the same on each page. Help a fellow developer stop raging Thanks in advance.
  4. That's ok, thank you for the help and response either way, very appreciated Will have a look at all the things you linked tomorrow. If anyone knows more, feel free to comment
  5. Thanks for the response Andreas Let me explain why I would prefer the modules (and yup it's defo the modules unfortunately and not the templates) not to be cached/pre-compiled, more specifically: It's been decided to use smarty templating in our project, but it doesn't quite do what we need. Thus the plan is to write a plugin for smarty (which is proving much more complicated to extend than I thought). My life, while writing this plugin, will be made much easier if I can step through the PHP I'm writing (bare in mind, I'm a newbie with both ProcessWire and Smarty so it's extra useful for me to be able to see what the functions I'm using are actually doing). Sometimes, however, it gets a bit confusing which file I'm using. Editing the plugin in the module's directory but then debugging it from the cache is kind of an awkward step. Which is why I'd prefer it if it's module at least (that's TemplateEngineSmarty or so) wouldn't be cached. Is there not any way to just ask ProcessWire to ignore the cache and just compile every time I run, maybe? Again any other suggestions in regards to this are welcome. I'd be esp interested to hear from module creators who use IDEs how they deal with this. ^^
  6. For debugging reasons, while I'm developing a site, I want the modules not to pre-compile or be stored in the cache. There is this setting, which can be set in the config: $config->moduleCompile = false; This is supposed to stop modules getting pre-compiled and stored in cache. I think so at least. (if I'm using the wrong setting or if there's some other way to ignore cache let me know pls) When I set that to false, my module files get loaded, but because they haven't gone through the file compiler their class declarations look like this: abstract class TemplateEngine extends Wire instead of this: abstract class TemplateEngine extends ProcessWire\Wire and thus the error I get is this: Error: Class 'Wire' not found (line 20 of /Users/me/websitename/www/site/modules/TemplateEngineFactory/TemplateEngine.php) Can someone help me with this issue? Is there some way for me to set the scope of where the modules are looking for, for classes like "Wire" etc, to be processwire's? Something else I'm doing wrong? Do I just NEED the modules to compile and I should just deal with it? Thanks.
×
×
  • Create New...