Obi Version 2.0
Obi is a project management tool that simplifies WordPress development.
THIS VERSION HAS BEEN DEPRECATED
See HERE for the updated version
If you haven’t already, create a folder named “bin” and a file named “.bash_profile” with the following text on it
export PATH=$HOME/bin/obi:$PATH, and place them separately in your home directory root folder.
Next, you’ll need to find out which PHP and MySQL your system is using. This can be done with the terminal command
which. To do this first run
which phpfrom the terminal. If you are presented with a path ending with php, then the location your systems PHP is available to Obi and you are good to go. Now run
which mysqlfrom the terminal. If you are presented with a path ending with mysql, then the location your systems MySQL is available to Obi and you can move on to step 3.
If either command,
which mysqldo not yield a path then you will need to install or locate which ever one that didn’t show up. After you have verified that PHP and MySQL are both running on your system, you can run the
whichcommand again. If you have verified that either of the two are correctly installed and the
whichcommand still won’t yield a path then you will need to add the unyielded location for the corresponding service to your “.bash_profile” like shown below replacing the placeholder path with your system’s path.
export PATH=/path/to/your/systems/php/folder:$PATH export PATH=/path/to/your/systems/mysql/folder:$PATH
<p> If you are running <strong>MAMP PRO</strong> your PHP will be located at <code>/Applications/MAMP/bin/PHP/[mampphpversion]/bin</code> (where you would replace [mampphpversion] with the version of PHP MAMP PRO is running) and MySQL will be located at <code>/Applications/MAMP/Library/bin</code>.<br /> So say your <strong>MAMP PRO</strong> is running PHP version 5.4.4, you would need to add the lines below to your “.bash_profile” below the line in step one. </p> <pre class="notranslate"><code> export PATH=/Applications/MAMP/bin/PHP/php5.4.4/bin:$PATH
To ensure that the changes to your “.bash_profile” are available, run the following command.
Assuming you already have Git installed run this command from your terminal:
cd $HOME/bin/ ; git clone https://github.com/micalexander/obi.git
And then run:
Enter your setting and you’re ready to go.
config: configure obi
help: prints usage to the terminal
mysql: login mysql database (Followed by the
kill: Remove a working directory completely (Followed by the
-e: Create an empty working directory (Followed by the
-g: Create a git repository working directory (Followed by the
-w: Create a WordPress enabled git working directory (Followed by the
-b: Backup mysql database (Followed by the
[project_name] and then the
[project_name] : Name of the directory that contains your project.
-lts: local to staging
-ltp: local to production
-stl: staging to local
-stp: staging to production
-ptl: production to local
-pts: production to staging
When the command
obi… is ran for the first time, a single hidden file is generated in your home directory with the name .obiconfig. Please do not edit this file directly. This file is used by obi to store the path to your local projects directory that contains all of your projects along with your multiple environment settings.
To edit this file simply run the command
The default settings are as follows:
localprojectdirectory='0' localsettings="enabled" localhost="localhost" localuser="root" localpassword='root' stagingsettings="disabled" stagingdomain='0' staginghost="0" staginguser="0" stagingpassword='0' productionsettings="disabled" productiondomain='0' productionhost="0" productionuser="0" productionpassword='0'
By default when this file is created the
localprojectdirectory variable is not set (set to 0) and before obi can be used, it needs to be set to your local projects directory as a direct path without the trailing slash. The
localsettings by default are set to enabled and the
productionsetttings to disabled.
productionsetttings control how obi will access your MySQL credentials. The three possible settings are:
enabled wp-enabled disabled
enabled: obi will use the credentials that are set below it.
wp-enabled: obi will use the credentials that are on the wp-config.PHP file.
disabled: obi will not use any credentials
Project specific config
Obi has some features that require a project specific config file to be configured correctly in order to make use of them. The features that rely on this config file are listed below along with their uses.
SSH - used for rsync and to import/dump...