Results 1 to 2 of 2

Using config_vbseo.php in different environments - HOWTO?

This is a discussion on Using config_vbseo.php in different environments - HOWTO? within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi, I have two vbulletin+ vbseo environments at the moment: Test environment: http://somedomain.dev/board This is a URL on my local ...

  1. #1
    Junior Member
    Real Name
    Eliot
    Join Date
    Mar 2007
    Posts
    19
    Liked
    0 times

    Using config_vbseo.php in different environments - HOWTO?

    Hi,

    I have two vbulletin+vbseo environments at the moment:

    Test environment:
    http://somedomain.dev/board
    This is a URL on my local server

    Production environment:
    http://somedomain.com/board

    My problem is the config_vbseo.php file is slightly different for the two environments.

    What can I do so I can use the same config_vbseo.php file for both environments? Token replacement and having two different copies of the file is not an option.

    My thoughts so far:
    1) In config_vbseo.php, have a block that detects the current environment and sets the config as required for that environment, in psuedo code:

    if (environment == test-env) {
    set license key to correct value
    set custom doc root to correct value
    } else if (environment == prod-env) {
    set license key to correct value
    set custom doc root to correct value
    }


    Or 2)
    In config_vbseo.php there is a property to save settings to db. (see copied code below). Could the license key and custom doc root be stored in the db

    // ****** SAVE/RESTORE SETTINGS TO DB ******
    // Set this variable to 1 to save (and restore) your settings from vB's (datastore) dB table
    define('VBSEO_CONFIG_INIT', '0');

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,742
    Liked
    168 times
    1) In config_vbseo.php, have a block that detects the current environment and sets the config as required for that environment, in psuedo code:
    Yes, you can try it with:
    PHP Code:
    if($_SERVER['HTTP_HOST']=='subdomain.dev')
    {
        
    define('VBSEO_LICENSE_CODE',            'xxx1');
        
    define('VBSEO_CUSTOM_TOPREL',          'zzz1');
    }else
    {
        
    define('VBSEO_LICENSE_CODE',            'xxx2');
        
    define('VBSEO_CUSTOM_TOPREL',          'zzz2');

    In config_vbseo.php there is a property to save settings to db. (see copied code below). Could the license key and custom doc root be stored in the db
    The settings are stored in database as backup and only used when restoring the options during vBSEO upgrade (when fresh config_vbseo.php file is uploaded).

Similar Threads

  1. Howto prevent crawling of Private Forums
    By deb0 in forum Troubleshooting
    Replies: 2
    Last Post: 03-02-2007, 11:10 PM
  2. Sitemap HowTo?
    By sixtyseven in forum Deutsch
    Replies: 14
    Last Post: 03-25-2006, 07:24 AM
  3. Howto review MySQL queries used in scripts.
    By xb_ in forum General Discussion
    Replies: 2
    Last Post: 09-16-2005, 11:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •