PHPackages                             los/losbase - 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. los/losbase

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

los/losbase
===========

Library with common classes for Los packages

2.5.6(10y ago)64.3k1[2 issues](https://github.com/Lansoweb/LosBase/issues)1BSD-3-ClausePHPPHP &gt;=5.4

Since Jun 15Pushed 10y ago3 watchersCompare

[ Source](https://github.com/Lansoweb/LosBase)[ Packagist](https://packagist.org/packages/los/losbase)[ RSS](/packages/los-losbase/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (18)Used By (1)

\#LosBase [![Build Status](https://camo.githubusercontent.com/c129cb634aceb355eea21d93cf304f70c1f8d8b1c77775672b877178db47ce48/68747470733a2f2f7472617669732d63692e6f72672f4c616e736f7765622f4c6f73426173652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Lansoweb/LosBase) [![Latest Stable Version](https://camo.githubusercontent.com/24cc69acf63a6d4167c82b7669a92057866b64dbb7e0e72e7ece647ea65709de/68747470733a2f2f706f7365722e707567782e6f72672f6c6f732f6c6f73626173652f762f737461626c652e737667)](https://packagist.org/packages/los/losbase) [![Total Downloads](https://camo.githubusercontent.com/ebdcb1fe58a52678fa7b2ae361e0302395bd2ca9c2bc869e433c187ca03824f1/68747470733a2f2f706f7365722e707567782e6f72672f6c6f732f6c6f73626173652f646f776e6c6f6164732e737667)](https://packagist.org/packages/los/losbase) [![Coverage Status](https://camo.githubusercontent.com/7d4cccce03c5d143030b79f4480fea52eb81159fa8479a92a565bbbc32d789eb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4c616e736f7765622f4c6f73426173652f62616467652e737667)](https://coveralls.io/r/Lansoweb/LosBase) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/e440ee121730933cb73d3802c0621513f43fe84b04ce430d288912528f8d948d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c616e736f7765622f4c6f73426173652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Lansoweb/LosBase/?branch=master) [![SensioLabs Insight](https://camo.githubusercontent.com/8c03f0ddebb1718eac1edd7298ea24fbf8f18d2170ca1039a87ac3e9def51113/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f37326465336639312d346435622d346433342d613635332d3139373937356365346331372e7376673f7374796c653d666c6174)](https://insight.sensiolabs.com/projects/72de3f91-4d5b-4d34-a653-197975ce4c17) [![Dependency Status](https://camo.githubusercontent.com/f2db0dda0b4bf3052ce99047348647a4da9bf995a420b37e828e6285114e2f30/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534646138323962633162626264356638323030303264322f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/54da829bc1bbbd5f820002d2)

Introduction
------------

[](#introduction)

This module provides some utility classes for ZF2 projects and other [LOS modules](http://leandrosilva.info/modulos-zf2)

Requirements
------------

[](#requirements)

- PHP 5.4 or greater
- Zend Framework 2 [framework.zend.com](http://framework.zend.com/).

Instalation
-----------

[](#instalation)

Instalation can be done with composer ou manually

### Installation with composer

[](#installation-with-composer)

For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

1. Enter your project directory
2. Create or edit your `composer.json` file with following contents:

    ```
    {
        "minimum-stability": "dev",
        "require": {
            "los/losbase": "~2.5"
        }
    }
    ```
3. Run `php composer.phar install`
4. Open `my/project/directory/config/application.config.php` and add `LosBase` to your `modules`

### Installation without composer

[](#installation-without-composer)

1. Clone this module [LosBase](http://github.com/LansoWeb/LosBase) to your vendor directory
2. Enable it in your config/application.config.php like the step 4 in the previous section.

Usage
-----

[](#usage)

### CRUD

[](#crud)

The module provides a console interface for easily creating a CRUD module:

```
php public/index.php create crud

```

And it will create all necessary files and directories (config, controller, entity and service)

### Controller

[](#controller)

The AbstractCrudController provides some common operations for simples a CRUD:

- list
- view
- add
- edit
- delete

### Doctrine types

[](#doctrine-types)

- UtcDateTime: converts the datetime to UTC before saving to the database
- BrDateTime: converts the datetime to UTC before saving to the database and to BRST (UTC-3) when loading from database
- BrPrice: handles brazillian price format (1.234,56) for databae operations

### Doctrine Entities

[](#doctrine-entities)

- 3 Traits: Id, Created and Updated
- AbstractEntity already using the 3 basic traits above

### Module

[](#module)

- AbstractModule providing getAutoloaderConfig and getConfig basic methods

### Doctrine Entity Service

[](#doctrine-entity-service)

- AbstractEntity provides and abstract service class that handles saves and deletes for doctirne entities
- Util: getUserAgent and getIP
- Uuid: static method for UUID creation

### Doctirne validators

[](#doctirne-validators)

- NoEntityExists asserts that no entity with the specified field already exists during add operation
- NoOtherEntityExists asserts that no other entity with the specified field already exists during edit operation

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~25 days

Recently: every ~45 days

Total

17

Last Release

3944d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b54dffc1ebcb317a0cf825a781ab6c5f30980e9abd0d0a3f9c68830cb05c014?d=identicon)[Lansoweb](/maintainers/Lansoweb)

---

Top Contributors

[![Lansoweb](https://avatars.githubusercontent.com/u/2109813?v=4)](https://github.com/Lansoweb "Lansoweb (30 commits)")

---

Tags

librarycommonbaselos

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)

PHPackages © 2026

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