Answers.Body: <p>It appears that <code>civix</code> is ignoring or overwriting additions to or modifications of the <code>include_path</code>. I added the full path name <code>/Applications/MAMP/htdocs/xxx/civcrm/‌​wp-content/plug‌​ins/civicrm/‌​civicrm</code> (where <code>api</code> resides) to <code>include_path</code> in the <code>php.ini</code> (checked I got the right one with <code>php --ini</code>). That didn't work. </p>
  
  <p>But I got it to work by soft linking the <code>api</code> directory into the new extension directory, i.e. changed directory to the extension directory and did the following command: <code>$ ln -s /Applications/MAMP/htdocs/xxx/civcrm/‌​wp-content/plug‌​ins/civicrm/‌​civicrm/api .</code>  </p>
  
  <p>It's not an ideal solution but it enabled meet move forward.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-20T06:53:56.943Z
Answers.LastActivityDate: 2016-08-20T06:53:56.943Z
Answers.UserDisplayName: Peter Evans
Body: <p>I created an extension module with <code>civix</code> then cd'd to the module directory and tried to create a custom report based on a copy of an existing report. I used the following command:</p>
  
  <pre><code>$ civix generate:report --copy CRM_Report_Form_Case_Summary DemandCaseReport CiviCase
  </code></pre>
  
  <p>This generates an error message that I haven't yet been able to fix.</p>
  
  <pre><code>Initialize report CRM_Case_Form_Report_DemandCaseReport
  
  
  [RuntimeException]                                      
  Booted CiviCRM, but failed to find 'api/class.api.php'  
  
  
  generate:report [--webPath [WEBPATH]] [--copy [COPY]] [--] &lt;&lt;ClassName&gt;&gt; &lt;&lt;CiviComponent&gt;&gt;
  </code></pre>
  
  <p>I'm using civix version v16.03.2-3-geeff5c0. It's a WordPress installation.</p>
  
  <p>I can see that a file with that name resides in <code>/wp-content/plugins/civicrm/civicrm/api/class.api.php</code> </p>
  
  <p>Is there an environment variable that I should be setting or something else that I'm overlooking?</p>
  
  <p>Grateful for any tips, thanks.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-09T08:40:17.370Z
Comments.Text: which version of civicrm and wordpress are you using ?
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-09T11:34:33.680Z
Comments.Text: WP 4.3 civicrm 4.5.8
Comments.UserDisplayName: Peter Evans
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-09T11:37:07.213Z
Comments.Text: I did manage to create same report against Civi 4.6.10 and everything went alright with just one warning - is their anyway you can test the same against 4.6.10
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-11T21:24:23.693Z
Comments.Text: I upgraded to 4.6.20 but I'm afraid I got exactly the same error. :(
  BTW I'm using WP 4.5.3, not 4.3. Sorry about that.
Comments.UserDisplayName: Peter Evans
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-12T09:34:05.890Z
Comments.Text: It appears that civix is ignoring or overwriting my modifications of the `include_path`. I added the full path name  `/Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm` (where `api` resides) to `include_path` in the `php.ini` (checked I got the right one with `php --ini`).  That didn't work.
  
  But I got it to work by soft linking the api directory into the extension directory (changed directory to the extension directory and did the following command:
  
  `$ ln -s /Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm/api .`
Comments.UserDisplayName: Peter Evans
Tags: <civireport><custom-reports><civix>
Title: Runtime Exception Booted CiviCRM, but failed to find 'api/class.api.php'
ThreadText: # Runtime Exception Booted CiviCRM, but failed to find 'api/class.api.php'
  
  (Asked by: username_0 on 2016-08-08)
  
  I created an extension module with `civix` then cd'd to the module directory and tried to create a custom report based on a copy of an existing report. I used the following command:
  
  ```
  $ civix generate:report --copy CRM_Report_Form_Case_Summary DemandCaseReport CiviCase
  
  ```
  
  This generates an error message that I haven't yet been able to fix.
  
  ```
  Initialize report CRM_Case_Form_Report_DemandCaseReport
  
  [RuntimeException]                                      
  Booted CiviCRM, but failed to find 'api/class.api.php'  
  
  generate:report [--webPath [WEBPATH]] [--copy [COPY]] [--] <<ClassName>> <<CiviComponent>>
  
  ```
  
  I'm using civix version v16.03.2-3-geeff5c0. It's a WordPress installation.
  
  I can see that a file with that name resides in `/wp-content/plugins/civicrm/civicrm/api/class.api.php`
  
  Is there an environment variable that I should be setting or something else that I'm overlooking?
  
  Grateful for any tips, thanks.
  
  **Tags:** civireport, custom-reports, civix
  
  > **Comments:**
  > **username_1**: which version of civicrm and wordpress are you using ?  
  > **username_0**: WP 4.3 civicrm 4.5.8  
  > **username_1**: I did manage to create same report against Civi 4.6.10 and everything went alright with just one warning - is their anyway you can test the same against 4.6.10  
  > **username_0**: I upgraded to 4.6.20 but I'm afraid I got exactly the same error. :( BTW I'm using WP 4.5.3, not 4.3. Sorry about that.  
  > **username_0**: It appears that civix is ignoring or overwriting my modifications of the `include_path`. I added the full path name  `/Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm` (where `api` resides) to `include_path` in the `php.ini` (checked I got the right one with `php --ini`).  That didn't work.  But I got it to work by soft linking the api directory into the extension directory (changed directory to the extension directory and did the following command:  `$ ln -s /Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm/api .`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-08-20. Score: 0 | Accepted answer
  
  It appears that `civix` is ignoring or overwriting additions to or modifications of the `include_path`. I added the full path name `/Applications/MAMP/htdocs/xxx/civcrm/‌​wp-content/plug‌​ins/civicrm/‌​civicrm` (where `api` resides) to `include_path` in the `php.ini` (checked I got the right one with `php --ini`). That didn't work.
  
  But I got it to work by soft linking the `api` directory into the new extension directory, i.e. changed directory to the extension directory and did the following command: `$ ln -s /Applications/MAMP/htdocs/xxx/civcrm/‌​wp-content/plug‌​ins/civicrm/‌​civicrm/api .`
  
  It's not an ideal solution but it enabled meet move forward.
  
  
  ---
  
  