Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert index.php into config file and move server to class file #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jkufner
Copy link

@jkufner jkufner commented Aug 10, 2016

Motivation

The primary motivation for this change is to allow integration into a third party application. This is the first step which does not really change behavior of the server, but allows further refactoring into a nice library.

I would like to see integration in some kind of advanced gallery or something: User sets up automatic backup of his phone into a private gallery and then he can move selected photos to public galleries.

Making this project usable as a library makes it easy to follow changes in the API (protocol) while PhotoBackup developers don't have to waste time with updating complex server implementations.

Changes

Fixes #2: index.php is now considered a configuration file (which loads
the server at the end). To avoid conflicts during update the index.php
is not committed to repository, instead a index.php.example is provided.
It is also possible to move index.php somewhere outside the document
root and include it from the real index.php (see instructions in the
index.php.example).

The whole project is now a Composer package. Composer is not neccessary
when running this as standalone server, but it allows to use this
project as a library.

Also, it fixes #6 - a missing parameter in checking for duplicates.

Fixes PhotoBackup#2: index.php is now considered a configuration file (which loads
the server at the end). To avoid conflicts during update the index.php
is not committed to repository, instead a index.php.example is provided.
It is also possible to move index.php somewhere outside the document
root and include it from the real index.php (see instructions in the
index.php.example).

The whole project is now a Composer package. Composer is not neccessary
when running this as standalone server, but it allows to use this
project as a library.

Also, it fixes PhotoBackup#6 - a missing parameter in checking for duplicates.
@Zegnat
Copy link
Contributor

Zegnat commented Aug 10, 2016

This bumps PHP requirements to 5.4? I think the current requirement is somewhere in the low PHP 4s.

Most of my hesitation to include these bigger updates has been addressed in the other issue. Though I do like the idea of creating a easily includable class for other projects to use, I am not sure if this repository is the right place for it.

Then again, that's just what I envisioned.

@jkufner
Copy link
Author

jkufner commented Aug 10, 2016

It does not require anything else except namespaces. Namespaces were introduced in PHP 5.3, which is over 7 years old (30 Jun 2009) and there are no security fixes for it for two years. I've put 5.4 requirement there because of many very useful features I usually need (and don't remember how old they are), but it can be changed to 5.3 if you really wish.

(See the other issue about the vision.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mistake in checking for duplicates. Use an external configuration file.
2 participants