Skip to content

Commit

Permalink
Preparing for standalone component
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydiablo committed Jun 3, 2018
1 parent 755208b commit b4d7b40
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor
/composer.lock
/clover.xml
51 changes: 51 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
language: php

sudo: false

php:
- 7
- 7.1
- 7.2
- nightly

env: TMPDIR=/tmp USE_XDEBUG=false

branches:
only:
master

before_install:
- travis_retry composer self-update

install:
- phpenv rehash
- travis_retry composer install --no-interaction --prefer-source

stages:
- test
- phpstan analysis
- test with coverage

before_script:
- if [[ "$USE_XDEBUG" == false ]]; then phpenv config-rm xdebug.ini || return 0; fi

script:
- composer test

jobs:
fast_finish: true
allow_failures:
- php: nightly
include:
- stage: phpstan analysis
php: 7.1
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer phpstan
- stage: test with coverage
php: 7.1
env: TMPDIR=/tmp USE_XDEBUG=true
script:
- composer test-with-coverage
after_success:
- bash <(curl -s https://codecov.io/bash) -f ./clover.xml
27 changes: 27 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2005-2015, Zend Technologies USA, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of Zend Technologies USA, Inc. nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Zend Framework 1 - Translate
============================
[![Build Status](https://travis-ci.org/diablomedia/zf1-translate.svg?branch=master)](https://travis-ci.org/diablomedia/zf1-translate)
[![codecov](https://codecov.io/gh/diablomedia/zf1-translate/branch/master/graph/badge.svg)](https://codecov.io/gh/diablomedia/zf1-translate)
[![Latest Stable Version](https://poser.pugx.org/diablomedia/zendframework1-translate/v/stable)](https://packagist.org/packages/diablomedia/zendframework1-translate)
[![Total Downloads](https://poser.pugx.org/diablomedia/zendframework1-translate/downloads)](https://packagist.org/packages/diablomedia/zendframework1-translate)
[![License](https://poser.pugx.org/diablomedia/zendframework1-translate/license)](https://packagist.org/packages/diablomedia/zendframework1-translate)

This is just the Zend_Translate component extracted from our fork of the Zend Framework 1 repo (https://github.com/diablomedia/zf1).
47 changes: 47 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "diablomedia/zendframework1-translate",
"description": "Zend Framework 1 Translate component",
"type": "library",
"keywords": [
"framework",
"zf1"
],
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.0.0",
"diablomedia/zendframework1-exception": "^1.0.0",
"diablomedia/zendframework1-config": "^1.0.0",
"diablomedia/zendframework1-loader": "^1.0.0",
"diablomedia/zendframework1-cache": "dev-master",
"diablomedia/zendframework1-locale": "dev-master",
"diablomedia/zendframework1-log": "dev-master"
},
"autoload": {
"psr-0": {
"Zend_": "src/"
}
},
"autoload-dev": {
"psr-0": {
"Zend_": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpstan/phpstan": "^0.9.2"
},
"include-path": [
"src/"
],
"archive": {
"exclude": ["/tests"]
},
"scripts": {
"test": "phpunit ./tests",
"test-with-coverage": "phpunit --coverage-clover=clover.xml ./tests",
"phpstan": "phpstan analyze -l7 -c phpstan.neon --no-progress ./src ./tests --ansi"
}
}
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors:
14 changes: 14 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<phpunit
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
beStrictAboutTestsThatDoNotTestAnything="true"
backupGlobals="true"
stderr="true"
colors="true">
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:4:{s:4:"hash";i:2616152583;s:5:"mtime";i:1521741383;s:6:"expire";i:1521741503;s:4:"tags";a:0:{}}
1 change: 1 addition & 0 deletions tests/Zend/Translate/Adapter/_files/zend_cache---testid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
s:8:"testdata";
1 change: 0 additions & 1 deletion tests/Zend/TranslateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ public function testZF3679()
{
require_once 'Zend/Locale.php';
$locale = new Zend_Locale('de_AT');
require_once 'Zend/Registry.php';
Zend_Registry::set('Zend_Locale', $locale);

$lang = new Zend_Translate(Zend_Translate::AN_ARRAY, array('msg1' => 'message1'), 'de_AT');
Expand Down

0 comments on commit b4d7b40

Please sign in to comment.