Compare commits

...

5 Commits

Author SHA1 Message Date
Abel Hoogeveen 17f4bae3d0 Integrated Latte 3 into FuzeWorks. 2023-03-27 16:48:07 +02:00
Abel Hoogeveen 99b24155d3
Upgraded libraries and added objectstorage. 2021-11-29 23:06:37 +01:00
Abel Hoogeveen 2c0ce5bb43
Upgraded dependencies, upped LICENSE, removed testing framework.
WebAppComponent is a simple wrapper. Nothing more.
2021-01-25 12:35:10 +01:00
Abel Hoogeveen c5621f452f
Release 1.2.0 2019-09-21 23:47:43 +02:00
Abel Hoogeveen 348f61a10d
Release 1.2.0-RC5 2019-09-18 00:25:42 +02:00
14 changed files with 42 additions and 327 deletions

2
.gitignore vendored
View File

@ -5,4 +5,4 @@ build/
test/temp/
vendor/
application/
www/
www/

View File

@ -1,82 +0,0 @@
before_script:
# Install dependencies
- set -xe
- apt-get update -yqq
- apt-get install git zip unzip -yqq
stages:
- build
- test
- deploy
build:composer:
image: php:7.2
stage: build
script:
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor/
test:7.1:
stage: test
image: php:7.1
script:
- vendor/bin/phpunit -c test/phpunit.xml
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor
test:7.2:
stage: test
image: php:7.2
script:
- vendor/bin/phpunit -c test/phpunit.xml
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor/
test:7.3:
stage: test
image: php:7.3
script:
- vendor/bin/phpunit -c test/phpunit.xml
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor/
test:coverage:
stage: test
image: php:7.2
script:
- pecl install xdebug
- docker-php-ext-enable xdebug
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor/
release:
stage: deploy
image: php:7.2
only:
- master
script:
- pecl install xdebug
- docker-php-ext-enable xdebug
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text
artifacts:
name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}"
paths:
- build/
expire_in: 3 weeks
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor/

View File

@ -1,12 +0,0 @@
language: php
php:
- 7.1
- 7.2
- 7.3
script:
- php vendor/bin/phpunit -v -c test/phpunit.xml --coverage-text
before_script:
- composer install

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2013-2019 TechFuze
Copyright (c) 2013-2021 TechFuze
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
FuzeWorks::WebApp Component - Readme
===================
Version 1.2.0
Version 1.3.0
A versatile PHP Framework built to perform.

View File

@ -4,33 +4,23 @@
"license": ["MIT"],
"authors": [
{
"name": "TechFuze",
"homepage": "https://techfuze.net"
},
{
"name": "FuzeWorks Community",
"homepage": "https://techfuze.net/fuzeworks/contributors"
"name": "Abel Hoogeveen",
"homepage": "https://i15.nl"
}
],
"require": {
"php": ">=7.1.0",
"fuzeworks/core": "1.2.0-RC4",
"fuzeworks/mvcr": "1.2.0-RC4",
"fuzeworks/webcomponent": "1.2.0-RC4",
"fuzeworks/tracycomponent": "1.2.0-RC4",
"fuzeworks/layout": "1.2.0-RC4",
"fuzeworks/database": "1.2.0-RC4",
"smarty/smarty": "3.1.*",
"latte/latte": "2.5.*",
"php": ">=8.1.0",
"fuzeworks/webcomponent": "~1.3.0",
"fuzeworks/objectstorage": "~1.3.0",
"fuzeworks/tracycomponent": "~1.3.0",
"fuzeworks/layout": "~1.3.0",
"fuzeworks/database": "~1.3.0",
"latte/latte": "~3.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^7"
},
"autoload": {
"psr-4": {
"FuzeWorks\\": "src/FuzeWorks/"
}
}
}

View File

@ -31,15 +31,17 @@
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
* @version Version 1.3.0
*/
namespace FuzeWorks;
use FuzeWorks\ObjectStorage\ObjectStorageComponent;
class WebAppComponent implements iComponent
{
protected $willHandleRequest = false;
protected bool $willHandleRequest = false;
public function getName(): string
{
@ -62,6 +64,7 @@ class WebAppComponent implements iComponent
// And add the component
$configurator->addComponent($webComponent);
$configurator->addComponent(new ObjectStorageComponent());
$configurator->addComponent(new DatabaseComponent());
$configurator->addComponent(new LayoutComponent());
$configurator->addComponent(new TracyComponent());

View File

@ -31,7 +31,7 @@
* @link http://techfuze.net/fuzeworks
* @since Version 1.2.0
*
* @version Version 1.2.0
* @version Version 1.3.0
*/
namespace FuzeWorks;
@ -39,4 +39,20 @@ namespace FuzeWorks;
abstract class WebAppController extends WebController
{
/**
* @var Database
*/
protected $databases;
/** @var ObjectStorage\ObjectStorageComponent */
protected $storage;
public function __construct()
{
parent::__construct();
// Load all the requirements for the WebAppController, not yet loaded by any of the parent controller classes
$this->databases = Factory::getInstance('databases');
$this->storage = Factory::getInstance('storage');
}
}

View File

@ -31,24 +31,27 @@
* @link http://techfuze.net/fuzeworks
* @since Version 1.2.0
*
* @version Version 1.2.0
* @version Version 1.3.0
*/
namespace FuzeWorks;
abstract class WebAppModel extends WebModel
{
/**
* @var Layout
* @var Database
*/
protected $databases;
/** @var ObjectStorage\ObjectStorageComponent */
protected $storage;
public function __construct()
{
parent::__construct();
// Load all requirements for the WebAppModel, not yet loaded by parent Model
$this->databases = Factory::getInstance()->databases;
$this->databases = Factory::getInstance('databases');
$this->storage = Factory::getInstance('storage');
}
}

View File

@ -50,7 +50,7 @@ abstract class WebAppView extends WebView
parent::__construct();
// Load all requirements for the WebAppView, not yet loaded by parent Views
$this->layouts = Factory::getInstance()->layouts;
$this->layouts = Factory::getInstance('layouts');
}
}

View File

@ -1,52 +0,0 @@
<?php
/**
* FuzeWorks Framework WebApp Component.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 TechFuze
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
// First set the working directory
chdir(dirname(__DIR__));
// Load composer
require_once(dirname(__DIR__) . '/vendor/autoload.php');
// Load the test abstract
require_once 'webapp/WebAppTestAbstract.php';
// Reset error and exception handlers
restore_error_handler();
restore_exception_handler();
// Display all errors
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);

View File

@ -1,34 +0,0 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
bootstrap="autoload.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
colors="false">
<testsuites>
<testsuite name="Core Functionality">
<directory>./</directory>
</testsuite>
</testsuites>
<logging>
<log type="json" target="../build/phpunit/logfile.json"/>
<log type="junit" target="../build/phpunit/logfile.xml"/>
<log type="testdox-html" target="../build/phpunit/testdox.html"/>
<log type="testdox-text" target="../build/phpunit/testdox.txt"/>
</logging>
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<directory suffix=".php">../</directory>
<exclude>
<directory suffix=".php">../vendor/</directory>
<directory suffix=".php">../test/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

View File

@ -1,57 +0,0 @@
<?php
/**
* FuzeWorks Framework WebApp Component.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 TechFuze
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
use FuzeWorks\WebAppComponent;
class WebAppComponentTest extends WebAppTestAbstract
{
/**
* @var WebAppComponent
*/
protected $component;
public function setUp()
{
$this->component = new WebAppComponent();
}
public function isInstance()
{
$this->assertInstanceOf('\FuzeWorks\WebAppComponent', $this->component);
}
}

View File

@ -1,60 +0,0 @@
<?php
/**
* FuzeWorks Framework WebApp Component.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 TechFuze
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
use FuzeWorks\Events;
use PHPUnit\Framework\TestCase;
use FuzeWorks\Factory;
use FuzeWorks\Core;
/**
* Class WebAppTestAbstract.
*
* Resets core components to their original state
*/
abstract class WebAppTestAbstract extends TestCase
{
/**
* Remove all listeners before the next test starts.
*/
public function tearDown()
{
// Clear all events created by tests
Events::$listeners = array();
// Reset all config files
Factory::getInstance()->config->discardConfigFiles();
}
}