PHP library to collect and manipulate gettext (.po, .mo, .php, .json, etc)

Overview

Gettext

Latest Version on Packagist Software License ico-ga Total Downloads

Note: this is the documentation of the new 5.x version. Go to 4.x branch if you're looking for the old 4.x version

Created by Oscar Otero http://oscarotero.com [email protected] (MIT License)

Gettext is a PHP (^7.2) library to import/export/edit gettext from PO, MO, PHP, JS files, etc.

Installation

composer require gettext/gettext

Classes and functions

This package contains the following classes:

  • Gettext\Translation - A translation definition
  • Gettext\Translations - A collection of translations (under the same domain)
  • Gettext\Scanner\* - Scan files to extract translations (php, js, twig templates, ...)
  • Gettext\Loader\* - Load translations from different formats (po, mo, json, ...)
  • Gettext\Generator\* - Export translations to various formats (po, mo, json, ...)

Usage example

use Gettext\Loader\PoLoader;
use Gettext\Generator\MoGenerator;

//import from a .po file:
$loader = new PoLoader();
$translations = $loader->loadFile('locales/gl.po');

//edit some translations:
$translation = $translations->find(null, 'apple');

if ($translation) {
    $translation->translate('Mazá');
}

//export to a .mo file:
$generator = new MoGenerator();
$generator->generateFile($translations, 'Locale/gl/LC_MESSAGES/messages.mo');

Translation

The Gettext\Translation class stores all information about a translation: the original text, the translated text, source references, comments, etc.

use Gettext\Translation;

$translation = Translation::create('comments', 'One comment', '%s comments');

$translation->translate('Un comentario');
$translation->translatePlural('%s comentarios');

$translation->getReferences()->add('templates/comments/comment.php', 34);
$translation->getComments()->add('To display the amount of comments in a post');

echo $translation->getContext(); // comments
echo $translation->getOriginal(); // One comment
echo $translation->getTranslation(); // Un comentario

// etc...

Translations

The Gettext\Translations class stores a collection of translations:

use Gettext\Translations;

$translations = Translations::create('my-domain');

//You can add new translations:
$translation = Translation::create('comments', 'One comment', '%s comments');
$translations->add($translation);

//Find a specific translation
$translation = $translations->find('comments', 'One comment');

//Edit headers, domain, etc
$translations->getHeaders()->set('Last-Translator', 'Oscar Otero');
$translations->setDomain('my-blog');

Loaders

The loaders allows to get gettext values from any format. For example, to load a .po file:

use Gettext\Loader\PoLoader;

$loader = new PoLoader();

//From a file
$translations = $loader->loadFile('locales/en.po');

//From a string
$string = file_get_contents('locales2/en.po');
$translations = $loader->loadString($string);

This package includes the following loaders:

  • MoLoader
  • PoLoader

And you can install other formats with loaders and generators:

Generators

The generators export a Gettext\Translations instance to any format (po, mo, etc).

use Gettext\Loader\PoLoader;
use Gettext\Generator\MoGenerator;

//Load a PO file
$poLoader = new PoLoader();

$translations = $poLoader->loadFile('locales/en.po');

//Save to MO file
$moGenerator = new MoGenerator();

$moGenerator->generateFile($translations, 'locales/en.mo');

//Or return as a string
$content = $moGenerator->generateString($translations);
file_put_contents('locales/en.mo', $content);

This package includes the following generators:

  • MoGenerator
  • PoGenerator

And you can install other formats with loaders and generators:

Scanners

Scanners allow to search and extract new gettext entries from different sources like php files, twig templates, blade templates, etc. Unlike loaders, scanners allows to extract gettext entries with different domains at the same time:

use Gettext\Scanner\PhpScanner;
use Gettext\Translations;

//Create a new scanner, adding a translation for each domain we want to get:
$phpScanner = new PhpScanner(
    Translations::create('domain1'),
    Translations::create('domain2'),
    Translations::create('domain3')
);

//Set a default domain, so any translations with no domain specified, will be added to that domain
$phpScanner->setDefaultDomain('domain1');

//Extract all comments starting with 'i18n:' and 'Translators:'
$phpScanner->extractCommentsStartingWith('i18n:', 'Translators:');

//Scan files
foreach (glob('*.php') as $file) {
    $phpScanner->scanFile($file);
}

//Get the translations
list('domain1' => $domain1, 'domain2' => $domain2, 'domain3' => $domain3) = $phpScanner->getTranslations();

This package does not include any scanner by default. But there are some that you can install:

Merging translations

You will want to update or merge translations. The function mergeWith create a new Translations instance with other translations merged:

$translations3 = $translations1->mergeWith($translations2);

But sometimes this is not enough, and this is why we have merging options, allowing to configure how two translations will be merged. These options are defined as constants in the Gettext\Merge class, and are the following:

Constant Description
Merge::TRANSLATIONS_OURS Use only the translations present in $translations1
Merge::TRANSLATIONS_THEIRS Use only the translations present in $translations2
Merge::TRANSLATION_OVERRIDE Override the translation and plural translations with the value of $translation2
Merge::HEADERS_OURS Use only the headers of $translations1
Merge::HEADERS_REMOVE Use only the headers of $translations2
Merge::HEADERS_OVERRIDE Overrides the headers with the values of $translations2
Merge::COMMENTS_OURS Use only the comments of $translation1
Merge::COMMENTS_THEIRS Use only the comments of $translation2
Merge::EXTRACTED_COMMENTS_OURS Use only the extracted comments of $translation1
Merge::EXTRACTED_COMMENTS_THEIRS Use only the extracted comments of $translation2
Merge::FLAGS_OURS Use only the flags of $translation1
Merge::FLAGS_THEIRS Use only the flags of $translation2
Merge::REFERENCES_OURS Use only the references of $translation1
Merge::REFERENCES_THEIRS Use only the references of $translation2

Use the second argument to configure the merging strategy:

$strategy = Merge::TRANSLATIONS_OURS | Merge::HEADERS_OURS;

$translations3 = $translations1->mergeWith($translations2, $strategy);

There are some typical scenarios, one of the most common:

  • Scan php templates searching for entries to translate
  • Complete these entries with the translations stored in a .po file
  • You may want to add new entries to the .po file
  • And also remove those entries present in the .po file but not in the templates (because they were removed)
  • But you want to update some translations with new references and extracted comments
  • And keep the translations, comments and flags defined in .po file

For this scenario, you can use the option Merge::SCAN_AND_LOAD with the combination of options to fit this needs (SCAN new entries and LOAD a .po file).

$newEntries = $scanner->scanFile('template.php');
$previousEntries = $loader->loadFile('translations.po');

$updatedEntries = $newEntries->mergeWith($previousEntries);

More common scenarios may be added in a future.

Contributors

Thanks to all contributors specially to @mlocati.


Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.

Issues
  • Add test for some PHP special chars

    Add test for some PHP special chars

    Let's consider this source code:

    <div>
        <p><?php __('plain'); ?></p>
        <p><?php __('DATE \a\t TIME'); ?></p>
        <p><?php __("DATE \a\\t TIME"); ?></p>
        <p><?php __("DATE \\a\\t TIME"); ?></p>
        <p><?php __("FIELD\tFIELD"); ?></p>
    </div>
    

    Here we have only 3 different strings, but the php extractor finds these strings:

    msgid "plain"
    msgstr ""
    
    msgid "DATE \\a\\t TIME"
    msgstr ""
    
    msgid "DATE \\a\\\\t TIME"
    msgstr ""
    
    msgid "DATE \\\\a\\\\t TIME"
    msgstr ""
    
    msgid "FIELD\\tFIELD"
    msgstr ""
    
    opened by mlocati 20
  • Native (GettextTranslator) translator does not work with php 5.5

    Native (GettextTranslator) translator does not work with php 5.5

    Hi guys.

    I have one problem with your project and php ver. 5.5. When i used 5.3 or 5.4 - all works fine, but when i updated php to 5.5 - native translator (class GettextTranslator, vendor\gettext\gettext\src\GettextTranslator.php) stop working for me. If i use php Translator (vendor\gettext\gettext\src\Translator.php) - all is ok again, but i need exactly in native translator.

    Test string:

    Original string: Контакты
    Translated string (en): Contacts
    Translated string (de): Kontakte
    

    Files structure:

    index.php
    data
      \- locales
         \- de
            \- LC_MESSAGES
               |- messages.mo
               \- messages.po
         \- en
            \- LC_MESSAGES
               |- messages.mo
               \- messages.po
    

    Test code:

    $translator = new \Gettext\GettextTranslator();
    $translator->setLanguage('de')->loadDomain(
      'messages',
      'data/locales'
    );
    die($translator->gettext('Контакты'));
    

    First test:

    $ php -v
    PHP 5.4.45 (cli) (built: Sep  2 2015 23:48:30)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    

    Output:

    Kontakte
    

    All is ok. Second test:

    $ php -v
    PHP 5.5.33 (cli) (built: Mar  2 2016 15:19:21)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    

    Output:

    Контакты
    

    My string is not translated. Test code was not changed.

    Gettext installed by composer and source has no any changes by me:

    {
      "require": {
        "php": ">=5.5",
        "gettext/gettext": "3.*@dev",
      },
    }
    

    Server software:

    • Apache 2.4
    • PHP 5.3, 5.4, 5.5
    • Windows

    Can you fix this or say me how can i do it?

    opened by tarampampam 16
  • Empty translation prepends generated PO

    Empty translation prepends generated PO

    When generating PO files, this line always prepends an empty translation:

    msgid ""
    msgstr ""
    "Project-Id-Version: \n"
    "Report-Msgid-Bugs-To: \n"
    ...
    

    Because of this, if I have an empty text in my gettext or __ function, e.g. __(''), it will be replaced by Project-Id-Version: Report-Msgid-Bugs-To: ... and the entire header.

    What is the purpose of this empty translation? Can it be removed?

    opened by marcandrews 15
  • WIP: Twig AST extractor for Timber

    WIP: Twig AST extractor for Timber

    Current Twig parser operates by

    1. Transforming Twig as PHP code = tokenize() + parse() + render()
    2. Using a PhpCode extractor (and its specific configuration about function name)

    The disadvantages are:

    • Twig rendered PHP code can be transformed/wrapped in call_user_func() making that gettext functions undetectable by PhpCode extractor. (See for example timber/timber#1753).
    • Can't handle templates making use of custom Twig extensions (very common)

    This patchset implements an extractor that:

    • Parses Twig generated AST tree (= tokenize()+parse())
    • Recursively iterates over node three to find function gettext calls.

    Advantages:

    • Operating sooner, at the AST level, Twig expressions like {{ __("foo", "domain") }} aren't yet wrapped.
    • More robust because it directly iterates over the AST from Twig parser instead of looking at PHP source-code.
    • Supports initialized $twig environment, thus supporting user-defined extensions?
    • Possibly more efficient.

    ToDos:

    1. $options['twig'] being a static variable, we can NOT initialize it in a row with different parameters. Would get a LogicException: Unable to add function "action" as extensions have already been initialized. Solution: don't use static variables for this.

    2. Translation/Notes comments are not yet supported.

    3. Timber needs a tweak to avoid a fatal error: Add, to lib/Timber.php

      function add_action() { }
      function apply_filters() {}
    

    The issue is that when loaded through composer Timber constructor forcefully calls init() which make use of WP functions.

    opened by drzraf 15
  • Added \r to \Gettext\Generators\Po::convertString()

    Added \r to \Gettext\Generators\Po::convertString()

    First step to fix #218

    opened by vaites 14
  • Plural rules definition

    Plural rules definition

    @oscarotero Could you wait a few days before publishing a new release? IMHO some of the plural rules that we took from http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html are not correct. I discovered two discrepancies but it seems that nobody is taking care of them, so IMHO that repository is not well maintained. I'm going to write a script that takes the rules from CLDR and converts them to gettext. It's not that easy, since CLDR rules refer to decimals and negative numbers, whereas gettext works with unsigned integers, but I'm working on it.

    opened by mlocati 13
  • Comments extraction from PHP code

    Comments extraction from PHP code

    Follow-up of #100: what about a code like this?

    opened by mlocati 13
  • Faster extraction

    Faster extraction

    When adding string to the Translations instance, we call Translations::offsetSet that in turns calls Translation:is many times. If we load 5.000 strings, its inner cycle calls Translation:is 12.497.500 times (5000*(5000-1)/2). What about adding an option to skip this check?

    With the code of this pull request, the checks are skipped by default for the .po and .mo importers (but it's configurable by writing Gettext\Extractors\Mo::$skipIntegrityChecksOnImport.

    opened by mlocati 13
  • Extraction of variables and concatenated strings

    Extraction of variables and concatenated strings

    I run a few tests again a PHP project with ~4300 translatable strings, comparing the results of xgettext and those of the PhpCode extractor.

    I only found two problems:

    1. xgettext (correctly) does not extracts strings like the me in __($avoid['me']). I think that the correct solution would be to do not extract strings with variables (since it does not have any sense), but gettext stops as soon as it find a variable (for instance from __('Stop at the variable'.$var.'!') it extracts Stop at the variable) - so I'd adopt this same approach for consistency.

    2. Consider this example:

    __(
      'line1'
     .' line2')
    

    xgettext (correctly) extracts 'line1 line2', but the PhpCode extractor only extracts 'line1'.

    I added some tests here to highlight the above problems.

    opened by mlocati 13
  • Add support for XLIFF unit IDs

    Add support for XLIFF unit IDs

    This is the "least-invasive" way to add unit IDs to the existing toolset, without potentially introducing problems with uniqueness (XLIFF doesn't require uniqueness of IDs in any way).

    opened by asmecher 11
  • Gettext doesn`t extract template literals from JS

    Gettext doesn`t extract template literals from JS

    Hi,

    in version 4.6.1 library work fine with extracting translations from template literals in JS files, but after upgrade to 4.8 library doesnt extract translations from template literals for example new version doesnt extract "Foo" from string Text ${__("Foo")} bar but older version does.

    Unfortunately I didn`t found solution or some clues to resolve this problem...

    Thanks for response.

    opened by DaweTaller 1
  • How to load multiple *.mo files (general and for specific textdomain)

    How to load multiple *.mo files (general and for specific textdomain)

    First of all, thank you for a library. Second, I don't know how to load multiple *.mo translation files and use them with textdomain context.

    This is my code so far:

    use Gettext\Translator;
    use Gettext\Loader\MoLoader;
    
    $lang = 'sk' // set by a side function
    define('ROOT', '/path/to/root');
    
    function __( string $string, string $textdomain = null ) {
    
        static $t = null;
    
        global $basic_lang;
    
        $translation = ROOT . '/languages/' . $lang . '.mo';
    
        if (!file_exists( $translation )) {
            return $string;
        }
    
        if ($t === null) {
    
            $loader = new MoLoader();
            $t = Translator::createFromTranslations( $loader->loadFile( $translation ) );
        }
    
        //return $textdomain ? $t->dgettext( $textdomain, $string ) : $t->gettext( $string );
        return $t->gettext( $string );
    
    }
    
    //echo __( 'Buy a ticket', 'reservation' ); // does not work right now, how to make it work?
    echo __( 'Buy a ticket' ); // works
    

    I guess that mode code samples would be helpful for others too.

    opened by jasomdotnet 3
  • Why PHP >= 7.2 for Gettext v5?

    Why PHP >= 7.2 for Gettext v5?

    As per https://github.com/wp-cli/i18n-command/pull/217, WP-Cli i18n-command still use v4 (which does not provide Twig scanner, among others) because it stick to package supporting PHP 5.6. What is itself a consequence of wp-cli requirements regarding WP core which tend to support old version of PHP for a long time.

    I wonder why exactly, in October 2019, f6ca83d7d7c6 bumped the mimimum requirements to PHP 7.2? Isn't the codebase/testsuite compatible with PHP 5.6 at all? And if it is, is lowering the min version back to 5.6 feasible?

    opened by drzraf 1
  • Relative strings location path

    Relative strings location path

    Following the discussion in #256.

    This addresses #208.

    opened by Arzaroth 1
  • Update Scanner.php

    Update Scanner.php

    handled generated notice on php 7.4 if its not file by by insuring it should be file, which further generate fatal error as fread returns false.

    opened by vinodraut 2
  • How to print string translation from object created by MO loader

    How to print string translation from object created by MO loader

    Hi, I have been able to load translation.mo with MO loader. Now, how to print translation of string from object created by MO loader, something like:

    echo $translations->gettext('Hello world!', 'optional-textdomain');

    With my current knowledge I was not able to figure out from documentation. Is it possible?

    opened by jasomdotnet 9
  • PHP Brackets in function parameter

    PHP Brackets in function parameter

    If you use brackets in function parameter PHPFunctionsScanner will interpret this as a new function and the resulting parameter list is incorrect.

    Example:

    <?php
    
    require_once 'vendor/autoload.php';
    
    $quantity = 10;
    $default = 5;
    
    $string = <<<EOD
    <?php
    sprintf(_n("%d Comment", "%d Comments", ($quantity ?? $default), "domain"), ($quantity ?? $default));
    EOD;
    
    $scanner = new \Gettext\Utils\PhpFunctionsScanner($string);
    $output = $scanner->getFunctions();
    

    and output:

    array(2) {
      [0]=>
      array(4) {
        [0]=>
        string(2) "_n"
        [1]=>
        int(2)
        [2]=>
        array(3) {
          [0]=>
          string(10) "%d Comment"
          [1]=>
          string(11) "%d Comments"
          [2]=>
          NULL
        }
        [3]=>
        NULL
      }
      [1]=>
      array(4) {
        [0]=>
        string(7) "sprintf"
        [1]=>
        int(2)
        [2]=>
        array(2) {
          [0]=>
          NULL
          [1]=>
          string(6) "domain"
        }
        [3]=>
        NULL
      }
    }
    

    as you can see "domain" is associated with sprintf function which is not true.

    opened by kdabek 1
  •  Sort output option added to Po generator

    Sort output option added to Po generator

    Separated pull request as requested ;)

    opened by vaites 0
  • Duplicate translations with different XLIFF unit IDs are not maintained

    Duplicate translations with different XLIFF unit IDs are not maintained

    This is a knock-on issue from https://github.com/oscarotero/Gettext/issues/220. (I hope you won't regret adding that already!)

    An XLIFF file may contain several units with the same translation content... (silly example but you get the point)

    <unit id="am.permanently">
      <segment>
        <source>am</source>
        <target>soy</target>
      </segment>
    </unit>
    <unit id="am.temporarily">
      <segment>
        <source>am</source>
        <target>estoy</target>
      </segment>
    </unit>
    

    However, when loading the translation from the XLIFF file, only one gets loaded into $translations. This is because the two will have the same ID, based only on the source text ("am"), without considering the unit ID.

    Thus trying to save the loaded XLIFF again will drop one of the two entries.

    opened by asmecher 10
  • Problem with new lines and PO files

    Problem with new lines and PO files

    We found a problem with new lines and PO files possibly related with #192. Here's an example code:

    use Gettext\Translations;
    
    $translations = new Translations;
    $translations->setLanguage('en');
    
    // add a translation with \n 
    $translation1 = $translations->insert(null, 'test1');
    $translation1->setTranslation("Lorem\nipsum");
    
    // add a translation with \r\n 
    $translation2 = $translations->insert(null, 'test2');
    $translation2->setTranslation("Lorem\r\nipsum");
    
    $translations->toPoFile('test.po');
    

    If you open the po file with PoEdit the second translation is not processed and shows as empty (no error thrown) and other tools like PhpStorm shows an error (Msgid keyword expected). If you convert \r to its representation like \t or \n these tools works ok.

    In the other hand, if you compile the file to mo with msgfmt command there's no error and this library parses it without problems, keeping the \r\n. This means that gettext doesn't care about the format of line breaks, but it does cause problems with certain tools.

    I think \r must be added to Gettext\Generators\Po::convertString() to propertly scape it but don't know enough about gettext to understand the side effects of this change.

    There are more options... Should this library unify the format of line breaks to avoid problems with certain tools or at least warn if a string is added using line breaks different from the existing ones? O maybe an option to save to po files?. I'm not sure, because I understand that this library (as gettext does) doesn't care about the contents...

    To conclude, gettext uses only \n to detect new lines:

    A string goes multi-line if and only if it has embedded newlines, that is, if it matches ‘[^\n]\n+[^\n]’

    opened by vaites 3
Releases(v5.6.1)
Owner
Gettext
PHP implementation of gettext
Gettext
🗓 A library to help you work with dates in multiple languages, based on Carbon.

Date This date library extends Carbon with multi-language support. Methods such as format, diffForHumans, parse, createFromFormat and the new timespan

Jens Segers 1.8k Jan 5, 2022
[virion] Language management library for automatic translation

libtranslator :: library for automatic translation ✔️ Multilingual support for plugin messages ✔️ Translation language is set according to the player

PocketMine-MP projects of PresentKim 1 Oct 23, 2021
List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Cashier and Laravel Nova.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

Laravel Lang 6.3k Jan 15, 2022
Provides support for message translation and localization for dates and numbers.

The I18n library provides a I18n service locator that can be used for setting the current locale, building translation bundles and translating messages. Additionally, it provides the Time and Number classes which can be used to output dates, currencies and any numbers in the right format for the specified locale.

CakePHP 24 Oct 2, 2021
A morphological solution for Russian and English language written completely in PHP.

Morphos A morphological solution for Russian and English language written completely in PHP. Tests & Quality: Features [✓] Inflection of Personal name

Sergey 680 Jan 10, 2022
Easy multilingual urls and redirection support for the Laravel framework

Linguist - Multilingual urls and redirects for Laravel This package provides an easy multilingual urls and redirection support for the Laravel framewo

Tanel Tammik 188 Dec 26, 2021
Automatically translate and review your content via Lokalise

This extension will work as a bridge between Pimcore and Lokalise for the purpose of automating the whole translation workflow. Thus eliminating most of the manual steps in the task along with availing quality translation-review service from Lokalise.

Pravin chaudhary 6 Jan 10, 2022
A convenience package for php multilingual web applications

PHP Translation Install Lifecycle Configuration Content of PHP File Content of Json File Content Of Database Table Use Of Array Or Json Database PHP T

Ahmet Barut 2 Sep 27, 2021
MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way. ( WEBSITE VERSION )

Mysql Optimizer mysql optimizer also known as MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query

null 2 Nov 28, 2021
MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way

Mysql Optimizer mysql optimizer also known as MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query

null 2 Nov 20, 2021
This is a PHP library developed for Symfony to collect address information.

Goldbach Algorithms Address Info Getter (fondly nicknamed AIG) is a PHP library developed for Symfony to collect address information.

Goldbach Algorithms 1 Nov 3, 2021
:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects

sabre/vobject The VObject library allows you to easily parse and manipulate iCalendar and vCard objects using PHP. The goal of the VObject library is

sabre.io 508 Jan 11, 2022
allourideas allows groups to collect and priorize information in an open, democratic, and efficient process.

All Our Ideas All Our Ideas 2.0. This codebase runs two sites photocracy.org and allourideas.org. The allourideas.org project provides the user-facing

All Our Ideas 149 Nov 19, 2021
🕵️ Inspect Laravel Eloquent models to collect properties, relationships and more.

??️ Eloquent Inspector Inspect Laravel Eloquent models to collect properties, relationships and more. Install Via Composer composer require cerbero/el

Andrea Marco Sartori 13 Jan 18, 2022
The list of all Algerian provinces and cities according to the official division in different formats: csv, xlsx, php, json, etc.

algeria-cities This repository contains the list of all the administrative provinces and cities in Algeria. The data is up-to-date according to the of

Ramtani Othmane 304 Jan 5, 2022
Sri Lanka Grade Exam Results Bot 📚 can collect Grade 5 O/L A/L Exam Results 📚 in Second Powerd By Sri lanka Department Of Examination 🚀

Sri-Lanka-Exam-Results-Telegram-Bot How to use the bot /start : Start Sri Lanka Grade 5 O/L A/L Exam Results Bot. /help : More information about Sri L

GD Hiruna 8 Jan 8, 2022
A simple library to work with JSON Web Token and JSON Web Signature

JWT A simple library to work with JSON Web Token and JSON Web Signature based on the RFC 7519. Installation Package is available on Packagist, you can

Luís Cobucci 6.5k Jan 16, 2022
Simplexcel.php - Easily read / parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc spreadsheet tabular file formats

Simple Excel Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats For further deatails see the GitHuib P

Faisal Salman 538 Jan 14, 2022
Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

Support I am a dad now for the last 1,5 years and that clearly shows in being on time with merging PRs or pushing this package further. Time is the bi

Tino Ehrich 923 Jan 10, 2022
A set of classes to create and manipulate HTML objects abstractions

HTMLObject HTMLObject is a set of classes to create and manipulate HTML objects abstractions. Static calls to the classes echo Element::p('text')->cla

Emma Fabre 129 Nov 6, 2021
These are simple array and object collections that provide convinient methods to manipulate them.

Simple Collections These are simple array and object collections that provide convinient methods to manipulate collections; To install this package ty

Artem 4 Nov 19, 2021
This package was created to provide simple way to manipulate arrays in PHP

PHP Collections This package was created to provide simple way to manipulate arrays in PHP. The package was inspired by the Laravel Collections.

Wojciech Mleczek 13 Jul 26, 2021
Simple & secure helper to manipulate arrays in various ways

Array helper Simple & secure helper to manipulate arrays in various ways, especially for multidimensional arrays Forget about checking for existing ke

Gurukami 28 Apr 22, 2020
A series of methods that let you manipulate colors. Just incase you ever need different shades of one color on the fly.

PHPColors A series of methods that let you manipulate colors. Just incase you ever need different shades of one color on the fly. Requirements PHPColo

Arlo Carreon 397 Dec 30, 2021
Allows generate class files parse from json and map json to php object, including multi-level and complex objects;

nixihz/php-object Allows generate class files parse from json and map json to php object, including multi-level and complex objects; Installation You

zhixin 1 Oct 29, 2021
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

DeviceDetector Code Status Description The Universal Device Detection library that parses User Agents and detects devices (desktop, tablet, mobile, tv

Matomo Analytics 2.1k Jan 10, 2022
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

DeviceDetector Code Status Description The Universal Device Detection library that parses User Agents and detects devices (desktop, tablet, mobile, tv

Matomo Analytics 2.1k Jan 20, 2022
PHP 7+ Payment processing library. It offers everything you need to work with payments: Credit card & offsite purchasing, subscriptions, payouts etc. - provided by Forma-Pro

Supporting Payum Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our

Payum 1.7k Jan 12, 2022