From: Mark W. <ma...@rw...> - 2011-02-18 16:08:33
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body text="#000000" bgcolor="#ffffff"> Hi Scott, <br> <br> The way you would 'auto increment' the version would be to use the svn feature that can insert version numbers into a specific place in a file upon commit. But i think auto increment is a bad idea.<br> <br> I am going to be away all weekend so won't be able to do any work. I have been thinking about how to do upgrades a bit and what I was thinking was a bit like having 1.5.3.sql also have a 1.5.3.php file with a string of instructions that can be run.<br> <br> How about having a folder: 'install/version' ?<br> For now maybe place your cvt-cfg.php in install/version as '1.5.4.php' or whatever the next version number is? and then modify the text in the upgrade.php file to indicate that this file needs to be run?<br> <br> For future work: to form a structure for the upgrade.php files I think we should have something like:<br> <br> class upgrade_1_5_4 extends Upgrade{<br> .... some stuff in here<br> }<br> <br> abstract class Upgrade{<br> <br> abstract public function __construct();<br> abstract public function functionName();<br> }<br> <br> If the upgrade php files have a common structure and known function names then it would mean the upgrade script could be written quite robustly.<br> <br> Regards<br> Mark<br> <pre class="moz-signature" cols="72">_____________________________________________ Mob: 07725 695178 Email: <a class="moz-txt-link-abbreviated" href="mailto:ma...@rw...">ma...@rw...</a></pre> <br> On 18/02/2011 15:41, Scott Miller wrote: <blockquote cite="mid:AANLkTimcoysL5Yi=mAf...@ma..." type="cite">Mark,<br> <br> Well, what I have is a php script that takes the LDAP and other misc stuff from the existing config table and inserts those entries into the new configuration table. So, it is also ignoring all the html and acl entries. It changes several LDAP entries and creates the new LDAPurl item, and modifies the version to be 1.5.3. I've thought about trying to figure out how to "auto increment" the version, but I'm thinking we actually don't want that to happen.<br> <br> So, this is in a script currently called cvt-cfg.php in the install directory. I'm just now starting to think about how and where to run this script... should it be imbedded as part of the upgrade script(s)? Or should I just check this new file in for now?<br> <br> -Scott<br> <br> <div class="gmail_quote">On Thu, Feb 17, 2011 at 10:25 PM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw...">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div text="#000000" bgcolor="#ffffff"> Hi Scott, <br> <br> Yeah remove the id column. The option name should really be the unique key anyway.<br> <br> If you:<br> <br> 1.create an sql file with the change in install/sql/{version_number}.sql<br> 2. increment the version in the config table, and put that in the sql file from above.<br> 3. increment the version value in config.factory.class.php (such that this value will match the value entered in the sql above)<br> it will force the upgrade script to appear and inform developers that there is a change to the database :)<br> <br> I think for the time being we should sideline the authorisation changes as they do work, and concentrate on finishing the css changes that are still on going. Some user testing wouldn't go a miss either.<br> <br> Regards<br> <font color="#888888"> Mark Wrightson</font> <div class="im"><br> <pre cols="72">_____________________________________________ Mob: 07725 695178 Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a></pre> <br> </div> <div> <div class="h5"> On 17/02/2011 21:52, Scott Miller wrote: <blockquote type="cite">Hey Mark,<br> <br> I've actually had time to do some stuff with it today, yesterday ended up being filled with work. <br> <br> Can I propose that we remove the ID column from the new configuration table? I can't see that being useful in the future...<br> <br> -Scott<br> <br> <div class="gmail_quote">On Thu, Feb 17, 2011 at 9:06 AM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div text="#000000" bgcolor="#ffffff"> Ah right ok. It may take a while to rewrite the install script. I need to get a structure on paper first i think.<br> <br> I'll have a think about the excel stuff. One of the feature requests was to output to csv also. <div><br> <pre cols="72">_____________________________________________ Mob: 07725 695178 Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a></pre> <br> </div> <div> <div> On 16/02/2011 16:41, Scott Miller wrote: <blockquote type="cite">Yes, the installer stuff is what I was talking about. If you can clean it up, great, I don't have a good vision for how that would look, so the best I can do is take what we've got and continue to add in our new changes. I should be able to fix bugs in the current system if you can find them, but again, if you can re-write it so that it's not nearly as complicated and works better, I'd say that would be a good thing.<br> <br> As for the excel exporting, there was a really old mechanism that I could never get to work, and someone else had created and submitted a different report with a different mechanism that worked for me, so I just took what worked and applied it to the rest of the reports. The way it works, we would have had a ton of "replicated code" if we attempted to have exporting call a different script than the one that created the report for the screen, and that would have been even worse to maintain. Again, if you have a better way to do it, great.<br> <br> -Scott<br> <br> <div class="gmail_quote">On Wed, Feb 16, 2011 at 4:28 PM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div text="#000000" bgcolor="#ffffff"> Hi Scott, <br> <br> I don't understand what you mean?<br> --- <div><br> "Yes, it took me quite a while to wrap my brain around what all was happening. The same script is called repeatedly for each step of the process, so figuring out how and where to add things was interesting."<br> </div> ---<br> <br> Ohhh - do you mean how the original install script worked was interesting? If that is what you mean then yes i do agree. I'm looking to take inspiration from the old install script and write a new object orientated version. The main grief I had with the old installer was that if you asked it to create the database for you, it sometimes messed things up good n proper and got itself all confused. In the end I went through phpmyadmin, reversed what it had done and setup the database manually through that.<br> <br> Yes completing the transition from the old config to the new config would definitely be good :)<br> Other things that need looking at are going through and just seeing if the timesheet app works because very little has been tested since it was rewritten.<br> Oh also the excel export features on a couple of pages really have been hacked into tsng. the view and export options should be totally separate pages all together to tidy up the code instead of being munged all into one file.<br> <br> Regards <div><br> Mark<br> <br> <pre cols="72">_____________________________________________ Mob: 07725 695178 Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a></pre> <br> </div> <div> <div> On 16/02/2011 16:06, Scott Miller wrote: <blockquote type="cite">Yes, it took me quite a while to wrap my brain around what all was happening. The same script is called repeatedly for each step of the process, so figuring out how and where to add things was interesting.<br> <br> I'll help get that fixed up if you want, but today, I'll attempt to work on taking data from the existing config database and populating our new configuration table with that stuff. And if I get that done, I'll then start working on getting that config stuff loaded with the config classes...<br> <br> Maybe tomorrow I'll do something about the install/upgrade stuff...<br> <br> -Scott<br> <br> <div class="gmail_quote">On Wed, Feb 16, 2011 at 12:49 AM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div text="#000000" bgcolor="#ffffff"> Hi Scott, Ok I will commit everything that I have done.<br> This will then put you in a good position to complete the transfer from the old config table to the new one.<br> <br> I am just adding in some warnings to the install script to say that it isn't complete and how to do a manual update.<br> <br> It is now 00:47 here. :) <div><br> <br> Mark<br> <pre cols="72">_____________________________________________ Mob: 07725 695178 Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a></pre> <br> </div> <div> <div> On 15/02/2011 23:47, Scott Miller wrote: <blockquote type="cite">well, considering it's in the demo branch, I'd say commit it now. Might quickly document that the install script isn't working yet...<br> <br> I'd like to help you, but I'm a bit wary about what part to change as much as you changed within the past day or so :-)<br> <br> -Scott<br> <br> <div class="gmail_quote">On Tue, Feb 15, 2011 at 11:44 PM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div text="#000000" bgcolor="#ffffff"> I think we should skip 1.6 and go straight to 2.0 - a major update requires a major release number. :)<br> <br> Yes, I was the one suggesting removing everything except the string field in the config table.<br> <br> This install script stuff is quite complex, i'm now at the point where the site will automatically detect that the database version is no longer<br> in sync with the codebase version and will start an upgrade process. I've also got the hooks in place to detect a new installation.<br> The new install script won't need to be deleted and it uses the templating system so can use a theme to make it look really smart :)<br> <br> When do you think I should start committing it back up? - it is currently at a stage where it tells the user what needs to happen, just doesn't actually perform the install /upgrade. I think the actual install script bit could take a while to write. I could commit it now, it would just mean that only a manual install would be possible. <div><br> <br> Mark<br> <pre cols="72">_____________________________________________ Mob: 07725 695178 Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a></pre> <br> </div> <div> <div> On 15/02/2011 22:59, Scott Miller wrote: <blockquote type="cite">I think with all the changes we're making with this version, it will be version 1.6 :-)<br> I don't remember if you were the one to suggest removing all but the string variable in the new config table, I'd thought about that myself, so, that's probably a good direction to head.<br> <br> -Scott<br> <br> <div class="gmail_quote">On Tue, Feb 15, 2011 at 5:16 PM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> Hi Scott,<br> <br> I thought I would drop you an email to ask what position you were in regards to updating the config database table?<br> last night in my work to update the installer I had to write a small amount of code along the lines of what you are working on.<br> <br> I made the following additions to config.class.php<br> <br> <br> One new function:<br> <br> public static function getDbConfig(){<br> <br> $q = "SELECT * FROM ".tbl::getNewConfigTable();<br> <br> $data = Site::getDatabase()->sql($q,true, MySQLDB::TYPE_OBJECT);<br> if($data == MySQLDB::SQL_EMPTY || $data == MySQLDB::SQL_ERROR)return;<br> <br> foreach($data as $obj){<br> <br> if($obj->name == 'version'){<br> parent::$databaseVersion = $obj->value;<br> self::runVersionCheck();<br> }<br> <br> //more config variables to be stored into the<br> //config class or config.factory.class<br> <br> <br> }<br> <br> <br> }<br> <br> <br> and in /index.php<br> <br> Config::getDbConfig(); on the line after the database has been instantiated. (self::$database = new MySQLDB();)<br> <br> so:<br> self::$database = new MySQLDB();<br> Config::getDbConfig();<br> <br> I realised that the database stored can't be done when config is initialised as the database hasn't been connected at this point.<br> There is then a reverse dependency that prevents the database from connecting until config has been initialised.<br> <br> Therefore the program flow had to be:<br> 1. init Config<br> 2. init Database<br> 3. get database stored config<br> <br> What I would like to do is align this with the updates you are working on. I have populated my new temporary config table with just ('version','1.5.3')<br> <br> Finally, what country are you based in scott? I'm in the UK.<br> <br> Cheers<br> Mark<br> <font color="#888888"> <br> -- <br> _____________________________________________<br> <br> Mob: 07725 695178<br> Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a><br> <br> </font></blockquote> </div> <br> </blockquote> </div> </div> </div> </blockquote> </div> <br> </blockquote> </div> </div> </div> </blockquote> </div> <br> </blockquote> </div> </div> </div> </blockquote> </div> <br> </blockquote> </div> </div> </div> </blockquote> </div> <br> </blockquote> </div> </div> </div> </blockquote> </div> <br> </blockquote> </body> </html> |