Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Oct 28, 2019
2 parents e6436c1 + b673051 commit 638875a
Show file tree
Hide file tree
Showing 22 changed files with 251 additions and 96 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: DebianPackage

on:
release:
types: [published, created, edited]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
env:
DEBIAN_FRONTEND: "noninteractive"
- name: Prepare Debuild Environment
run: |
echo "deb http://repo.vitexsoftware.cz $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
sudo wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg http://repo.vitexsoftware.cz/keyring.gpg
sudo apt-get update
sudo apt-get install -y aptitude composer exim4 pbuilder ubuntu-dev-tools apt-file debhelper
- name: Build Package
run: debuild-pbuilder
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
env:
DEBIAN_FRONTEND: noninteractive
- name: Prepare Environment
run: |
sudo apt-get update
sudo apt-get install -y composer exim4
composer update
- name: Run tests
run: vendor/bin/phpunit --bootstrap tests/Bootstrap.php --configuration phpunit.xml tests/src/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
/.phpunit.result.cache
/tests/nb-phpunit-coverage.xml
/tests/nb-phpunit-log.xml
/debian/php-ease-html
/debian/php-ease-html-dev.substvars
/debian/php-ease-html-dev.debhelper.log
/debian/.debhelper
/debian/php-ease-html-dev/
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#DESTDIR ?= debian/php-ease-html/DEBIAN
#libdir ?= /usr/share/php/Ease
#libdir ?= /usr/share/php/EaseHtml
#docdir ?= /doc/ease-html/html

all: build install
Expand Down Expand Up @@ -36,9 +36,11 @@ apigen:
composer:
composer update

phpunit:
phpunit: composer
vendor/bin/phpunit --bootstrap tests/Bootstrap.php --configuration phpunit.xml tests/src/

test: phpunit

deb:
dch -i "`git log -1 --pretty=%B`"
debuild -i -us -uc -b
Expand Down
4 changes: 2 additions & 2 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Ease framework Core for Debian
Ease framework HTML for Debian
------------------------------

Is installed by standard way in /usr/share/php/EaseCore
Is installed by standard way in /usr/share/php/EaseHtml

-- Vítězslav Dvořák <[email protected]> Ne říj 21 15:17:56 CEST 2012

14 changes: 12 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
php-ease-html (0.5) UNRELEASED; urgency=medium
php-ease-html (0.15) UNRELEASED; urgency=medium

* First release
* Backported Mailer
* Backported Mailer
* Backported Mailer
* Another Unit tests
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass
* All Tests pass

-- Vítězslav Dvořák <[email protected]> Wed, 02 Oct 2019 22:40:24 +0200
-- Vítězslav Dvořák <[email protected]> Sat, 12 Oct 2019 14:34:53 +0200
14 changes: 12 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Source: php-ease-html
Build-Depends: debhelper (>= 7.0.50~)
Build-Depends: debhelper (>= 7.0.50~), php-ease-core
Section: web
Standards-Version: 3.9.8
Maintainer: Vítězslav Dvořák <[email protected]>
Uploaders: Vitex <[email protected]>
Priority: optional
Homepage: https://github.com/VitexSoftware/ease-html
Homepage: https://github.com/VitexSoftware/php-ease-html

Package: php-ease-html
Depends: ${misc:Depends},libjs-jquery (>= 1.4), php-mail, php-mail-mime, php-ease-core
Expand All @@ -16,3 +16,13 @@ Section: web
Priority: optional
Description: EasePHP Framework HTML support
HTML classes for Ease Framework.

Package: php-ease-html-dev
Depends: ${misc:Depends}, php-ease-core-dev
Architecture: all
Conflicts: ease-framework
Section: devel
Priority: optional
Description: EasePHP Framework HTML unit tests
HTML classes for Ease Framework.

1 change: 0 additions & 1 deletion debian/debhelper-build-stamp

This file was deleted.

2 changes: 0 additions & 2 deletions debian/files

This file was deleted.

3 changes: 3 additions & 0 deletions debian/php-ease-html-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/Ease/* usr/share/php/EaseHtmlTests/
debian/test/composer.json usr/share/php/EaseHtmlTests/
debian/test/Bootstrap.php usr/share/php/EaseHtmlTests/
1 change: 0 additions & 1 deletion debian/php-ease-html.debhelper.log

This file was deleted.

2 changes: 0 additions & 2 deletions debian/php-ease-html.substvars

This file was deleted.

15 changes: 10 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/make -f

PKG_PATH:=/usr/share/php/EaseCore
BUILD_DIR:=build

%:
dh $@

override_dh_auto_test:
echo tests temporarly skipped for now in rules file
override_dh_clean:
rm -rf debian/test/vendor
dh_clean


override_dh_test:
composer --working-dir=debian/test update
phpunit --bootstrap debian/test/Bootstrap.php --configuration phpunit.xml tests/src/
dh_test

override_dh_install:

dh_install
27 changes: 27 additions & 0 deletions debian/test/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Zaváděcí soubor pro provádění PHPUnit testů na EaseFrameworkem.
*
* @author Vitex <[email protected]>
* @copyright 2012-2017 [email protected] (G)
*/

namespace Test\Ease;

require_once __DIR__.'/../vendor/autoload.php';

if ((php_sapi_name() != 'cli') && (session_status() == 'PHP_SESSION_NONE')) {
session_start();
} else {
$_SESSION = [];
}

define('EASE_APPNAME', 'EaseHtmlUnitTest');
define('EASE_LOGGER', 'syslog');


\Ease\Locale::singleton('cs_CZ');

//\Ease\Shared::user(new \Ease\Anonym());
//\Ease\Shared::webPage(new \Ease\WebPage());

42 changes: 42 additions & 0 deletions debian/test/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "deb/ease-html",
"description": "An Core of PHP Framework for Ease of writing Applications (debianized)",
"version": "0.5",
"authors": [
{
"name": "Vítězslav Dvořák",
"email": "[email protected]",
"homepage": "http://v.s.cz/"
}
],
"autoload": {
"psr-4": {
"Ease\\": "\\src\\Ease",
"Ease\\Html\\": "src\\EaseHtml"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Ease\\": [ "/usr/share/php/EaseCoreTests", "tests/src/Ease" ],
"Tests\\Ease\\Html\\": "tests/src/EaseHtml"
}
},
"minimum-stability": "dev",
"require": {
"deb/ease-core": "*"
},

"repositories": [
{
"type": "path",
"url": "/usr/share/php/Ease",
"options": {
"symlink": true
}
}
],

"type": "library",
"homepage": "",
"license": "GPL-2.0+"
}
20 changes: 6 additions & 14 deletions src/Ease/HtmlMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,30 +222,22 @@ public function getContents()
/**
* Obtain item count
*
* @param Container $object
* @return int
*/
public function getItemsCount($object = null)
public function getItemsCount()
{
if (is_null($object)) {
$object = $this->htmlBody;
}
return parent::getItemsCount($object);
return $this->htmlBody->getItemsCount($object);
}

/**
* Is object empty ?
*
* @param Container $element
*
* @return boolean
*/
public function isEmpty($element = null)
public function isEmpty()
{
if (is_null($element)) {
$element = $this->htmlBody;
}
return parent::isEmpty($element);

return $this->htmlBody->isEmpty($element);
}

/**
Expand All @@ -254,7 +246,7 @@ public function isEmpty($element = null)
*/
public function emptyContents()
{
$this->htmlBody = null;
$this->htmlBody->emptyContents();
}

/**
Expand Down
15 changes: 7 additions & 8 deletions src/Ease/WebPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function addToScriptsStack($code, $position = 0)
} else {
$javaScripts[] = $code;
}
} else { //Pozice urcena
} else { //Force Position
if (isset($javaScripts[$position])) { //Uz je obsazeno
if ($javaScripts[$position] == $code) {
return $position;
Expand Down Expand Up @@ -283,13 +283,14 @@ public function includeCss($cssFile, $fwPrefix = false, $media = 'screen')
*
* @return \Ease\Html\DivTag
*/
public function getStatusMessagesAsHtml()
public function getStatusMessagesBlock()
{
$htmlFargment = new Html\DivTag();

foreach (\Ease\Shared::singleton()->getStatusMessages() as $quee => $messages) {
foreach ($messages as $message) {
$htmlFargment->addItem(new Html\DivTag($message,['style'=> Logger\Regent::singleton()->logStyles[$quee] ]));
$htmlFargment->addItem(new Html\DivTag($message,
['style' => Logger\Regent::singleton()->logStyles[$quee]]));
}
}
return $htmlFargment;
Expand Down Expand Up @@ -359,7 +360,6 @@ public function isEmpty($element = null)
return empty($this->body->pageParts);
}


/**
* Vloží jako první element do objektu.
*
Expand All @@ -370,9 +370,9 @@ public function isEmpty($element = null)
*/
public function &addAsFirst($pageItem, $pageItemName = null)
{
return $this->body->addAsFirst($pageItem, $pageItemName);
return $this->body->addAsFirst($pageItem, $pageItemName);
}

/**
* Vrací odkaz na poslední vloženou položku.
*
Expand All @@ -383,7 +383,7 @@ public function &lastItem()
$lastPart = empty($this->body->pageParts) ? null : end($this->body->pageParts);
return $lastPart;
}

/**
* Přidá položku do poslední vložené položky.
*
Expand All @@ -396,7 +396,6 @@ public function addToLastItem($pageItem)
return $this->isEmpty() ? null : end($this->body->pageParts)->addItem($pageItem);
}


/**
* Vyprázní obsah webstránky
* Empty webpage contents
Expand Down
Loading

0 comments on commit 638875a

Please sign in to comment.