Commit Graph

114 Commits

Author SHA1 Message Date
955715c79b Implemented Nette/Latte engine.
This Engine allows for really neat ways to handle templates. It is an optional dependency which will be installed if composer is used.
2016-07-07 13:07:06 +02:00
440ead5784 Implemented Tracy/Debugger from the Nette framework.
This debugger allows for advanced debugging for both development and production environments.
This did however require the implementation of an ENVIRONMENT constant. This has been put in the index file. If no constant is set it will be set by the core class and the default is PRODUCTION.
Chances are that the location for this constant will move in the future.

There is also a proper way now that fatal errors will lead to a 500 error on the screen. This is either done by Tracy or FuzeWorks, depending on if Tracy is available.
2016-06-08 14:57:41 +02:00
a2bd137386 Added documentation to the Router class. 2016-06-07 16:23:44 +02:00
7aff99c701 Implemented a few unit tests for the new classes. 2016-06-07 15:52:02 +02:00
8298975c98 Implemented renewed Routing and Output system.
Everything is in accordance with issue #89 and #90.
2016-06-07 15:12:35 +02:00
01491b7f65 Implemented xdebug in Gitlab CI and added code coverage systems
Code Coverage should now work properly.
2016-06-04 16:17:21 +02:00
5df6b733d0 Implemented many unit tests.
The following tests for classes have been implemented:
- Security
- Input
- Encryption Library
- Utf8

A mocking autoloader has been added (but is not yet configured correctly)
2016-06-02 23:57:23 +02:00
96ca890656 Finished the Library system
All unit tests have also been implemented.
Many bugs have been smashed with the mighty hammer.
2016-06-02 20:13:08 +02:00
ae94dca984 Removed deprecated methods from Factory.
All classes that use this have been changed.
2016-06-02 20:12:22 +02:00
c97c7f8aab Config documentation now has @throws statements 2016-06-02 19:15:18 +02:00
53f597f947 Implemented a new system for Logging templates.
This allows the user to install new Logging templates that run in specific circumstances. By default the FuzeWorks default (as you already know it) template is installed, and a CLI one.

Closes #88
2016-06-02 15:19:31 +02:00
544a84434c Allowed the Factory class to be extended.
A class can now extend the Factory class and use all of its properties.
Properties like the layout system can be called like $this->layout, when extended. Just like the old days with the Bus abstract class.
Advantage of this system is that you don't require the use of extending the Factory class. Calling the factory for just one use is also possible.

Closes #93.
2016-06-02 13:57:32 +02:00
57c54b0126 Implemented simplified config class.
Now it only features one (simpler) ORM, which is the ConfigFileORM.
If a new type of config should be added, it should be done through models.

Unit tests for the basic config class have been implemented.
2016-06-01 16:03:53 +02:00
bc6136525b Implemented the Factory and the FactoryTest.
The Factory class is the central point for class communication in FuzeWorks. When someone needs to load, for instance, the layout class, one has to do the following:

$factory = Factory::getInstance();
$layout = $factory->layout;

The Factory class allows the user to replace dependencies on the fly. It is possible for a class to replace a dependency, like Logger, on the fly by calling the $factory->newInstance('Logger'); or the $factory->setInstance('Logger', $object); This allows for creative ways to do dependency injection, or keep classes
separated.

It is also possible to load a cloned instance of the Factory class, so that all properties are independant as well,
all to suit your very needs.
2016-05-27 16:33:12 +02:00
68afa1ef1b Implemented a (failed) config and a renewed Helpers class.
Helpers class is now fully supported by continuous integration.
2016-05-27 13:55:31 +02:00
0adcdb7449 Implemented new and renewed core tests.
The layout tests have been updated, and Core and events tests have been added.
2016-05-25 17:01:59 +02:00
4af73f3b58 Fixed existing tests.
Query and model tests are removed since they are no longer supported.
New tests will follow.
2016-05-25 14:28:57 +02:00
7d3323bfe7 Started implementing the Factory.
This will have huge consequences for FuzeWorks.
2016-05-24 12:42:14 +02:00
3343c08594 Implemented many CodeIgniter classes.
Preparing for Factory Build
2016-05-24 12:05:29 +02:00
6522fe2429 Implemented the language class.
The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

In your FuzeWorks Core folder, you will find a Language sub-directory containing a set of language files for the english idiom. The files in this directory (Core/Language/english/) define the regular messages, error messages, and other generally output terms or expressions, for the different parts of the FuzeWorks.

You can create or incorporate your own language files, as needed, in order to provide application-specific error and other messages, or to provide translations of the core messages into other languages. These translations or additional messages would go inside your Application/Language/ directory, with separate sub-directories for each idiom (for instance, ‘french’ or ‘german’).

FuzeWorks comes with a set of language files for the “english” idiom. Additional approved translations for different idioms may be found in the FuzeWorks Archives. Each archive deals with a single idiom.

When  FuzeWorks loads language files, it will load the one in Core/Language/ first and will then look for an override in your Application/Language/ directory.
2016-05-22 19:29:55 +02:00
3284246fcf Added documentation to Database class. 2016-05-21 22:11:21 +02:00
d3391ddaa0 Changed classnames to FuzeWorks prefix. 2016-05-20 21:59:28 +02:00
6956a3a0d9 Implemented the new database engine. Advanced instructions will follow in Merge Request 2016-05-20 17:29:33 +02:00
be3c6c87ff Implemented new config.core.php variables.
It is now possible to disable the modules and the events system using the config file. This will completely turn the system off.
The event system will still load the event classes but it will not send them around.
2016-05-15 15:37:26 +02:00
9901ea55e7 Made Library instances more manageable.
If the $keepInstance = true variable is provided for Libraries::get() or Libraries::getDriver() then a new instance will be created and returned to the user.
If the $keepInstance = false (default) is provided then the same instance will be returned as the first one.
2016-05-14 17:51:33 +02:00
7e3e707d9f Implemented Registry caching.
By changing the config.core.php file you can select how registries should be cached. Remember that this is not recommended during development.
The available options are file, apc, redis, memcached, wincache and dummy. Cache TTL can also be set. Some caching drivers require you to change the config.cache.php file.
2016-05-14 17:06:42 +02:00
ae861b8b6e Implemented a caching library.
The library comes with 6 drivers: APC, file, memcached, redis, wincache and a dummy driver. Which driver you can use is dependant on your situation.
In order to build this a Driver library has been implemented. A driver can be called using (FuzeWorks\)Libraries::getDriver($libraryName); This will load the driver library and the requested library. Regular library rules apply.

Every driver comes with the same methods (found in documentation) but the 2 most important are $driver->save($objectName, $object, $time); whereby $time is an integer in minutes; and $driver->get($objectName); which will receive the cached value;

To load a cache driver you need to run something like the following:
$cache = FuzeWorks\Libraries::getDriver('cache', array('adapter' => 'apc', 'backup' => 'file'));
This will try and load the APC cache driver. If this fails it will try and load the file driver. If all fails it will load the dummy driver. The dummy driver does not actually save anything, it's just a placeholder until you fix your environment.

More information can be found in the documentation.
2016-05-14 16:18:59 +02:00
2aef5abdd3 Implemented Helpers into FuzeWorks.
Helpers are small utilities that can be loaded to assist a performing certain functions. Helpers are simply global functions that get loaded when requesting them.

Helpers can be loaded using (\FuzeWorks\)Helpers::load('helperName'); Helpers can be put in the 'Core/Helpers' or the 'Application/Helpers' directory. The 'Applications/Helpers' directory is scanned first, so this one has priority over Core helpers.

It is possible to sort of 'extend' helpers. By putting a helper in the 'Application/Helpers' directory with the application prefix (found in config.main.php) you can load that helper first and then the helper in the core directory. This allows you to add or override functions without the need of copying the entire helper from the core. For example: there is a helper in the core directory named 'example_helper.php'. This one has a function named 'doSomething();' inside it. If you now create a helper in the application directory named 'MY_example_helper.php', then that one will be loaded first and can override the core class because the application helper is loaded first.

More detailed instructions will be provided in the documentation.
2016-05-14 14:06:04 +02:00
2cbc431283 Implemented the first extension: the Encryption extension.
The Encryption Library provides two-way data encryption. To do so in a cryptographically secure way, it utilizes one of multple PHP extensions.
2016-05-13 22:52:14 +02:00
4e9fe8db4a Implemented a basic Library system for FuzeWorks.
Libraries are small one-class utilities which can be loaded to fasten functionality for controllers and modules. It's meant to support modules and controllers but not the other way around.
Libraries can be put in the Core/Libraries directory. Libraries put here must use the FuzeWorks\Library namespace and must use the 'FW_' prefix. A library named 'Example' will be named 'FW_Example' and would be located in the file Example.php in the Core/Libraries directory.

It's also possible to extend on core libraries or completely add new libraries. Adding a new library can be done as easily as adding the file to the Application/Libraries folder. The used namespace is 'Application\Library'. Libraries that do not extend anything do not need a prefix.

Libraries that extend however require a prefix. This prefix is configurable in the config.main.php in the Application/Config directory. The default prefix is 'MY_'. If you want to extend the file should have a different name. In the 'Example' example the file should be named 'MY_Example.php' in the Applications/Libraries folder.

Libraries can be loaded using the Libraries::get('libraryName') method (FuzeWorks\Libraries::get()).
2016-05-13 22:20:53 +02:00
deef1879aa Implemented routerLoadControllerEvent.
Now controller loading can be intercepted and changed if needed.
Part of CodeIgniter compatibility module. Useful for other things.
2016-05-13 14:26:34 +02:00
5bc326b5e1 Misc. changes to configuration files related to formatting 2016-05-12 12:18:08 +02:00
51f3c80a92 Started with implementing the benchmarker from CodeIgniter into FuzeWorks. 2016-05-12 12:17:43 +02:00
9f4742b063 Updated entire project to PSR2 code standard. Some classes still need to be moved around. 2016-05-07 19:22:09 +02:00
0910b30d93 Implemented some core changes to the Layout system 2016-01-23 14:06:16 +01:00
81b86c61c9 Implemented static methods for Modules.
Modules can now call default static methods by implementing the \FuzeWorks\Module trait.
The database also closes connection upon coreShutdownEvent
2016-01-17 14:42:39 +01:00
727e8b3311 Added method to receive advertisements 2016-01-17 13:09:41 +01:00
891be6986b Implemented argument passing for modules. The onLoad() module method will now receive arguments sent from the Modules::get('MOD_NAME', args..) part. 2016-01-17 13:09:17 +01:00
a184d43c9e Implemented module advertisements.
A module advertises it has certain data, identified by a key. The moment a module gets loaded that listens for that key, it will get send this data.
Using this technique it is possible to load certain predefined data into modules, without loading the actual module. This data is prone to future caching as well.
2016-01-16 21:21:11 +01:00
c5eae9823c Fixed Apache working directory bug by applying the working directory at shutdown 2016-01-15 13:45:13 +01:00
ba9cfce1a9 Various incomplete code fixes and newlines. 2016-01-14 21:10:28 +01:00
c2a9cf5ee8 Fixed spelling mistakes in documentation 2016-01-13 13:09:12 +01:00
49a845d333 Moved the Event register into the regular Module register. This shortens the code and fixes events not being loaded. Readability improved enormously 2016-01-13 13:08:11 +01:00
b89f4e1fdd Removed references to time before Static Core 2016-01-13 12:30:02 +01:00
9127b440a5 Added the event_layoutLoadViewEventTest unit test. 2015-10-12 16:45:56 +01:00
102b35a96b Implemented unit tests for the layout manager. 2015-10-12 16:28:38 +01:00
b8058572d3 Temporarily removed Users module until issues are resolved. 2015-10-12 14:22:56 +01:00
9d665e2ae1 Many Misc jobs:
- Modules can now be loaded using routes by adding a routes[] array to the moduleInfo.php. When it matches, the module gets loaded, and a route() function in the main class gets called. (Fixes #79)
- Composer can now load from a different file
- License headers have been added to all core files (Fixes #66)
- Table model has been renamed to sqltable. Interpret model has been removed
- layoutLoadViewEvent added
- Controllers now extend the \FuzeWorks\ControllerAbstract class
- Controllers are now in the \Application\Controller namespace
- Models are now in the \Application\Model namespace
- Events are now in the \FuzeWorks\Event namespace
- Moved some classes in a different namespace for a better overview
- Events can now properly load function listeners (fixes #81)
- Documentation added to more classes. (Partially fixes #58)
- Added replace() command to DatabaseUtils Abstract Model
- Added more unit tests for router, query and events
2015-10-11 19:14:49 +01:00
d982534cf0 Started working on new systems. Continue on new development environment. 2015-09-12 19:52:04 +02:00
5093f98c4b Started working on renewed Unit Tests. 2015-09-06 15:42:57 +02:00