On Tue, Sep 29, 2009 at 3:37 AM, DrunkenMonk <[email protected]> wrote:
>
>> > have a Boltwire-configurable mysql_backend ... Lacking a BOLT
>> > $plugin_onInstall() hook, called before the plugin is commit to
>> > site.config or wherever, allowing the plugin to block the installation
>> > if it isn't installed properly...) on the format:
>>
>> Not sure what you mean here, but I'm much more inclined to provide
>> hooks when possible. If you could specify exactly what you want I'll
>> try to help.
>
> The problem is this: With a mysql backend, we read a plugin list from
> a HD based page, activate the plugin, and read the rest of the pages
> from mysql. Once read, we can no longer change the page which caused
> us to use the mysql plugin. We can't deactivate it.
Since you are using a custom page store, why can't you have it read
from the hd page whenever you are accessing site.config, and the msql
db for any other pages. It's a few extra lines of code, but it should
solve the problem.
As for a hook however, I'm still open to one if you can specify where
and how. It seems perhaps some kind of hook around ~45-46 in
engine.php along these lines:
if (file_exists("startup.php")) {
include_once("startup.php");
if (func_exists(startupConfig)) $contents = startupConfig();
}
if ($contents == false) {
if (file_exists("$pagesDir/site.config")) $config =
file_get_contents("$pagesDir/site.config");
else $config = file_get_contents("$systemPath/site.config");
}
This allows you to create a custom startup.php file side by side with
index.php, and optionally, create a startupConfig function in it to
retrieve the config page contents anyway you want. I suppose you
could also generate your BOLTconfig and BOLTplugins manually and just
return something for $contents beside 'false'.
Would this do what you want?
> One way to fix it is to be able to define what parts of the site
> should be kept on a HD, and which should use a database.
>
> The on-install hook would let the plugin update configuration
> variables or other files once, when it is installed. a mysql_plugin
> might create a database and copy the entire site to it, and then on
> the uninstall hook change the configuration to deactivate itself on
> the HD pages. And copy the database to HD pages.
>
>> I am very used to thinking of my forms as commands, processed in the
>> order they appear in the form.
>
> Note that this would still happen, as far as boltwire is concerned.
> The page cache would be updated, and as far as commands are concerned
> the cache is the page. Just the time consuming part would be kept till
> the end
I follow what you are saying. Still thinking about it though. Would
rather see what you can come up with. If simple. And then perhaps do
some benchmarking to see how much it really saves in time. While very
few forms write to a page multiple times, it is not uncommon to have
it done twice (data and content). So we could save some that side.
We also need to think about the abort process. Right now, I put the
warn statement when and where I want it to abort. So I know what's
been done/not been done by where I place it. This new approach would
not give me that flexibility. It would be all or nothing as you say.
I'd have to think what the implications of the change would be.
>> $BOLTpostProcess[] = 'functionname'; (or pre/background for post)
>
> This is great, but would require you to store any variables you want
> to send as global variables. I don't like globals, they tend to be
> slow.
> You could potentially up the function to look for key-value pairs
> without changing the current function, but I'll understand if you wait
> till theres a need.
What if we allowed the option set the variables like this:
$BOLTpostProcess[mypostfunc][field1] = value1;
$BOLTpostProcess[mypostfunc][field2] = value2;
$BOLTpostProcess[mypostfunc][field3] = value3;
Then when sent to the BOLTprocess function we call
mypostfunc($BOLTpostProcess[mypostfunc]);
So you have the whole array of info available to you. Should be easy
enough to do, and not disrupt existing functionality. You like?
Cheers,
Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---