Get Involved m2f
connecting communities
m2f @ SourceForge.net  

v2.0 Installation

Our goal is to make m2f 2.0 installation as easy as possible. Right now (02-2009) the code is alpha-quality and as such we have been working more on the code under the hood and the install process is not THAT easy at the moment.

There are three steps involved in m2f 2.0 alpha-builds installation:

  1. Copying the files to your web server.
  2. Configuring and running the test suite to check that everything is working as it should.
  3. Only if all tests pass, start building some message chains to test the actual functionality.

Requirements

Please see the wiki entry for an up-to-date list of m2f v2.0 technical requirements.

Install

We use a Sourceforge SVN repository for all the code.

As the code is written using Unit Tests, commits to the repository are only allowed when all the tests pass. This means that a checkout from the repository will generally result in a stable snapshot at any moment in time. Instructions for accessing the repository can be found on the Sourceforge Site. The repository root has a number of directories, each with code from a different vendor. These are the 3rd-party libraries I am currently using in m2f. The m2f code itself can be found in /m2f/trunk.

To install, run a SVN checkout on a directory on your web server (As of m2f 2.0 you don’t m2f does not need to reside inside phpBB installations, as it supports several other channels as well). For sake of simplicity, we’ll assume you install it in a directory named “m2f” in the root level of your webserver. SVN checkout can be done via command:

svn co https://m2f.svn.sourceforge.net/svnroot/m2f/m2f/trunk m2f

This will download not only the m2f code, but all the required 3rd-party libraries, which will be added automatically into the /includes directory (using the magic of svn:externals). You must also enable write access for the webserver to the following directories:

m2f/config
m2f/cache
m2f/db
m2f/records
m2f/tests/db
m2f/tests/files

Test suite

The Alpha/Beta release of m2f 2.0 can not be said to be installed correctly until all the tests in the Test Suite pass. To get all the tests to pass, a few things need to be configured on the server:

  • Install phpBB2 and phpBB3 as normal on your server. These are both for testing only - in the process of testing m2f, ALL your posts will be deleted from phpBB. So please don’t use these installations for anything else!
  • Disable Flood Interval for phpBB 2 and 3 (set to 0 seconds). For phpBB 2 it’s in General Configuration, For phpBB 3 it is at General > Board Configuration > Post Settings
  • Both phpBB installations will create a default forum. These need write permissions for guests. This is important!
    • For phpBB 2 you have to set that up in Forum Admin->Permissions and set up the forum as “Public”.
    • For phpBB 3 go to Permissions top tab -> forum permissions -> select the forum -> check “Select anonymous user” then press “Add Permissions”, select “Standard Access” role, then press “Apply all permissions”.
    • Be sure to try to make a post with the guest user, then delete it in order to test the configuration.
  • Edit phpBB2 includes/functions_post.php, and do these replacements (to fix some bugs in the original phpBB 2 code!):
    replace:
    include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
    with:
    include_once($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
     
    and replace:
    include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
    with:
    include_once($phpbb_root_path . 'includes/functions_search.'.$phpEx);
  • Open [phpBB2 root]/posting.php, and around line 600 find:
     $template->assign_vars(array(
    'META' => $return_meta)
    );

    before that, insert:

    /* Start m2f */
     
    require_once 'm2f.php'; /* Install note: This file does not exist yet! We'll upload it here later in the installation process */
     
    /* End m2f */
  • Open [phpBB3 root]/posting.php, and around line 1002 find:
    $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);

    after that, insert:

     /* Start m2f */
     
    require_once 'm2f.php'; /* Install note: This file does not exist yet! We'll upload it here later in the installation process */
     
    /* End m2f */
  • Copy m2f/tests/config.php.dist to m2f/tests/config.php, and edit the file for your setup. This is configuration for the Test Suite only. You need to edit fields for the URL to your test server (can be localhost), the database connection details for testing (I would strongly recommend an sqlite database located in the m2f/tests/files directory, which already has write permissions - it will be created automatically), and the details for your test installations of phpBB2 and phpBB3, which should be on the same server.
  • Visit /m2f/ in the browser, this will get you to the m2f Admin CP. Click on Install tab. We recommend using SQLite for the database engine. Press Test Connection using the default settings, and if everything is OK, go ahead and press Write database tables.
  • We must now configure the connection between m2f and the two phpBB installations.
    • Click on Remote Hosts, and then click on create a new remote host
    • Now choose the external application you want to configure. As of milestone 1, only phpBB2 and phpBB3 are available.
    • For the URL of the host, put the full web path to the m2f.php file you set up on phpBB2. For example http://localhost/phpBB2/m2f.php.
    • For the URL of m2f main installation, m2f will provide what should be a proper value for this setting. Otherwise, put the full web path to the admin cp + “run.php”. For example http://localhost/m2f/run.php
    • For the Secret, you must currently use the hardwired phrase: “my little secret!“. (This is only hardwired for the test suite; after the tests you may use any secret you like! See issue 135 on the tracker).
    • Press the submit button Configure file
    • Download the m2f.php file that the Admin Cp just generated for you, and put it in the root folder of your phpBB installation. For example /[WEB_PATH]/phpBB2/m2f.php
    • Now do exactly the same thing with phpBB3!  Remember to choose phpBB3 as external application on the first select box. Close and save both m2f.php files

Lastly, visit /m2f/test-suite in your browser and run the m2f tests. In simple terms, there is no point proceeding with your m2f work until ALL the tests pass! Any errors should be reported as a bug on the issue tracker. If all you see is a blissful screen filled with green (passed) tests, then you can try building some chains.

If you are having difficulty installing and testing, check out George’s Demonstration Videos blog post.

Share this post:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Slashdot