Resist Design
Resist Design

Reputation: 4521

Best Way To Sync Core Files In Multiple PHP Projects?

When I update core files in the library/platform itself and I want to disseminate those changes to all of the other projects using that platform, what would be the best approach?

I think it may be worth noting that I have each project as an SVN project in Eclipse.

UPDATED DETAILS:

Is there a solution that will allow me to designate certain files to update?

Upvotes: 2

Views: 353

Answers (3)

iWantSimpleLife
iWantSimpleLife

Reputation: 1954

My programs are usually organised in two parts. the core framework folder, and the addon folders.my framework (in house) does all the initial work then loads the addon for additional functionality.

For example, the framework deals with all the user auth , the addon provide additional crud functions the each project needs.

That way, i can keep them in separate repository. and the framework can be checked out and used for other projects.

Upvotes: 0

element119
element119

Reputation: 7625

Excellent question, here's the way I solved this problem with my own PHP framework.

If you have all the project-specific and core files mixed together, and platform code interspersed with your project code, it's going to be really difficult to update the core code to all of your projects.

The best way to get around this is to make it easier for svn (or git, or any other versioning software) to update your files: if they're all neatly organized, with project and core files in their respective places. Let me give you an example to clarify.

Put all of the core files of your framework in this directory:

/App/FrameworkName

Here you can place core classes, functions, and other code that won't change for all of your different projects.

Then, any project-related content, settings or pages go in:

/App/Project

Here, you have all of the data that your projects use.

With this system, if you add a feature to your platform, all you have to do is svn the latest version of your framework to /App/FrameworkName, and your project will be using up-to-date code.

Upvotes: 2

Borealid
Borealid

Reputation: 98489

Take a look at the use of svn:externals. Configure each secondary project with your core libraries as an external.

Upvotes: 3

Related Questions