PHPackages                             thpglobal/thpclasses - 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. [Database &amp; ORM](/categories/database)
4. /
5. thpglobal/thpclasses

ActiveLibrary[Database &amp; ORM](/categories/database)

thpglobal/thpclasses
====================

database common classes

0102PHP

Since Jan 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/thpglobal/thpclasses)[ Packagist](https://packagist.org/packages/thpglobal/thpclasses)[ RSS](/packages/thpglobal-thpclasses/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Classes -- thpclasses has been deprecated
=========================================

[](#classes----thpclasses-has-been-deprecated)

PHP classes designed for monitoring and evaluation data by The Hunger Project but is made public for anyone to easily and quickly establish database apps, on any platform but especially on Google App Engine. It's big advantage is the clever way it uses $\_COOKIE variables to make dropdown filter selections sticky.

Latest refactoring - December 2022
----------------------------------

[](#latest-refactoring---december-2022)

These classes have been replaced by those in the Classes repository to be compatible with PHP8.1 and to be utilized using composer (composer require thpglobal/classes) rather than a git submodule.

### /includes/thpsecurity

[](#includesthpsecurity)

```
// Any code that is special to your app, like connecting to a database or setting variables used throughout
$today=date("Y-m-d");
$user=$_SESSION["user"]; // set in the built in login scripts
if($user doesn't meet YOUR logical condition) Die("Not authorized, sorry");
$admin=if($user meets YOUR logical condition);
$can_edit=if($user meets YOUR logical condition for write permission);
$db = new PDO("mysql:unix_socket=/cloudsql/YOUR_PROJ:YOUR_REGION:YOUR_INSTANCE","YOUR_USER","YOUR_PWD")
```

### /includes/menu.php

[](#includesmenuphp)

```
include("../thpclasses/includes/menu.php"); // copy the demo menu from the classes
```

### /app.yaml

[](#appyaml)

```
runtime: php8.1
entrypoint: /app/index.php
handlers:

- url: /static
  static_dir: static

- url: /favicon.ico
  static_files: static/tst.png
  upload: static/tst.png

- url: .*
  script: auto
  secure: always

```

To automatically create dropdown menus linking to your scripts
--------------------------------------------------------------

[](#to-automatically-create-dropdown-menus-linking-to-your-scripts)

- change includes/menu.php to include("../thpclasses/includes/auto.php");
- create folders like /app/apples /app/berries
- create scripts like /app/apples/bartlet.php, /app/apples/green.php, /app/berries/blue.php, /app/berries/goose.php

When deployed, you'll have a runnable app that looks like this:

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 93.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15740550?v=4)[The Hunger Project](/maintainers/thpglobal)[@thpglobal](https://github.com/thpglobal)

---

Top Contributors

[![thpglobal](https://avatars.githubusercontent.com/u/15740550?v=4)](https://github.com/thpglobal "thpglobal (420 commits)")[![usamurai](https://avatars.githubusercontent.com/u/125213?v=4)](https://github.com/usamurai "usamurai (23 commits)")[![jcoonrod](https://avatars.githubusercontent.com/u/54367582?v=4)](https://github.com/jcoonrod "jcoonrod (6 commits)")

### Embed Badge

![Health badge](/badges/thpglobal-thpclasses/health.svg)

```
[![Health](https://phpackages.com/badges/thpglobal-thpclasses/health.svg)](https://phpackages.com/packages/thpglobal-thpclasses)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.8k117.8M121](/packages/jdorn-sql-formatter)[backup-manager/backup-manager

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

1.7k1.6M11](/packages/backup-manager-backup-manager)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M88](/packages/propel-propel1)[insolita/yii2-migration-generator

Set of gii tools for generating files for migration by schema of table , phpdoc or table data

108508.0k5](/packages/insolita-yii2-migration-generator)[xpdo/xpdo

A PDO-based Object/Relational Bridge Library

7088.4k4](/packages/xpdo-xpdo)[voku/session2db

A PHP library acting as a wrapper for PHP's default session handling functions which stores data in a MySQL database, providing both better performance and better security and protection against session fixation and session hijacking.

2920.0k](/packages/voku-session2db)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
