Install your existing keychains on new mac (there are some files you can just copy, but i can't remember which so maybe give this a go): http://osxdaily.com/2012/07/05/copy-keychain-login-passwords-between-macs/
- turn on Remote Login from Sharing in System Preferences
- Run
ssh localhost
, the ctrl+c to cancel (cheap way to create the .ssh directory in home dir) - Copy private key into .ssh dir and call it id_rsa (make sure perms are 600 or similar)
- Test by trying to login to somewhere you know is setup with your public key (should allow you to store your password in keychain)
- http://www.iterm2.com/
- type
java
on command line (to install java) - http://dev.mysql.com/downloads/mysql/ (install ALL in .dmg - main binary, startup items and the plist thing)
- restart - just trust me, it's easier this way
- http://www.sequelpro.com/download/
- If you have many bookmarks in existing sequel pro, copy
~/Library/Preferences/com.google.code.sequel-pro.plist
to new machine if desired (doesn't copy passwords) - http://nodejs.org/#download
- http://git-scm.com/download/mac
- Once java installed: http://netbeans.org/downloads/index.html (Export and copy setting from previous machine if required)
- Once node installed:
sudo npm -g install stylus bbb
- behat via https://tmwiki.tagman.com/index.php/PHP_Development_Platform#Behat
- Download casperjs and phantomjs and install casper to:
/usr/local/bin/casperjs
- Make sure phantomjs is in the apache users path (might have to do this: http://stackoverflow.com/questions/6833939/path-environment-variable-for-apache2-on-mac)
MAKE SURE YOU DON'T HAVE ANYTHING YOU WANT TO KEEP IN YOUR .bash_profile FIRST
echo "source ~/.bashrc" > .bash_profile
vi ~/.bashrc
Insert the following into .bashrc:
alias ll="ls -laht"
export EDITOR=vi
export PATH=$PATH:/usr/local/mysql/bin
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PS1="$RED\$(date +%H:%M) \w$YELLOW \$(parse_git_branch)$GREEN\$ "
Then run . ~/.bashrc
('.' does same job as 'source')
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
prevents it from attempting to push all when push is run (only pushes current branch):
git config --global push.default upstream
sets terminal to color output like with git status:
git config --global color.ui true
clone whatever. e.g.
git clone [email protected]:TagManCode/php-api api
sudo vi /etc/apache2/httpd.conf
enable the following following lines:
Include /private/etc/apache2/extra/httpd-vhosts.conf
SetEnv APPLICATION_ENV 'local'
LoadModule php5_module libexec/apache2/libphp5.so
Run the following in terminal
sudo php /usr/lib/php/install-pear-nozlib.phar
pear config-set php_ini /private/etc/php.ini
pecl config-set php_ini /private/etc/php.ini
sudo pear upgrade-all
sudo pear channel-discover pear.phing.info
sudo pear install phing/phing
sudo pear install --force VersionControl_SVN
sudo pear install --force VersionControl_Git
sudo pear install --force pear/Structures_DataGrid#datasources
sudo pear install --force pear/Structures_DataGrid#renderers
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear install --alldeps pear.phpunit.de/PHPUnit
sudo pear install --alldeps phpunit/PHPUnit_Selenium
sudo pear channel-discover zend.googlecode.com/svn
sudo pear install --alldeps zend/zend
##PHP INI
sudo cp /etc/php.ini.default /etc/php.ini
sudo vi /etc/php.ini
add to the end of the file:
memory_limit = 256M
detect_unicode = Off
display_errors = On
display_startup_errors = On
html_errors = On
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
date.timezone = "Europe/London"
pdo_mysql.default_socket=/tmp/mysql.sock
xdebug.idekey="macgdbp"
xdebug.file_link_format="txmt://open?url=file://%f&line=%1"
xdebug.remote_enable = 1
xdebug.var_display_max_children = 1024
xdebug.var_display_max_data = 10000
xdebug.var_display_max_depth = 112
xdebug.cli_color = 1
include_path=".:/usr/lib/php/pear"
#API vhost: sudo vi /private/etc/apache2/extra/httpd-vhosts.conf And add (replacing [path to public root]):
<VirtualHost *:80>
DocumentRoot "[path to public root]"
ServerName api.localhost
SetEnv APPLICATION_ENV "local"
<Directory [path to public root]>
# Disable .htaccess files
AllowOverride None
# FollowSymLinks option required for rewrite rules to work
Options FollowSymLinks
# Enable access from everywhere by default
Allow from all
# Standard Zend Framework rewrite rules
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</Directory>
</VirtualHost>
sudo vi /etc/hosts
add:
127.0.0.1 api.localhost
##TagMan api specific:
mkdir ~/Sites/api/logs; chmod -R 777 ~/Sites/api/logs
sudo apachectl restart
Now create database and users for the databases for the apps
This will create db for you if you have your test db set to same as your application db (see your phing properties file and module ini files):
phing -f build/build.xml -Dbuild=[your profile matching the properties file in build directory] generate_test_db