Answers.Body: <p>You could make a really simple Composer package that has just the XML file in it, and have both plugins require that composer package.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-28T08:20:50.803Z
Answers.Text: This XML file will be updated several times daily through a scheduled download...  will there be issues in updating the XML file in the Composer package?  I'm new to Composer - could you point me to a good place to start?  Thanks!
Answers.UserDisplayName: buck1112
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-03T03:17:26.780Z
Answers.Text: Okay that's an important bit of information. If the XML file is going to be updated several times daily, why not just store the file in the cache? That way any plugin can get at it, and any time either plugin updates the cache entry, the other will see it.
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-05T15:58:22.983Z
Answers.Text: Thanks -  Would it be the craft>storage>runtime>cache folder and just calls to that directory from my plugins?
Answers.UserDisplayName: buck1112
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-15T23:38:43.053Z
Answers.LastActivityDate: 2023-12-15T23:38:43.053Z
Answers.UserDisplayName: andrew.welch
Body: <p>I'm working in Craft 2, and was wondering if there is a way to share the same file among all of my plugins?  Each of the plugins will be reading the same XML file, and, currently, I've only been able to make it work by putting the same file in each plug-in's Resources folder, resulting in tedious duplication of those files and maintenance nightmares.<br />
  Would it be better to locate the file outside of the Craft folder?</p>
  <p>Thanks</p>
  
Tags: <plugin-development><craft2>
Title: Same File Shared By Multiple Plugins
ThreadText: # Same File Shared By Multiple Plugins
  
  (Asked by: username_0 on 2023-12-15)
  
  I'm working in Craft 2, and was wondering if there is a way to share the same file among all of my plugins? Each of the plugins will be reading the same XML file, and, currently, I've only been able to make it work by putting the same file in each plug-in's Resources folder, resulting in tedious duplication of those files and maintenance nightmares.  
  Would it be better to locate the file outside of the Craft folder?
  
  Thanks
  
  **Tags:** plugin-development, craft2
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-12-15. Score: 1
  
  You could make a really simple Composer package that has just the XML file in it, and have both plugins require that composer package.
  
  > **Comments:**
  > **username_0**: This XML file will be updated several times daily through a scheduled download...  will there be issues in updating the XML file in the Composer package?  I'm new to Composer - could you point me to a good place to start?  Thanks!  
  > **username_1**: Okay that's an important bit of information. If the XML file is going to be updated several times daily, why not just store the file in the cache? That way any plugin can get at it, and any time either plugin updates the cache entry, the other will see it.  
  > **username_0**: Thanks -  Would it be the craft>storage>runtime>cache folder and just calls to that directory from my plugins?  
  
  ---
  
  