This site is a low down on what's going on in my life, what I'm working on, what I'm thinking about, and how I'm feeling about life in general.

Sunday, 10 February 2008 22:02

Content engine is working and, yes, STABLE!

This blog software represents the first time I've tried to build and maintain static files.

Mod rewrite was an option but ultimately I think this will be better suited for this particular application.

Although quite simplistic at this stage there have still been a number of issues which may or may not be due to the configuration of my hosting provider 34sp but nonetheless was very frustrating.

The main issue was getting mkdir to work correctly. Although I'd set the permissions correctly, I was still having issues. This turned out to be because the example I was following (successfully on local development box) had the directory name ending in a forward slash.

Whatever config 34sp are using, it did not like this and eventually, when I removed this, I began to make progress. The next problem was that it wouldn't let me create folders in the httpdocs folder, so had to create a subfolder called content. 

This resolved the issue and the pages are now building correctly.

The folder build / check code now looks like this: 

//Check or create YEAR folder

$dirName = 'content/'.date('Y');

if(file_exists($dirName)){

//exists actions if any.

}else{

//doesn't exist actions if any

mkdir($dirName, 0777);

}

//Check / create MONTH folder

$dirName .= '/'.date('m');

if(file_exists($dirName)){

//exists actions if any.

}else{

//doesn't exist actions if any

 mkdir($dirName, 0777);

}

 



Posted in categories:

Tags: Blog Content Engine Stable Hosting

Comments

    Add a comment

    Previous Articles
    Most Read Articles