LxCenter HyperVM & Kloxo Support

Forum



Members   Search      Help    Register    Login    Home
Home » LxCenter » Contributed HOWTOs » Updating InstallApp apps(Because contributing is SEXY :D)
Updating InstallApp apps [message #80804] Sat, 12 March 2011 14:48
semir is currently offline semir  Hungary
Messages: 976
Registered: January 2011
Location: Hungary
Senior Master
Forum Moderator
LxCenter Evangelist
I started updating the apps in a top to bottom order according the list. I got to beehive yesterday (for which I ruined my all system as it would need mysql 5.1 or later. That is NOT a good idea to try to install...).

I also try to filter the dead projects, I opened a thread in this category for them. If we once manage to update the currents, they should be replaced by living projects.

What you can do is to pick some apps and try to update them. By now I can give you some help. Please PM me which app you start working on, then I can do the coordinating.

Everything starts with picking an app, looking up it's latest version, decide if it is dead or not. If not, download the newest sources (I only do if there is a major version step like 1.2.4 -> 1.3.x, and not if 1.2.4 and 1.2.44....).

Go to /home/kloxo/httpd/installapp, backup the original app.
Recreate the directory, untar the downloaded new app.
Copy the __kloxo dir from the old (backup) dir to the new.
Walk through the files in __kloxo.

The lxinstaller.inc file:
This is the file that controls the installapp install process.
After initialization it tells installapp what to do.

There is a trivial rewrite that must be done: if you find line:
appvault_dbfilter("__path_installsoft_servervar", "__kloxo/lx_servervars.php", $var);

Than replace "__path_installsoft_servervar" (with quotes) to: $sgbl->__path_installapp_servervar (no quotes).

The function apvault_dbfilter (described below) is used to rewrite the template files.


The template files:
The main idea behind installapp is to pass the $_POST, $_SERVER, $_GET (..etc..) arrays to the application being installed, after doing rewrites on them by kloxo/installapp.

Any file can be a template file but it seems using lx_template.myfile.php is conventional.


Function appvault_dbfilter:
Makes rewrites on a file (first argument) and outputs it to file given by the second argument. Some rewrite data comes from the third argument, which is an array.

The following words will be rewritten (case sensitive):

__lx_full_url
__lx_full_installdir
__lx_full_script_path
__lx_document_root
__lx_installdir
__lx_relative_script_path
__lx_title
__lx_admin_email
__lx_admin_company
__lx_real_name
__lx_install_flag
__lx_admin_name
__lx_submit_value
__lx_client_path
__lx_adminemail_login
__lx_admin_pass
__lx_md5_adminpass
__lx_db_host
__lx_db_name
__lx_db_pass
__lx_db_user
__lx_db_type
__lx_url
__lx_domain_name
__lx_action

Also I plan to implement a function that will rewrite user defined keys in template files.


The method:

Find the installer of the app.

Find a line in lxinstall.inc that starts index.php or install.php or anything alike:

execinstallappPhp($var['domain'], $var['appname'], "php install.php");

This tells you which file was used in the current version.

If the installer script is in a directory, you'll find (or have to put a) line that changes work directory there, like this:

chdir("install");

Edit the installer script and add a line that includes the to-be-rewritten template file. (Most cases add this line:)
include_once "lx_myfile.php" ;

Be careful as it uses relative path!

So if the installer script resides in directory 'install', the scenario is the following (only snippet):

[....]
  chdir("install");
  appvault_dbfilter("../__kloxo/lx_template.myfile.php", "../__kloxo/lx_myfile.php", $var);
   execinstallappPhp($var['domain'], $var['appname'], "php install.php");
[....]


Edit the old and new install file and judge if it changed much or not. If not too much, you are lucky and likely to finish quickly.

I have a domain for testing.

To reinstall quickly, just cd into the domain public_html directory. Remove the installed directory and clear the directory that starts with __ and has pages that you'd have seen under install. (Quite bit of interesting information, you'll see.) Ofc, remove the databases once in a while.

  # rm -Rf updatedappname && rm -f __installapplog/*


Some installer spans through multiple submits/pages. Then you'll have to modify the $_POST variable according and have the rewerite done. __lx_action is a joker variable that is replaced in the template file with anything you specify by $var['action'] (if I remember well). Worst case if the several files must be started separately, or you need many template files.

In some cases the installer can be left out if you know that only some config files are done by it. Then you are able to write only some template files from which you can generate the needed files.



The bad part is, the tutorial is ready... Most things must be experienced by the eager updater.
Dont forget: "Use the source, Luke!"

Always awaiting your sincere help:
Semir


ProfiVPS.com Cheap VPS hosting! Buy it from me Smile
ProfiVPS.hu Megbízható, Olcsó VPS bérlés, Virtuális szerver bérlés

If I helped you, please consider putting my link on your site/blog! Thank you in advance Smile
Previous Topic:Alp/kloxo tweak
Next Topic:TLS PureFTPd
Goto Forum:
  


Current Time: Thu May 23 21:10:46 EDT 2013

Total time taken to generate the page: 0.00996 seconds
.:: Contact :: Home :: Privacy ::.

Click here to lend your support to: LxCenter and make a donation at www.pledgie.com !

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software