Compare commits
No commits in common. "master" and "1.2.0-RC4" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,4 +5,4 @@ build/
|
|||||||
test/temp/
|
test/temp/
|
||||||
vendor/
|
vendor/
|
||||||
application/
|
application/
|
||||||
www/
|
www/
|
||||||
|
82
.gitlab-ci.yml
Normal file
82
.gitlab-ci.yml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
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/
|
12
.travis.yml
Normal file
12
.travis.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2013-2021 TechFuze
|
Copyright (c) 2013-2019 TechFuze
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FuzeWorks::WebApp Component - Readme
|
FuzeWorks::WebApp Component - Readme
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Version 1.3.0
|
Version 1.2.0
|
||||||
|
|
||||||
A versatile PHP Framework built to perform.
|
A versatile PHP Framework built to perform.
|
||||||
|
|
||||||
|
@ -4,23 +4,33 @@
|
|||||||
"license": ["MIT"],
|
"license": ["MIT"],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Abel Hoogeveen",
|
"name": "TechFuze",
|
||||||
"homepage": "https://i15.nl"
|
"homepage": "https://techfuze.net"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FuzeWorks Community",
|
||||||
|
"homepage": "https://techfuze.net/fuzeworks/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1.0",
|
"php": ">=7.1.0",
|
||||||
"fuzeworks/webcomponent": "~1.3.0",
|
"fuzeworks/core": "1.2.0-RC4",
|
||||||
"fuzeworks/objectstorage": "~1.3.0",
|
"fuzeworks/mvcr": "1.2.0-RC4",
|
||||||
"fuzeworks/tracycomponent": "~1.3.0",
|
"fuzeworks/webcomponent": "1.2.0-RC4",
|
||||||
"fuzeworks/layout": "~1.3.0",
|
"fuzeworks/tracycomponent": "1.2.0-RC4",
|
||||||
"fuzeworks/database": "~1.3.0",
|
"fuzeworks/layout": "1.2.0-RC4",
|
||||||
"latte/latte": "~3.0",
|
"fuzeworks/database": "1.2.0-RC4",
|
||||||
|
"smarty/smarty": "3.1.*",
|
||||||
|
"latte/latte": "2.5.*",
|
||||||
"ext-json": "*"
|
"ext-json": "*"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^7"
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"FuzeWorks\\": "src/FuzeWorks/"
|
"FuzeWorks\\": "src/FuzeWorks/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,17 +31,15 @@
|
|||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.3.0
|
* @version Version 1.2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace FuzeWorks;
|
namespace FuzeWorks;
|
||||||
|
|
||||||
use FuzeWorks\ObjectStorage\ObjectStorageComponent;
|
|
||||||
|
|
||||||
class WebAppComponent implements iComponent
|
class WebAppComponent implements iComponent
|
||||||
{
|
{
|
||||||
|
|
||||||
protected bool $willHandleRequest = false;
|
protected $willHandleRequest = false;
|
||||||
|
|
||||||
public function getName(): string
|
public function getName(): string
|
||||||
{
|
{
|
||||||
@ -64,7 +62,6 @@ class WebAppComponent implements iComponent
|
|||||||
|
|
||||||
// And add the component
|
// And add the component
|
||||||
$configurator->addComponent($webComponent);
|
$configurator->addComponent($webComponent);
|
||||||
$configurator->addComponent(new ObjectStorageComponent());
|
|
||||||
$configurator->addComponent(new DatabaseComponent());
|
$configurator->addComponent(new DatabaseComponent());
|
||||||
$configurator->addComponent(new LayoutComponent());
|
$configurator->addComponent(new LayoutComponent());
|
||||||
$configurator->addComponent(new TracyComponent());
|
$configurator->addComponent(new TracyComponent());
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 1.2.0
|
* @since Version 1.2.0
|
||||||
*
|
*
|
||||||
* @version Version 1.3.0
|
* @version Version 1.2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace FuzeWorks;
|
namespace FuzeWorks;
|
||||||
@ -39,20 +39,4 @@ namespace FuzeWorks;
|
|||||||
|
|
||||||
abstract class WebAppController extends WebController
|
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');
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -31,27 +31,24 @@
|
|||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 1.2.0
|
* @since Version 1.2.0
|
||||||
*
|
*
|
||||||
* @version Version 1.3.0
|
* @version Version 1.2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace FuzeWorks;
|
namespace FuzeWorks;
|
||||||
|
|
||||||
|
|
||||||
abstract class WebAppModel extends WebModel
|
abstract class WebAppModel extends WebModel
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Database
|
* @var Layout
|
||||||
*/
|
*/
|
||||||
protected $databases;
|
protected $databases;
|
||||||
|
|
||||||
/** @var ObjectStorage\ObjectStorageComponent */
|
|
||||||
protected $storage;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
// Load all requirements for the WebAppModel, not yet loaded by parent Model
|
// 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');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -50,7 +50,7 @@ abstract class WebAppView extends WebView
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
// Load all requirements for the WebAppView, not yet loaded by parent Views
|
// Load all requirements for the WebAppView, not yet loaded by parent Views
|
||||||
$this->layouts = Factory::getInstance('layouts');
|
$this->layouts = Factory::getInstance()->layouts;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
52
test/autoload.php
Normal file
52
test/autoload.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?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);
|
34
test/phpunit.xml
Normal file
34
test/phpunit.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<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>
|
57
test/webapp/WebAppComponentTest.php
Normal file
57
test/webapp/WebAppComponentTest.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
60
test/webapp/WebAppTestAbstract.php
Normal file
60
test/webapp/WebAppTestAbstract.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user