I’m sure some of you are wondering how things are progressing on the brand new v2.0. Well, first of, let me assure you that progress is being made, it may be slow, but it is progress! (We’re still looking for one or two developers to help speed things up, BTW)
Just recently, I’ve finished setting up a new configuration API, which will allow developers to easily configure Pixelpost, as well as create and save their own configuration options. The draft API looks something like this:
// Change the active template to "Simple"
Config::set("template", "simple");
// Returns the active template "simple"
Config::current()->template;
// Create a new option, which contains an array:
Config::set('my-option',array('value1','value2'));
// Delete the option:
Config::remove("my-option");
For the developers out there, you’re probably thinking, OK, this is nice, but it’s not really that big of a game changer. Well, here is the twist, rather than saving the options in a database table, like we’ve done in the past, these options would simply be saved in the pixelpost.php configuration file, as a php array. And since the configuration, generally speaking, only changes when you’re using the admin interface, the file won’t need to be updated that often. So, why should we store all the options in a database, only to require that it be queried on every page load by both guests and admins? Besides the speed benefit, both power-users and people who have are migrating their blog to a different server, can easily adjust the options for their entire blog by simply editing the pixelpost.php file, rather than firing up the admin interface.
This is a major change, we’d like to get some feedback you all, to make sure the development community agrees with this change. Because, after all, we’re building this for you! (And ourselves too of course!)
You can follow any responses to this entry through the RSS 2.0 feed. Trackback from your own site.
My first thought was: “What about security? Configuration file will have to be writable.” I worked with many CMS systems and in all of them it was not recommended to leave config file writable after installation in shared hosting environment. But all of these systems kept just database connection related information in config file.
I thought about it for a while and I must admit that I am not sure what is the security benefit having config file unwritable. When attacker uses same shared hosting he can read your database config file even when it is not writable and I am almost sure that he can also connect to your database with credentials read from this file. So finally he can modify application configuration in database. Maybe someone else know what is the security benefit?
Lets move from security to speed
How big is the speed benefit you mentioned? I know that question of speed cannot be answered in general because it depends on database workload and many other things but I think that many people have put significant effort into MySQL optimization. No offense but did you perform any specific measurements that can prove that new config file parser is faster than reading from database?
And finally I have also one question about API. Is there any mechanism that will prevent addon X to use configuration option with same name as addon Y uses? Without such mechanism there can be a lot of conflicts. Maybe you should introduce some kind of namespaces or just addon specific prefix that will be prepended to the name of option.
It would be also very nice if addons could discover new versions of themselves just like they do in wordpress.
@Jaroslav
You bring up some valid points. As far as security is concerned, ideally, the file would only be accessible to the web server/PHP. This will be possible on some servers, as an install script will attempt to create the file in the most secure manner, but alas, on quite a few shared servers, the file will most likely have to be saved as 755 or 777. This does pose a possible security issue, but as you mentioned, if the file is still readable by an attacker, they can simply read the database credentials and attack it directly. Needless to say, if an attacker can read your files, you’ve got a problem, period.
Speed, as it stands, I can’t see how mySQL could possibly read the configuration faster than PHP’s internal include function, but I’m definitely going to run some benchmark tests at varying levels of load to compare, and I’ll post the finding on the blog after I’ve completed the tests.
Namespace conflicts could possibly be an issue. With v1.7, we don’t really have any standards published as far as naming conventions. But with the new version, it would be a good idea to recommend that addon creators use an addon-specific prefix to help prevent any possible conflicts.
Also, addon version checks will be a possibility, thanks to the extend section on the Pixelpost website. It should be easy enough to simply compare the latest version on extend vs the installed version, and display a notice next to any addon that is applicable.
Thanks for the reply!
I for one welcome the changes if they speed things up, and the new idea of the configuration saved to PHP sounds great as long as the above mentioned issues are addressed.
It is also something positive for us all to look forward too in these bleak times
Thanks everyone
Steve Procter
http://www.stephenprocter.co.uk
Come on dude, these facts* and proof* i mean who is posting* lol
For the whole security issue, i’d suggest to be able to put this file above root directory, that most likely wont be accessible from the web.
That would be awesome!
@Jowah
The current v2 folder structure has an “application” directory, which stores all of the core files, including the config file mentioned above. This entire directory will be inaccessible to the web by using the included .htaccess file. Additionally, we will be adding support so people can move the application folder to another location outside of the public_html, for additional security.
As a Newbie, I am always searching online for articles that can help me. Thank you
Hi, I can’t understand how to add your site in my rss reader. Can you Help me, please
GR8 Blog, You must have spent a lot of time researching this, TY.
Hello, great info!! bookmarked
Thx and regards from Italy!
Good Post. Can you email me back, please. Thank you.
What a wonderful blog! Please continue this great work I will be sure to check back regularly…
That’s Too nice, when it comes in india hope it can make a Rocking place for youngster.. hope that come true.
Pretty superb post, very educational stuff. Never considered I’d obtain the info I need in this article. I have been looking throughout the net for some time now and had been starting to get irritated. Fortunately, I happened across your blog and received precisely what I was struggling to find.
I pray that someday I will have a blog as good as yours!
Super Blog, Bro! Admitedly I’m a home security aficionad0 and am constantly on the lookout for new and interesting sites and postings about stylish home security related stuff… which is what led me here. At any rate i just wanted to check in as I certainly plan on visiting again! Adios
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
This is really a excellent source of information and facts, Im glad I read this information. I will be returning soon to see more that you have.
I am glad that I found this web site. Congratulations on your helpful article. That’s a Thanks a lot ! I have checked over a few of your other articles and found some great information too.
Do you mind if I quote you on my blog if I link back to this page?
Hi
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
Hi
Nice post. Keep up the good work
I couldn’t agree more…thanks for your post.
I couldn’t agree more…thanks for your post.
I couldn’t agree more…thanks for your post.
Hi, discriminative posts there
through’s recompense the interesting advice
This been quite some time since im searching for some way to answer my qestion on to make income online. Now i found it it your post. I add this to my favorites.
I really like the fresh perpective you did on the issue. Really was not expecting that when I started off studying. Your concepts were easy to understand that I wondered why I never looked at it before. Glad to know that there’s an individual out there that definitely understands what he’s discussing. Great job
Fantastic post! This could aid lots of people find out about this matter. Do you want to incorporate video clips together with these? It could undoubtedly help out. Your reason was spot on and owing to you; I probably won’t have to describe everything to my pals. I can simply direct them here
Interesting post. Keep publishing more super stories. Been watching your web logs for 4 days at present and I should tell I am beginning to like your post. I require to acknowledge how do I support to your web logs?
I think that any company that takes their online presence seriously should look into having a blog. It is a way to engage with your customers on a more personal level.