Answers.Body: <p>The answer is "yes" but...</p>
  
  <p>Overriding an entire file means upgrades will become difficult, as you'll have to manually diff the contents of that file with the one in the new version, and reapply your changes.</p>
  
  <p>If possible, try accomplishing your goal using a <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference" rel="nofollow">hook</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-02T20:12:11.713Z
Answers.Text: I'm only changing one line in the file and it's just changing the activity status from Completed to Needs Response. Otherwise the file is identical. I don't understand hooks, tried figuring them out but never could wrap my head around them.
Answers.UserDisplayName: frTommy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-02T20:28:56.010Z
Answers.Text: Documentation for implementing a hook is [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference). I suggest you try [hook_civicrm_postProcess](http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postProcess) for simple alterations to a submitted form.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-11T15:28:45.823Z
Answers.Text: Is there also a link to the documentation for overriding PHP files using the custom directory? We use this approach but I couldn't find any links to documentation explaining it in more detail (what can be overridden etc.)
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-02T20:09:34.643Z
Answers.LastActivityDate: 2015-05-02T20:09:34.643Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>The answer is yes, you can do that. I tested it and it worked. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-02T19:29:52.670Z
Answers.LastActivityDate: 2015-05-02T19:29:52.670Z
Answers.UserDisplayName: frTommy
Body: <p>Can I override core behavior of CRM/SMS/Providers.php by creating the file with the changes in my civicrm_custom_php directory?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-03T16:17:30.463Z
Comments.Text: It seems as @spidersilk is trying to achieve the same: http://civicrm.stackexchange.com/q/826/49
Comments.UserDisplayName: Flying
Tags: <custom-templates>
Title: Can I override core classes or PHP files with custom versions?
ThreadText: # Can I override core classes or PHP files with custom versions?
  
  (Asked by: username_0 on 2015-05-02)
  
  Can I override core behavior of CRM/SMS/Providers.php by creating the file with the changes in my civicrm\_custom\_php directory?
  
  **Tags:** custom-templates
  
  > **Comments:**
  > **username_1**: It seems as @spidersilk is trying to achieve the same: http://civicrm.stackexchange.com/q/826/49  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-05-02. Score: 4
  
  The answer is "yes" but...
  
  Overriding an entire file means upgrades will become difficult, as you'll have to manually diff the contents of that file with the one in the new version, and reapply your changes.
  
  If possible, try accomplishing your goal using a [hook](http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference).
  
  > **Comments:**
  > **username_0**: I'm only changing one line in the file and it's just changing the activity status from Completed to Needs Response. Otherwise the file is identical. I don't understand hooks, tried figuring them out but never could wrap my head around them.  
  > **username_2**: Documentation for implementing a hook is [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference). I suggest you try [hook_civicrm_postProcess](http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postProcess) for simple alterations to a submitted form.  
  > **username_3**: Is there also a link to the documentation for overriding PHP files using the custom directory? We use this approach but I couldn't find any links to documentation explaining it in more detail (what can be overridden etc.)  
  
  ---
  
  ### Answer by username_0 on 2015-05-02. Score: 1
  
  The answer is yes, you can do that. I tested it and it worked.
  
  
  ---
  
  