2017 © Pedro Peláez
 

library webino-name-day-lib

Name day Library

image

webino/webino-name-day-lib

Name day Library

  • Monday, February 24, 2014
  • by Webino
  • Repository
  • 1 Watchers
  • 1 Stars
  • 926 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Webino Name Day Library

Build Status Build Status, (*1)

Provides API to resolve name day. Still under development. (currently only Slovak), (*2)

Features

  • Today and tomorrow name day according to the date
  • Reverse resolving, name day date for a name
  • Holy day flag

Setup

Following steps are necessary to get this library working:, (*3)

  1. Add "minimum-stability": "dev" to your composer.json, because this lib is under development, (*4)

  2. Run php composer.phar require webino/webino-name-day-lib:dev-develop, (*5)

Requirements

  • PHP 5.3

QuickStart

    // Create the name day service
    $locale  = 'sk_SK';
    $factory = new \WebinoNameDayLib\Factory;
    $nameDay = $factory->create($locale);

    // Get the name day
    $result = $nameDay->today();

    // Holy day logic (optional)
    if ($result->isHolyDay()) {
        $text = 'Today is';
    } else {
        $text = 'Name-day today celebrating';
    }

    // Name day of the day
    $result->getName();

    // Get tomorrow name day
    $result = $nameDay->tomorrow();

    // Get today & tomorrow name day
    $arrayOfResults = $nameDay->combo();

Functions

The service

  • NameDayResult today($date = 'now')
  • NameDayResult tomorrow($date = 'now')
  • array[NameDayResult, NameDayResult] combo($date = 'now')
  • DateTime nameDate($name)
  • DateTime nearestNameDate($name)

The result

  • string getName()
  • bool isHolyDay()

Develop

Requirements, (*6)

  • Linux (recommended)
  • NetBeans (optional)
  • Phing
  • PHPUnit

Setup, (*7)

  1. Clone this repository and run: phing update, (*8)

    Now your development environment is set., (*9)

  2. Open project in the (NetBeans) IDE, (*10)

Adding region names, (*11)

  1. Look at the \WebinoNameDayLib\Region\Sk
  2. It's best to extend \WebinoNameDayLib\Region\AbstractNames

Testing, (*12)

  • Run phpunit in the test directory
  • Run phing test in the module directory to run the tests and code insights, (*13)

    NOTE: To run the code insights there are some tool requirements., (*14)

Todo

  • Add Czech names
  • Add other nation names
  • Tests for nameDate() & nearesetNameDate()

Addendum

Please, if you are interested in this library report any issues and don't hesitate to contribute., (*15)

The Versions

24/02 2014

dev-develop

dev-develop https://github.com/webino/WebinoNameDayLib.git

Name day Library

  Sources   Download

The Requires

  • php >=5.3.3

 

name day lib webino