Download the PHP package tshw/php-todo-txt without Composer
On this page you can find all versions of the php package tshw/php-todo-txt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tshw/php-todo-txt
More information about tshw/php-todo-txt
Files in tshw/php-todo-txt
Package php-todo-txt
Short Description PHP library for the todo.txt unstructured todo list format.
License GPL-3.0-or-later
Informations about the package php-todo-txt
PHPTodoTxt ![Run Test [Composer]](https://github.com/Tar-Minyatur/PhpTodoTxt/actions/workflows/php.yml/badge.svg)
PHP library for the todo.txt unstructured todo list format.
What is todo.txt?
It's a simple file format for the todo text file that many people probably have on their desktop somewhere.
A todo.txt file following this standard looks like this:
A simple task is just a line
x This task is done, indicated by the lowercase x
(F) Prioritization is important, so this is priority F
2025-01-01 This task has its creation date mentioned
x 2025-01-01 2024-05-01 This task is done and has a completion and creation date
For +myCoolProject I need to write documentation
When I'm @work I need to plan my next vacation
You get the gist. It's simple, but more structured than just writing down stuff.
To lean more, you can head to todotxt.org to learn more.
Features
- Robustly parses the todo.txt
- Provides an easy-to-use model to access and modify tasks
- Task description is available als "clean" version without trailing tags
- Projects, contexts and meta data are available separately as arrays
Installation
Use composer to add as dependency:
$ composer require tshw/php-todo-txt
Usage
Create an object of the main class by reading tasks from a file:
List all tasks:
Modify tasks:
Write tasks to a file:
Add task:
Move task within the list (this displaces tasks further down in the list, changing their keys!):
FAQ
Can I use PHPTodoTxt to store tasks in a database?
Absolutely. For now, the easiest way is to use toStringArray() and fromStringArray() and then you have to implement
storing and reading to/from the database yourself:
License
This code is offered open-source under the GPLv3 license.