FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Separating source and data
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Separating source and data [message #40981 is a reply to message #40597] Sat, 03 May 2008 23:29 Go to previous messageGo to previous message
Underhand is currently offline  Underhand   United Kingdom
Messages: 5
Registered: June 2007
Karma:
Junior Member
I actually needed to make a few changes for that to work.

Firstly, simply uncommenting the lines changes the behaviour when the script is run from the web site. Secondly, there's no way of choosing whether to run the consistency checks or optimise the database.

This code fragment in consist.php implements that.

        if (php_sapi_name() == "cli") {
                fud_use('adm_cli.inc', 1);
                cli_execute(1);
                if (($argc > 1) && ($argv[1] == "sqlopt")) {
                        cli_execute(0, array('opt'=>1));
                }
        }


In include/adm_cli.inc, I had to change
        fud_use('adm.inc');

to
        fud_use('adm.inc', 1);


and move it to after the code which sets _GET and _POST.


None of this works if there are no themes. Pretty much all of the scripts require at least the default theme to exist.

To allow the themes to rebuilt, I needed this in admthemes.php

        require('./GLOBALS.php');

        if (php_sapi_name() == "cli") {
                fud_use('adm_cli.inc', true);
                cli_execute(1, array('rebuild_all'=>1));
        }


and a separate script to rebuild the default theme:

<?php
        require('./GLOBALS.php');
        define('__dbtype__', 'mysql');
        fud_use('adm_cli.inc', true);
        cli_execute(1);
        fud_use('compiler.inc', true);
        compile_all();
?>


Running this script first then allows the other scripts to be run to create the temporary files, and to build the rest of the themes.

It would be really nice if this sort of functionality could be achieved without having to make changes to files, in the future. This would make upgrades less risky.

What are the chances of making some of this stuff script-friendly in a future release?

[Updated on: Sat, 03 May 2008 23:31]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mailing List Feature: Remove Mailing List Signature
Next Topic: Sorting posts within a topic
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 14:53:11 GMT 2024

Total time taken to generate the page: 0.05176 seconds