News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Caching 2.0.3

Started by Cheeky Stoat, January 14, 2013, 01:24:37 PM

Previous topic - Next topic

Cheeky Stoat

I'm just browsing through everything to familiarize myself with how things work because I am a total n00b at this and saw "SMF has not been able to detect a compatible accelerator on your server" in Server Settings>Caching.

I haven't touched the code because I'm still searching for how to find that so I can try to learn it.

Arantor

That's normal; most shared hosting doesn't have facilities for dedicated caching for sites, thus they don't have the caching extensions installed either.

There is always a basic file cache available, though.

Cheeky Stoat

Alright, thank you very much.  ^^  By chance do you know where I can find the code?  I promise not to touch anything yet.  XD

Arantor

What code, exactly? The code that is the admin area, the code that invokes the cache or the code that calls the cache for data?

Cheeky Stoat

I'd like to be able to modify the site eventually and I've heard that the best way to learn is to read the code with some instructions handy.  So I figured why not learn off the code that writes the site so that I can make it look how I'd like it to while I go.

Arantor

The best way is to modify the code, sure, but to try to get to learn it by looking at specific bits really isn't going to tell you much.

SMF has 110,000 lines of code in it. You won't get to understand how it works by staring at subsystems like caching. Look through the code that you want to modify specifically first of all. Even SMF experts start by looking at the code they want to change rather than knowing everything about it first.

Cheeky Stoat

If I don't need to mod the code for caching then I won't but I just don't know where to find any of the code.  I feel as if I've gone through the admin section and I'm still not coming across anything.

Arantor

So start by looking at Admin.php to see where the menu item points to. Though I still say the caching is a bad idea for trying to get to know the system.

Cheeky Stoat

My question for finding the code was just inserted into this topic when I thought there was trouble with the caching.  It was completely unrelated.  Where would you recommend that I start?

Arantor

Well... is there trouble with the cache exactly? What's the problem with it?

Staring at the code won't teach you anything, especially about troubleshooting.

Cheeky Stoat

You told me that what I was being shown was normal so I guess that there isn't actually a problem.  (Refer to first post.)

I'm trying to teach myself to code, I used to know Java but that was years ago, and since I'd like to be effective at modifying the site that I just created I'd like to learn PHP.  By cruising the forums it has been recommended that I read the code to help myself learn.  Trouble is that I don't know where to find the code or where to start.  So I was just hoping for some advice.

Arantor

Yeah, I guessed you were trying to learn PHP - which is why I've been trying to steer you away from one of the more exotic and strange bits of the system that few people do understand, and towards something else.

It's like trying to learn a language from reading the dictionary - it won't tell you what you need to know.

Finding the code in SMF is easy - it all starts from the top index.php and it figures out where to go from there depending on what the user requests.

What I'd say is, figure out what you want to customise, then we can talk you through all the logic that gets to that point - just not the caching subsystem ;)

Cheeky Stoat

Thank you, sorry for not coming across clearly.  ^^

At this exact moment I'm trying to figure out how to rename the site.  I realized that I still have the default "My Community Name" in the top left.  I've been looking through the code for the themes but so far I've not found it so I'm assuming that it's elsewhere.

Arantor

That would be because it's not in the code.

Admin > Configuration > Server Settings > General Settings, it's in there.

Cheeky Stoat

Apparently I'm blind as well as a n00b.  XD

Arantor

Nah, it's one of those settings that a lot of people miss, mostly because it's in a strange place for a reason very few people understand.

Cheeky Stoat

Well I did look through the admin settings because I didn't think it'd be in the code at first but when I "couldn't find it" due to "n00b blindness" I started to look in the code.

Advertisement: