PHPackages                             molajo/query - 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. molajo/query

ActiveMolajo-package

molajo/query
============

Molajo Query Services for PHP Applications

0507PHP

Since Aug 28Pushed 10y ago4 watchersCompare

[ Source](https://github.com/Molajo/Query)[ Packagist](https://packagist.org/packages/molajo/query)[ RSS](/packages/molajo-query/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

======= Query Package
=====================

[](#query-package)

[![Build Status](https://camo.githubusercontent.com/4a46812581690ab77ce3944731a3222d2038357e473aa642d1e713ea870cf4a1/68747470733a2f2f7472617669732d63692e6f72672f4d6f6c616a6f2f51756572792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Molajo/Query)

Query Services supporting translations for the User Interface for PHP applications using Adapters for different implementation types (ex., Database, \*.ini files, etc.).

System Requirements
-------------------

[](#system-requirements)

- PHP 5.3.3, or above
- [PSR-0 compliant Autoloader](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)
- PHP Framework independent
- \[optional\] PHPUnit 3.5+ to execute the test suite (phpunit --version)

### How to specify Query

[](#how-to-specify-query)

Query strings are loaded in startup for language determined in this order (and installed):

1. Injected value during class instantiation
2. Session
3. User Data
4. Client Query
5. Application Configuration
6. Defaults to en-GB

Instantiation
-------------

[](#instantiation)

To instantiate the Query Class:

```
   $language = new Query($language);
```

Once instantiated, all calls to the class can be made using the $language instance.

Query Properties
----------------

[](#query-properties)

To retrieve the key value (ex. 'en-GB') for the language which is loaded:

```
   $language->get('language');
```

### Retrieve Query Strings

[](#retrieve-query-strings)

To retrieve all language strings and translations for the loaded language:

```
   $language->get('strings');
```

### Retrieve List of all installed Querys

[](#retrieve-list-of-all-installed-querys)

To retrieve a list of all languages installed in this application:

```
   $language->get('installed');
```

### Retrieve Query Attribute

[](#retrieve-query-attribute)

To retrieve a registry attribute value (id, name, rtl, local, first\_day) for the loaded language:

```
   $language->get('name-of-attribute');
```

### Retrieve all Query Attributes

[](#retrieve-all-query-attributes)

To retrieve all registry attribute values as an array for the loaded language:

```
   $language->get('registry');
```

Translate
---------

[](#translate)

To translate the string $xyz:

```
   $language->translate($xyz);
```

To retrieve a list of language strings and translations matching a wildcard value:

```
   $language->translate($xyz, 1);
```

Identify Untranslated Strings
-----------------------------

[](#identify-untranslated-strings)

To insert strings found in code but are not already in database:

- If an administrator is logged on, the primary language services automatically insert untranslated strings
- To avoid doing so, override the `QueryPlugin` and set `insert_missing_strings` to `0`
- For instances you define, set the `insert_missing_strings`, as needed.

To log strings found in code, but are not already in database:

- Set the Application configuration option `profile_missing_strings` to `1` and turn on `profiling`

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95525?v=4)[AmyStephen](/maintainers/AmyStephen)[@AmyStephen](https://github.com/AmyStephen)

---

Top Contributors

[![AmyStephen](https://avatars.githubusercontent.com/u/95525?v=4)](https://github.com/AmyStephen "AmyStephen (124 commits)")

### Embed Badge

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

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

PHPackages © 2026

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