We're up to a beta now!

Here's another test release for anyone who's interested. I'm calling this one version 0.4.0 beta 1, since I think it's getting close to ready. I've been doing a lot of bug fixes, as you may have noticed from the previous comment threads. And speaking of the comments, I'd like to thank WGM for all the input and bug reports. I really appreciate the help.

I'll start with a brief recap. Since version 0.3.4, there have been an awful lot of changes to the back-end code. If you're actually reading the code (and I don't know of many people who are), I've been trying to move as much as I can out of the page and template file and into the classes and plugins. The idea is that the "frosting," if you will, goes into the plugins and can be easily removed or reworked independent of the rest of the code base, while the classes provide a rich inerface for data retreival, storage, and generation, and so can be reimplemented in different ways, if needed. This leaves the page file more or less free of implementation details and essentially maintenance free (although it's never that easy) and it leaves the templates largely free of code so that users can tweak the heck out of them.

On the feature side, not a lot has changed. I've added a plugin system and moved the sidebar, site map, banner, RSS stuff, and comment notification to plugins. Before, all that was in either templates or classes, so if you like all those things, then nothing has changed. If, however, you want to get rid of any of them, you can now just move or delete the plugin file. I've also added two new plugins in this release: one that adds META tags to the page (description, author, and generator tags, to be precise) and another that creates an Apache .htaccess file when you create or upgrade a blog. Right now, the .htaccess file just redirects direct requests for blog data files, but I plan to add other capabilities sooner or later. Note that on some Apache configurations (e.g. Ubuntu's default configuration), this .htaccess file can cause an internal server error. If that happens, you will have to either change the server configuration or just delete/edit the file manually.

Among the accumulated bug fixes in this release are better handling for Unicode posts, fixes in the file writing setup, and various comment handling fixes. If you want to try this release with data from LnBlog 0.3.4, you will move your passwd.php, fsconfig.php, and sitemap.htm files to from the LnBlog root directory to the userdata subdirectory and then upgrade your blog's wrapper scripts to the current version. To do this, just login to the administrative page, put the name of your blog into the upgrade box (if your blog is in the web root, the you should just need the directory name, not a full path), click the button, and wait. This could take a few seconds.

That's it for now. If you have any suggestions or bug reports, you can either e-mail me or post a comment. Have fun!

You can reply to this entry by leaving a comment below. This entry accepts Pingbacks from other blogs. You can follow comments on this entry by subscribing to the RSS feed.

Comments #

    Interesting effect

    Peter,
    thank you for your credits! In turn, I appreciate your gratitude, too.

    Here's some info for thinking. It is about nativefs and creating new blogs. I've downloaded the latest version you've released. The problem with creating blogs using nativefs persisted, as it was in the previous version. To figure out, what's happening, I just put some lines

    echo $dir.'br';

    into nativefs.php.

    And the value of this parameter, first passed to the function was

    D:\Apache\Apache2\htdocs\lnblog\D:ApacheApache2htdocs\newblog

    Then I checked out my php.ini file. There was

    magic_quotes_gpc = On

    When I turned them off, everything worked fine.

    The problem in my case was not with permissions, as we've thought. Even there was 'safe_mode=Off' in php.ini.

    So. Is the described effect a thing meant to be? Or?

    Thank you.

    some update to the previous

    I have document root explicitly defined in php.ini:

    doc_root = "D:\Apache\Apache2\htdocs"

    No Subject

    Notice the line

    Parent: blogentry

    on top of this comments page.

    Is it somehow bound with the fact that there's no text of commented post here?

    P.S. Sorry for dupes.

    Concerning the very first comment

    I meant the function mkdir_rec(), because the web-server spitted out a warning, that there's an invalid value passed to this function.

    Re: No Subject

    Dupes deleted.

    The "Parent: blogentry" line is there because I didn't remove a debugging statement. I added that to trouble-shoot a problem in the rss1_generator plugin and apparently forgot to remove it. Needless to say, that will go away in the next release. ;-)

    Re: Interesting effect

    I think I've found the culprit. Try opening up the lib/blog.php file and changing line 679 from this:
    $this->home_path = stripslashes($this->home_path);
    to this:
    $this->home_path = $this->home_path;
    That should eliminate the problem with creating a new blog.

    As I noted in a comment to a previous post, the stripslashes() function isn't very smart and strips the regular Windows path separators as well. This means that the routine to canonicalize paths didn't see a backslash after the colon and so assumed that the path was relative. That's why it was showing that weird doubling of the path. By simply removing the call to stripslashes(), we remove that problem. Of course, we still have extra backslashes in the path, but a quick review of the path canonicalization function reminded me that it will take care of stripping these for us.

    So, we have several things going on here that created this bug. You probably already know a lot of this, but here's a summary just for the record.

    First, since magic_quotes_gpc cannot be modified inside of PHP code with ini_set(), LnBlog tries to do "the right thing" and fix the input mangled by magic quotes. However, the PHP functions it uses for this don't take into account that the escape character added by magic quotes is the same as the Windows path separator, so they strip those too. This obviously breaks everything that depends on the blog path. The reason you got that strange looking path when you added the echo statement to nativefs.php is because LnBlog tries to automatically convert relative paths into absolute paths, and the lack of backslashes confused that routine into thinking that the mangled path was relative. It therefore prepended the current directory to the path to make it absolute.

    With regards to the PHP doc_root configuration directive, LnBlog does not explicitly use that (although it would be a good default value for DOCUMENT_ROOT, now that you mention it). The internal DOCUMENT_ROOT used by LnBlog is set when the filesystem writing is configured and is used *solely* for converting local paths into URIs. It would be possible to tie DOCUMENT_ROOT to PHP's doc_root, but I'm not sure that's a good idea as I don't know what impact that would have on users in a shared hosting environment. And the behavior in shared hosting environments is a major concern, because that's what *I* use.

    As for server configuration in general, turning off magic_quotes_gpc is definitely good for LnBlog, because it means that the "magic quotes" correction code that caused these problems will not run. (I'm against "magic quotes" in general. It's a hack that only exists to protect users form programmers who don't know what they're doing.) As I state in the LnBlog description, my intent is that the software should run well on cheap shared hosting accounts, which means that it should require as little as possible in terms of server configuration changes. For instance, the entire reason that FTPFS exists is because NativeFS can *only* work when safe_mode is turned off. Therefore, if LnBlog fails to work because of any PHP setting, I consider that a bug.

    Anyway, thanks again for all your help. I'll try to get another beta posted in the next day or so. If all goes well with that one, then I'll clean it up and make it the final version.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.