PHPackages                             psc/psc - 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. [Framework](/categories/framework)
4. /
5. psc/psc

ActiveProject[Framework](/categories/framework)

psc/psc
=======

Only what is necessary to start an empty Object Oriented PHP project, with a route scheme.

1.5.7(5y ago)346MITPHPPHP ~7.0

Since Oct 17Pushed 4y agoCompare

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

READMEChangelog (3)DependenciesVersions (12)Used By (0)

PhpSimpleClasses
================

[](#phpsimpleclasses)

[![GitHub release (latest by date)](https://camo.githubusercontent.com/d419fa17e565a0bfe0a88d2d873edc87bc93a302f4b5986c95324b6322abaf38/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f50687053696d706c65436c61737365732f50687053696d706c65436c61737365733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/d419fa17e565a0bfe0a88d2d873edc87bc93a302f4b5986c95324b6322abaf38/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f50687053696d706c65436c61737365732f50687053696d706c65436c61737365733f7374796c653d666f722d7468652d6261646765)[![Packagist Version](https://camo.githubusercontent.com/e2b8d0a209bf68623a67003d29b02dabb65c2496232fe9f3fd5cc3f0567f05a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7073632f7073633f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/e2b8d0a209bf68623a67003d29b02dabb65c2496232fe9f3fd5cc3f0567f05a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7073632f7073633f7374796c653d666f722d7468652d6261646765)[![GitHub repo size](https://camo.githubusercontent.com/2048b62b9512e7cab96619404b98d2486c7e90dee4200a8dca753c1edeb00650/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f50687053696d706c65436c61737365732f50687053696d706c65436c61737365733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/2048b62b9512e7cab96619404b98d2486c7e90dee4200a8dca753c1edeb00650/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f50687053696d706c65436c61737365732f50687053696d706c65436c61737365733f7374796c653d666f722d7468652d6261646765)[![Packagist PHP Version Support](https://camo.githubusercontent.com/f493feca27c0242b76f7bcbac9706bb2cf35a84d4f272f8cb86db7a72d84ab7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7073632f7073633f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/f493feca27c0242b76f7bcbac9706bb2cf35a84d4f272f8cb86db7a72d84ab7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7073632f7073633f7374796c653d666f722d7468652d6261646765)[![GitHub](https://camo.githubusercontent.com/79aedd36fd898756d6663e44d3ab7044f32d60be19f790288540ddda8416a39f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f50687053696d706c65436c61737365732f50687053696d706c65436c61737365733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/79aedd36fd898756d6663e44d3ab7044f32d60be19f790288540ddda8416a39f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f50687053696d706c65436c61737365732f50687053696d706c65436c61737365733f7374796c653d666f722d7468652d6261646765)

Only what is necessary to start an empty Object Oriented PHP project, with a route scheme.

Get Started:
------------

[](#get-started)

### Creating a new project PSC Based

[](#creating-a-new-project-psc-based)

### Git Clone:

[](#git-clone)

```
$ git clone https://github.com/PhpSimpleClasses/PhpSimpleClasses MyProject
$ cd MyProject
```

OR

### Composer:

[](#composer)

```
$ composer create-project psc/psc MyProject
$ cd MyProject
```

Basic Structure:
----------------

[](#basic-structure)

- [`_core`](_core): contains all system base (classes manager, loaders, DB functions, etc).
- [`public`](public): contains the main entry point to webserver ([`index.php`](public/index.php)), where is you have to store all public/static files (like css, js, images, etc).
- [`src`](src): contains all backend resources, it has the MVC design pattern, but you can add or create anything you need and it will be available in any scope inside [`src`](src) (see more in [Load Classes and Other Scripts](README.md#load-classes-and-other-scripts)).
- [`.htaccess`](.htaccess): (for apache) is configured to redirect any access to your domain to [`index.php`](public/index.php), or if the access is to an existing file: `public/myFile.png`.
- [`config.php`](config.php): define all initial constants, like basepath and DB auth, you can add your own default constants and configs too.
- [`routes.php`](routes.php): define all routes to public access in your project.

Basic Usage:
------------

[](#basic-usage)

First, configure your `context` section in [`config.php`](config.php), if you want to use a DB (MySQL), configure `DB` section too.

### Routes:

[](#routes)

Open [`routes.php`](routes.php), as can you see in examples routes, you must set in the `$routes` array, a route like key and a class/function like value. (This class have to be on [`Controllers`](src/Controllers)).

e.g.:

```
$routes[] = ['/my/first', 'Test/firstFunction'];
```

To pass parameters, use `$` as wildcard on write a route. The function on controller will receive the parameters in same order.

e.g.:

```
$routes[] = ['/user/$/details', 'Users/details'];

//In src/Controllers/Users.php:
//...
public function details($userId){
    echo $userId;
    //Will print any string in url between 'user/' and '/details'
}
```

### DB:

[](#db)

First you need to extends the `PSC` class:

e.g.:

```
//In src/Controllers/Something.php:

namespace Controllers;

use _core\PSC;

class Something extends PSC
{
    public function __construct()
    {
        parent::__construct();
    }
}
```

**Note:** Ever write the `__construct()` function and lists the parent constructor to preserve the flow and prevent errors when extending the PSC class.

Then can use `$this->db` function:

```
public function getUserDetails($userId){
    $this->db->select('users', '*');
    $this->db->where('id', $userId);
    $results = $this->db->get();
    return $results;
}
```

All SQL methods return `$this->db`, then you can call all methods after first call to `$this->db->`...:

```
public function getUserDetails($userId){
    $results = $this->db->select('users', '*')
    ->where('id', $userId)
    ->get();
    return $results;
}
```

Anytime you can use the function `$this->exec` to execute SQL Querys without query builder:

```
public function getAllUsers(){
    $results = $this->db->exec("SELECT * FROM users");
    return $results;
}
```

### Load Classes and Other Scripts:

[](#load-classes-and-other-scripts)

#### Classes:

[](#classes)

All content in [`src`](src) follow PHP OO default scheme. If are you running a route to `Controllers/Test.php`, your current namespace is `Controllers`, then you can call in this class:

```
$myOtherClass = new OtherClass();
//This will instantiate src/Controllers/OtherClass.php on $myOtherClass
```

But when you want to call a class in another namespace, use `\` to go back to [`src`](src):

```
$myData = new \Models\OtherData();
//$this will instantiate src/Models/OtherData.php on $myData
```

#### Other Scripts:

[](#other-scripts)

To load (include) other scripts without classes (like views and helpers), you can to use the function `$this->load` (from PSC class):

```
$this->load('Views/test');
//this will include src/Views/test.php
```

With this function you can pass all variable you need to use in script in a array, it will be extracted to use directly inside him:

```
$vars['name'] = 'Junior';
$vars['age'] = '21';
$this->load('Views/test', $vars);
```

Then inside `src/Views/test.php`:

```
>

    Hello

    Hello! My name is

    and i have

    years old.

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~28 days

Total

10

Last Release

1879d ago

PHP version history (2 changes)1.2.4PHP &gt;=7.2

1.5.2PHP ~7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66422318?v=4)[Zimaldo Junior](/maintainers/zimaldo)[@zimaldo](https://github.com/zimaldo)

---

Top Contributors

[![zimaldo](https://avatars.githubusercontent.com/u/66422318?v=4)](https://github.com/zimaldo "zimaldo (51 commits)")[![pablo2p](https://avatars.githubusercontent.com/u/59230603?v=4)](https://github.com/pablo2p "pablo2p (2 commits)")

---

Tags

composerframeworkpackagistphpphp7phpoopscphpframeworkobjectSimpleclassesprojecteasyorientedoopscphpsc

### Embed Badge

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

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

###  Alternatives

[originphp/framework

The OriginPHP framework

472.6k6](/packages/originphp-framework)

PHPackages © 2026

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