Skip to content
danielgolub edited this page Nov 28, 2014 · 3 revisions

Tips for using Codengine

  1. To clone the project quickly you can add the following line to your .bash_profile file:

    sudo nano ~/.bash_profile

    And add:

    alias codengine="git clone https://github.com/danielgolub/Codengine.git";

    Now you can just use the command 'codengine' to clone the latest version. You can also use codengine folderName to clone inside a different folder than 'codengine'.

  2. To use MongoDB with Codengine, disable the database class in your app/config.php (line 15 - enabled => false) and add the following lines to your /app/start.php file below line 42 (which starts with $API = new..):

     $mongo = new MongoClient("mongodb://someuser:password@123.123.123.123:29715/admin");
     $DB = $mongo->selectDB("admin");
    

    Now you can just fire up the mongo functions in every controller through $this->db (for example - $this->db->users->find())

  3. When using the Database base class, in order to encode characters with utf8, please add the following line after line 53 in /index.php:

      $registry->get("db")->set_encoding('utf8');
    
Clone this wiki locally