Download the PHP package jakubboucek/psync without Composer

On this page you can find all versions of the php package jakubboucek/psync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package psync

PHP sync (rsync for PHP) tool for crappy webhostings

A tool for automated deploy/download of PHP applications source code between local PC and crappy webhosting.

There is nothing worse than babysitting a PHP application on a hosting that, in this day and age, still speaks nothing but FTP. No SSH, no rsync, no Git deploy — just a lonely FTP port and your patience. You drag files in Total Commander, never quite sure what is actually on the server, and if you ever need to pull a changed file back down to compare it… good luck. (Editing straight on the server and then trying to keep things in sync is, of course, even worse ;-)

psync is rsync for exactly these crappy webhostings. You upload one small PHP file (the agent) over FTP once, and from then on you drive it over HTTP from your machine. Unlike one-way FTP deployers, psync is bidirectional: it can compare both sides, upload your local changes, and download whatever got changed on the server — even for applications with tens of thousands of files, and while politely respecting the tiny time/memory/upload limits of cheap shared hosting.

How it works

  1. Install once. psync install generates an Ed25519 key pair and renders the agent — a single self-contained PHP file containing only the public key. You upload it via FTP into your agent-dir (where it must be reachable over HTTP). The private key goes into your local config and nowhere else, so even a leaked agent file lets nobody forge a request. The agent gets a randomized filename (psync-agent-<nonce>.php) so its URL can't be scanned for, and it carries a header comment that tells anyone who later stumbles on it that it is a maintenance tool — not a backdoor — and is safe to delete. After a version bump, psync re-install re-renders the agent reusing your layout (rotating the key by default) — you re-upload it.

    The agent's reach is a fixed scope baked in at install — the path from where the agent file lives (agent-dir) to the top of the synchronized tree (sync-root). The two need not coincide: the synced tree may sit above the agent (frameworks like Nette/Laravel/Symfony keep their code above the public dir), below it (manage just system/logs/ from an agent at the site root), or on a sibling branch. The scope is hardcoded and never taken from a request, so it stays a fixed boundary; the client cross-checks it against your config on every run.

  2. Every call is a signed HTTP request. The client signs each request with the private key; the agent verifies it with the public key, plus a timestamp and nonce against replay. It therefore works even over plain HTTP, which many of these hostings still serve.

  3. Comparison is two-phase, the way rsync stays fast. First a quick listing of name + size + mtime on both sides. Only for files of equal size but different mtime does the agent compute an md5 — in batches sized to fit the server's limits. A local state cache remembers the verdict, so a file whose only difference is a wobbly FTP mtime is not re-hashed on every run.

  4. Transfers are streamed and safe. Files move in a compact binary framing (optionally gzipped), never loaded whole into memory. Each file is written atomically (temp file + rename) and stamped with the source's mtime. Deletion is opt-in (--delete) and shielded by a protect-list.

  5. It survives crashes. Because shared hosting loves to kill a request mid-flight, every operation is idempotent and resumable — if it dies, just run it again and the finished files are skipped.

Installation

Configuration

psync install generates and fills in .psync.php. All paths are relative to the config file's own directory (the project-root):

Config keys

The filesystem agentDir (used to compute the scope) and the public agentUrl are independent — psync does not track how your DocumentRoot maps to the filesystem, so it only needs the URL that reaches the agent.

ignore vs protect

These two look similar but do completely different things:

⚠️ protect does not prevent overwriting — only deletion. If you want a directory genuinely left alone (typically user-generated content like /uploads), put it in ignore. The example above lists /uploads and /temp in both: ignore keeps psync from touching them, and protect is the extra safety net so they survive even if they are ever removed from ignore.

Pattern syntax (same for both lists): a pattern starting with / is anchored to the root (/temp matches temp and everything under it); a pattern without / matches any path segment or basename (*.log, .git); globs *, ?, [...] are supported.

/temp vs /temp/* — because directories are synchronized entities (see below), these differ: /temp ignores the folder itself*, so it is never created on the other side; `/temp/keeps the emptytemp/` folder (it is* created) but ignores everything inside it. Use the `/` form for a directory the application expects to exist but whose contents are server-owned (caches, runtime logs).

Directories

psync synchronizes directories as first-class entries, so an empty directory is created on the other side too (handy for /temp, /log, or any placeholder folder the application expects to exist). With --delete, a directory that is missing on the source is removed on the target — but only if it is empty: deletion is non-recursive, contents are deleted first and then the directory. If a directory still holds files that your ignore mask hid from the comparison (e.g. a stray *.log), the rmdir fails on purpose (reported as an error, the run continues and exits non-zero) — that is a deliberate state for you to resolve, not something psync silently force-deletes. A path that is a file on one side and a directory on the other is reported as a type conflict and skipped (never auto-resolved).

Commands

compare legend: > local only · < server only · M differs · = identical.

Example layouts (run from the project-root):

A worked example (framework app, code above the public dir)

The most common enhanced case: a Nette/Symfony-style project whose application code and dependencies live above the public directory, with the agent deployed into the public dir (= DocumentRoot):

From the project-root:

This deploys the agent into web/www/ (served at https://example.com/) and synchronizes the whole web/ tree — including app/ and vendor/, which sit above the public dir and are never reachable over HTTP. docker-compose.yml and phpstan.neon stay on your machine because they live at the project-root, outside the sync-root. The agent's baked scope is .. — one level up from www/ to web/.

Security

Limits and notes

Development and testing

The test environment is in docker-compose.yml (server = PHP 7.4 Apache, client = PHP 8.4 CLI):


All versions of psync with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-curl Version *
ext-json Version *
ext-sodium Version *
ext-zlib Version *
symfony/console Version ^7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jakubboucek/psync contains the following files

Loading the files please wait ...