ENVIRONMENT

AMP

  • Win: @todo
  • Mac: https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

GIT

  1. Install https://git-scm.com/downloads
  2. Generate private key
    1. Win
      1. puttygen generate ppk with pass -> mykey.ppk
      2. puttygen save public key -> mykey.pub
      3. edit mykey.pub and make it one line like this:
        ssh-rsa rgjbh432l5jh43telfjlwqkjherl34kjhtlkj54ht56lkj43rmfgn5klj56hlk36jh4lj4h6ktljhkl64jlkjfnlnlkj45ngkl3nlghj45lcjgmc342rkl2tjl45jhjkt54
    2. Mac / Linux
      1. mkdir ~/.ssh
      2. chmod 600 ~/.ssh
      3. generate mykey & mykey.pub into ~/.ssh :
        https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
  3. git server: cat mykey.pub >> /home/git/.ssh/authorized_keys
  4. Add private key to startup
    1. Win: run shell:startup create shortcut to mykey.ppk here – it will open with pageant
    2. Mac: echo “ssh-add -A 2>/dev/null;” >> ~/.bash_profile
  5. Win: environment var GIT_SSH = path\to\plink.exe (putty folder or winscp folder) – this enables PHPStorm to use pageant loaded key.
  6. term: git clone ssh://git@192.168.1.24:/git/cfo.git max-ba
  7. copy the following (non-git) from another installation and adjust to local env:
    /common/config/*-local.php
    /console/config/*-local.php
    /backend/config/*-local.php
    /backend/web/index*.php
    /frontend/config/*-local.php
    /frontend/web/index*.php

PHPSTORM – install

  1. settings – Git:
    1. Path to Git executable
    2. SSH executable: Native

Composer

  1. install
    1. Win> download etc
    2. Mac> brew install composer
  2. composer global require “fxp/composer-asset-plugin:^1.2.0” (atentie la ghilimele)
  3. /www/max-ba/site> [sudo] composer update
    github token: 4b806c3a795bd3baa5b9d29f113957a88d66b915

Special environments

Production (app.max-ba.ro):
/frontend/web/index.php
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, FALSE);
defined(‘YII_ENV’) or define(‘YII_ENV’, ‘prod‘);

Staging (appstaging.max-ba.ro):
/frontend/web/index.php
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, FALSE);
defined(‘YII_ENV’) or define(‘YII_ENV’, ‘prod‘);

It must be FALSE & ‘prod’ (like production env) in order to catch bugs which happen only when it’s ‘prod’ (e.g. assets minify problems).

About

Das Yii Man

Leave a Reply

Your email address will not be published. Required fields are marked *

[TOP]