Answers.Body: <p>Hit this one last month, and created a bug for it: <a href="https://issues.civicrm.org/jira/browse/CRM-16218" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-16218</a></p>
  
  <p>Are you using WordPress, by any chance?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T12:12:37.513Z
Answers.Text: Yep, it occured for me on Wordpress.
Answers.UserDisplayName: Nicholai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T11:48:07.680Z
Answers.LastActivityDate: 2015-05-11T11:48:07.680Z
Answers.UserDisplayName: Andrew West
Answers.Body: <p>As a workaround, you can create manually the Create.php file that contains civicrm_api3_invoice_create()</p>
  
  <p>Check the api/v3 folder in the core for examples (eg. the email one)</p>
  
  <p>As for civix, do you have the latest version? if it's the case, fill a bug on github</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T12:24:11.543Z
Answers.Text: @Andrew's answer and bug filed match the exact issue I'm having. I looked at the Email Create example, but it calls existing api functions. In this case I'm asking civix to create a new API endpoint in order to expose some custom functions to the CMS, per http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-AddanAPIfunction.
Answers.UserDisplayName: Nicholai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T13:21:30.573Z
Answers.Text: my point was that you don't need civix to create these, you can manually create the file with the right function and it will end up working the same
Answers.UserDisplayName: Xavier
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T14:02:34.450Z
Answers.Text: Ah, I thought perhaps something special was required for exposing my own api functions, as the wiki said "Note that the parameters and return values must be processed in a particular way (as demonstrated by the auto-generated file)."
Answers.UserDisplayName: Nicholai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T14:43:42.440Z
Answers.Text: nope, but it's expecting the name of the file and location and function within to follow a specific format. Checkout the api/v3 on civi for examples (mail.php for instance for a generic one, assuming you have a dao/bao already)
Answers.UserDisplayName: Xavier
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T06:31:53.350Z
Answers.LastActivityDate: 2015-05-11T06:31:53.350Z
Answers.UserDisplayName: Xavier
Body: <p>When attempting to run this:</p>
  
  <pre><code>civix generate:api Invoice Create
  </code></pre>
  
  <p>It creates an /api/v3/Invoice folder but doesn't create any files. Instead I get the following:</p>
  
  <blockquote>
    <p>Warning: ini_set(): A session is active. You cannot change the session
    module's ini settings at this time in
    /home/ubuntu/civix/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php
    line 56</p>
  </blockquote>
  
  <p>Civix works for me otherwise; I can create extensions, pages, etc. Any suggestions?</p>
  
Tags: <civix>
Title: Error in civix generate:api "You cannot change the session module's ini settings at this time"
ThreadText: # Error in civix generate:api "You cannot change the session module's ini settings at this time"
  
  (Asked by: username_0 on 2015-05-11)
  
  When attempting to run this:
  civix generate:api Invoice Create
  
  It creates an /api/v3/Invoice folder but doesn't create any files. Instead I get the following:
  
  Warning: ini_set(): A session is active. You cannot change the session
    module's ini settings at this time in
    /home/ubuntu/civix/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php
    line 56
  
  Civix works for me otherwise; I can create extensions, pages, etc. Any suggestions?
  
  **Tags:** civix
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-05-11. Score: 2 | Accepted answer
  
  Hit this one last month, and created a bug for it: <https://issues.civicrm.org/jira/browse/CRM-16218>
  
  Are you using WordPress, by any chance?
  
  > **Comments:**
  > **username_0**: Yep, it occured for me on Wordpress.  
  
  ---
  
  ### Answer by username_2 on 2015-05-11. Score: 2
  
  As a workaround, you can create manually the Create.php file that contains civicrm\_api3\_invoice\_create()
  
  Check the api/v3 folder in the core for examples (eg. the email one)
  
  As for civix, do you have the latest version? if it's the case, fill a bug on github
  
  > **Comments:**
  > **username_0**: @Andrew's answer and bug filed match the exact issue I'm having. I looked at the Email Create example, but it calls existing api functions. In this case I'm asking civix to create a new API endpoint in order to expose some custom functions to the CMS, per http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-AddanAPIfunction.  
  > **username_2**: my point was that you don't need civix to create these, you can manually create the file with the right function and it will end up working the same  
  > **username_0**: Ah, I thought perhaps something special was required for exposing my own api functions, as the wiki said "Note that the parameters and return values must be processed in a particular way (as demonstrated by the auto-generated file)."  
  > **username_2**: nope, but it's expecting the name of the file and location and function within to follow a specific format. Checkout the api/v3 on civi for examples (mail.php for instance for a generic one, assuming you have a dao/bao already)  
  
  ---
  
  