PHPackages                             yu-corder/php-rcs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yu-corder/php-rcs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yu-corder/php-rcs
=================

A pure PHP implementation of a Revision Control System (RCS) for file versioning.

v0.1.1(2mo ago)17MITPHP ^8.2

Since May 22Compare

[ Source](https://github.com/yu-corder/php-rcs)[ Packagist](https://packagist.org/packages/yu-corder/php-rcs)[ RSS](/packages/yu-corder-php-rcs/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

php-rcs
=======

[](#php-rcs)

[![PHP](https://camo.githubusercontent.com/c6a0623df46e3daa3dfeddb7da1c4486e647b8da62ed2f7499fe18f85fddf301/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532302d2d253230382e352d626c7565)](https://camo.githubusercontent.com/c6a0623df46e3daa3dfeddb7da1c4486e647b8da62ed2f7499fe18f85fddf301/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532302d2d253230382e352d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)

A pure PHP implementation of a Revision Control System (RCS) for file versioning.

`php-rcs` is a lightweight revision control library inspired by traditional RCS tools and modern version control concepts.

This project started as a learning exercise to better understand how revision control systems work internally, including:

- snapshot storage
- revision history management
- file versioning
- CLI tooling
- repository structure design

Although the project is still evolving, it is fully functional and intended to be usable for small personal projects and experimentation.

---

Features
========

[](#features)

- Check in file revisions
- Check out previous versions
- View revision history
- Simple JSON-based storage
- Lightweight PHP implementation
- CLI support
- PSR-4 autoloading support

---

Requirements
============

[](#requirements)

- PHP 8.2+

---

Security Notice
===============

[](#security-notice)

If you use `php-rcs` to manage sensitive files such as:

- `.env`
- API keys
- configuration files
- private credentials

make sure to add the `.rcs/` directory to your `.gitignore`.

The `.rcs` directory stores full file snapshots, meaning sensitive file contents are saved directly inside JSON history files.

Example:

```
.rcs/
```

Without this, sensitive data may accidentally be committed to Git repositories.

---

Installation
============

[](#installation)

Via Composer
------------

[](#via-composer)

```
composer require yu-corder/php-rcs
```

---

CLI Usage
=========

[](#cli-usage)

The package provides a CLI tool:

```
php bin/rcs
```

---

Check in a file
---------------

[](#check-in-a-file)

```
php bin/rcs checkin example.txt "Initial version"
```

Example output:

```
✓ Successfully checked in.

```

---

Check out a specific version
----------------------------

[](#check-out-a-specific-version)

```
php bin/rcs checkout example.txt 1
```

Example output:

```
✓ Successfully checked out to v1.

```

---

Show revision history
---------------------

[](#show-revision-history)

```
php bin/rcs log example.txt
```

Example output:

```
v1 | 2026-05-22 10:00:00 | Initial version
v2 | 2026-05-22 10:05:12 | Updated content

```

---

PHP API Usage
=============

[](#php-api-usage)

```
