Based on the usage case specified in this bugs description, I will
manually override the database configuration item of the default site
URL via 'config.php'.
Note: You are expected to know the locations of installed Aiki files
based on the configuration options you specify. If you are unsure, be
sure to read the output from the 'sudo make install' command which will
include where the installed files are.
Modifying the DOMAIN, AIKI_REWRITE_BASE or AIKI_SITE_URL requires
manually changing supplemental Apache configuration files other than
'config.php'. If the config item you want to change or add to the
'config.php' has a related constant value in 'aiki-defs.php', you must
use/change that value defined in 'aiki-defs.php' and make reference to
that constant from within 'config.php'. For example, in 'aiki-defs.php'
exists define("AIKI_SITE_URL","http://localhost/aiki/");. So, in
'config.php' you would put $config["url"] = AIKI_SITE_URL;
I will briefly list the steps I used to test this:
1. Install Aiki specifying a DOMAIN, AIKI_SITE_URL and AIKI_REWRITE_BASE
that you would normally use. In my case, I do not specify these and just
accept the default values during configuration.
2. Log in to the Aiki admin interface. In the upper left next to
'Structure', click on the 'System' link. In the left panel from the tree
select, click on 'global_settings'. Make a note of the 'url' value now
displayed in the 'global_settings' form as this should be the
AIKI_SITE_URL you specified during configuration. Log out of the admin
interface.
3. Change the value of the 'define' statement for AIKI_SITE_URL of the
installed file: aiki-defs.php. For example, change from
define("AIKI_SITE_URL", "http://localhost/aiki/"); to
define("AIKI_SITE_URL", "http://localhost/aiki_test/");.
4. Change the value of the 'define' statement for AIKI_REWRITE_BASE of
the installed file: aiki-defs.php. For example, change from
define("AIKI_REWRITE_BASE", "/aiki"); to define("AIKI_REWRITE_BASE",
"/aiki_test");.
5. Change the value of the 'Alias' statement of the installed file:
z-aiki.conf. For example, change from Alias /aiki /usr/share/aiki to
Alias /aiki_test /usr/share/aiki .
6. Change the value of the 'RewriteBase' statement of the installed
file: z-aiki.conf. For example, change from RewriteBase /aiki/ to
RewriteBase /aiki_test/ .
7. This step is NOT necessary for most development installations. Only
if you installed the .htaccess file manually or via the run-time/web-
page installer, change the value of the 'RewriteBase' statement of the
installed file: .htaccess. For example, change from RewriteBase /aiki/
to RewriteBase /aiki_test/ .
8. Restart your Apache web server and repeat step 2 as stated above. You
should note that the 'global_settings' form is displaying the values
stored in the database. The 'global_settings' URL in this example is
still http://localhost/aiki/ where the URL in the browser's address bar
reads http://localhost/aiki_test/admin. This indicates that the
configuration from the 'config.php' is overriding the values stored in
the database. To go back to using the database values, you must revert
all the changes made above to the original and remove or comment out the
particular configuration item in 'config.php'. For example, change
$config["url"] = AIKI_SITE_URL; to //$config["url"] = AIKI_SITE_URL;.
Basically any configuration item that is specified with an array key
($config["keyname"]=value;) in 'config.php', will override the matching
key stored in the database table 'aiki_config'.
--
You received this bug notification because you are a member of Aiki
Framework Admins, which is subscribed to aikiframework.
https://bugs.launchpad.net/bugs/775868
Title:
config.php options should override database options
Status in Aiki Framework:
Fix Committed
Bug description:
Ok, this is super critical for openfontlibrary and all aiki sites. The
options, and all aiki options should be configurable via config.php,
should override the database options.
The reason for this is so that we have a fallback, and that we can
programmatically rsync to test and staging sites and change the site
urls and more from php files.
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework.admins
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework.admins
More help : https://help.launchpad.net/ListHelp