Once you have the basics together to create a target
(template, source, and pattern) then you will want to compile them to create
the target. If you have set the configuration variable $GLOBALS['interJinn']['compileUpdates'] to true and you want to be able to compile non-existent pages for
which a pattern has recently been added, then you will need to have 404 errors
redirect to a handler page. This handler page will need to load the
handler404.inc component.
<script language="php">
$jinn_handler404 = $dl->do->load( array
(
'logic' => array
(
array
(
'source' =>
'Core/libraries/templateJinn/handler404.inc',
),
),
) );
</script>
Alternatively if you can compile pages from the shell (and you should be able to) then you can use the TemplateJinn tag syntax which has the added advantage of also being automatically recompiled when changed and providing the look and feel of your site when informing a visitor of a real 404 error.
<jinn:module name="handler404">
<jinn:component
type="logic"
source="Core/libraries/templateJinn/handler404.inc"
/>
</jinn:module>
If you do not include one of these then you will find that new pages do not automatically compile when requested.
Sometimes you just want to recompile your pages in your website immediately or perhaps when an error occurs that prevents the automatic compilation from achieving success. In these cases it is useful to use a shell based compiler. The shell base compiler can be used to compile the entire web-site in one command or to compile individual pages. The following code represents all that should be necessary to create your own project specific compilation script.
#!/usr/bin/php -qC <script language="php"> // // Include the appropriate project configuration file. This // isn't necessary if you are already including it via // auto_prepend -- but then managing multiple projects will // be messy. // include_once( '/home/web/interjinn/Projects/interjinnConfig.inc' ); // // Load the template manager via the dynamic loader. // $dl = &$GLOBALS['interJinn']['dl']; $tManager = $dl->getService( 'templateManager' ); // // Invoke the template manager with the first shell argument // passed on the command line (name of page to compile or // blank for all). // $tManager->do->process( $tManager->getShellArg( 1 ) ); // // Include the shutdown code. // include_once( $GLOBALS['interJinn']['coreRoot'].'append.inc' );
All you should need to do now is run the script and watch as your web site is compiled. Currently error detection is minimal for bad tags (missing closing tags), bad data and anything else you might do wrong. The shell compiler fortunately outputs more information than the automatic compiler. This is a good way to catch errors early before making new pages public. Later the errors will be redirected to appropriate error log.