🛠️ Project Setup Guidelines

1. Clone the Repository from GitHub twise

git clone https://github.com/Mylokal/mylokal.git Mylokal-A
git clone https://github.com/Mylokal/mylokal.git Services-A
  • This will create two directories:
    • Mylokal-A
    • Services-A

2. Checkout Required Branches

cd Mylokal-A
git checkout 7mylokal-a

cd ../Services-A
git checkout 7webservices-a

3. Update Config in Mylokal-A

  • Open: Mylokal-A/protected/config/params-local.php

  • Update the serviceUrl value:

    • 'serviceUrl' => 'http://localhost/Services-A/'

alt text alt text alt text

4. Update Database config for both projects

  • Need to update host, user name and password: host will be db and user name and password will be root
  • Services-A/common/config/main-local.php with the following:
'db' => [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=db;dbname=Mylokal120818',
    'username' => 'root',
    'password' => 'root',
    'charset' => 'utf8',
],
  • Mylokal-A/protected/config/db.php with the following:
    return array(
      'connectionString' => 'mysql:host=db;dbname=Mylokal120818',
      'emulatePrepare' => true,
      'username' => 'root',
      'password' => 'root',
      'charset' => 'utf8',
      'tablePrefix' => 'ML_',
    );

4.1 Build & start the containers

Follow the Docker build & start guide for the most up-to-date commands. The quick summary (mirrors the Docker doc) is:

  1. Place the latest SQL seed file inside docker/mysql/init/ (ping Rakesh if you need the copy referenced in the Docker doc).
  2. Run docker compose build (or docker-compose build if you’re on the legacy CLI).
  3. Run docker compose up -d to start the stack.
  4. Wait for the initial MySQL import (10–20 minutes) before logging in.
  5. Access the app at http://localhost and phpMyAdmin at http://localhost:8081.

5. Update Database table ML_Source_URLs

  • Find the table ML_Source_URLs
  • Update row 9 for Mylokal-A
    • Set MLS_Source_URL to localhost/Mylokal-A
    • Set MLS_Home_Page to NULL

6. Debug & Update getLatLong Function

File: Services-A/common/models/Webservices.php

  • Temporarily print the server IP:
var_dump($ipAddress); exit;
// or
echo $ipAddress; exit;
// or
print_r($ipAddress); exit;
  • Open the browser → check Network tab → page-header response.

  • Copy the printed IP Address.

  • Replace the placeholder inside getLatLong (as shown in screenshot below). alt text

  • Finally, remove the debug code and refresh the page.


7. SQL Mode

  • Normally you would update via phpMyAdmin.

  • Not required here since it’s already set in docker/mysql/my.cnf.


8. Database Fix for Themes

  • If using an old database:
    • Delete the ML_Site_Themes table.
    • Import the latest ML_Site_Themes.

9. Generate CSS

  • Hit the URL in your browser:
http://localhost/Services-A/webservices/web/sitethemes/generate-css

10. Import Routines SQL File for completing the project setup process.

  • The routines SQL file will be provided separately—request the latest copy from Rakesh before running the import scripts.

  • Import the provided SQL file:

Mylokal120818 routines.sql
  • If you imported an older SQL dump and the platform behaves unexpectedly, verify that the ML_Platform_Settings table contains the Copy_Max_Content_Chars row. If it is missing, insert it with:

    • MPS_Setting_Name = Copy_Max_Content_Chars
    • MPS_Setting_Value = 100
    • MPS_Setting_Description = [Varun] max number of characters that can be copied through cut and paste
  • Re-run your sanity checks after adding the setting to confirm the issue is resolved.


Use / to focus search. Press Enter to run. Esc clears.