Placed the License header in most files and implemented PHPDoc where needed.

Also removed useless whitespaces.
This commit is contained in:
Abel Hoogeveen 2015-08-29 17:43:13 +02:00
parent 56b8f56ab3
commit f73f638b2b
29 changed files with 991 additions and 116 deletions

View File

@ -7,7 +7,7 @@ use \FuzeWorks\Event;
*
* Called when a callable is about to be loaded
*
* @package System\Events
* @package net.techfuze.fuzeworks.events
*/
class routerLoadCallableEvent extends Event{

View File

@ -7,7 +7,7 @@ use \FuzeWorks\Event;
*
* Fired after the router has extracted the path
*
* @package System\Events
* @package net.techfuze.fuzeworks.events
*/
class routerRouteEvent extends Event{

View File

@ -7,7 +7,7 @@ use \FuzeWorks\Event;
*
* Fired when the router's path is changing
*
* @package System\Events
* @package net.techfuze.fuzeworks.events
*/
class routerSetPathEvent extends Event{

View File

@ -1,7 +1,43 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Interpret Class.
*
* This Model is able to automatically select a SQL database as its source.
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Interpret extends Model {
public function __construct(&$core){

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
@ -8,6 +36,9 @@ namespace FuzeWorks;
* Every class in this framework does somehow extend this class. Because it rocks.
* This class offers a lot of pointers to important core classes, so every class can find other classes.
*
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
abstract class Bus {
/**
@ -80,7 +111,7 @@ abstract class Bus {
/**
* An object class which holds modules so that other classes can access it.
* This is used so that all classes that somehow extend Bus can access modules
* This is used so that all classes that somehow extend Bus can access modules
* using $this->mods->MOD_NAME;
*/
class ModHolder {
@ -95,7 +126,6 @@ class ModHolder {
$this->core->loadMod($name);
return $this->core->mods->$name;
}
}
}

View File

@ -1,10 +1,41 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Abstract class Controller
*
*
* At this point does nothing, can be extended in the future to allow special controller functions
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
abstract class Controller extends Bus{}

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
@ -6,6 +34,9 @@ namespace FuzeWorks;
* Class Event
*
* A simple class for events. The only current purpose is to be able to cancel events, but it can be easily extended.
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Event {
@ -32,6 +63,9 @@ class Event {
/**
* Simple event which will notify components of an event, but does not contain any data
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class NotifierEvent extends Event {}

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
@ -14,7 +42,9 @@ namespace FuzeWorks;
* EventPriority::NORMAL
* EventPriority::LOW
* EventPriority::LOWEST
*
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
abstract class EventPriority

View File

@ -1,10 +1,41 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Interface for a Module that gives abstract model types
* A model server must contain the methods from this interface in order to correctly serve models
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
interface ModelServer {
public function giveModel($type);
@ -12,14 +43,17 @@ interface ModelServer {
/**
* Abstract class Model
*
*
* Abstract for a model data representation, loads the correct parent type
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
abstract class Model extends Bus{
/**
* The parent class holder object
* Requests get redirected to this class
* Requests get redirected to this class
* @access private
* @var Parent Object
*/
@ -28,7 +62,7 @@ abstract class Model extends Bus{
/**
* Constructs the class and Bus
* @access public
* @param Core Object, gets referenced
* @param Core Object, gets referenced
*/
public function __construct(&$core) {
parent::__construct($core);
@ -58,7 +92,7 @@ abstract class Model extends Bus{
/**
* Sets a value in the model class
* @access public
* @param Any key
* @param Any key
* @param Any value
*/
public function __set($name, $value) {
@ -73,6 +107,6 @@ abstract class Model extends Bus{
* @return Function return
*/
public function __call($name, $params) {
return call_user_func_array(array($this->parentClass, $name), $params);
return call_user_func_array(array($this->parentClass, $name), $params);
}
}

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
@ -6,6 +34,9 @@ namespace FuzeWorks;
* Class Module
*
* Abstract Class for modules
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Module extends Bus {

View File

@ -1,11 +1,42 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Catcher Class
*
*
* This class catches requests and returns nothing. Handy for a temporary replacement object
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Catcher extends Bus{
@ -37,6 +68,14 @@ class Catcher extends Bus{
}
/**
* Events catcher class.
*
* Used for replacing the events core module
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class EventsCatcher extends Catcher {
public function __construct(&$core) {
parent::__construct($core);
@ -70,7 +109,7 @@ class EventsCatcher extends Catcher {
$eventName = get_class($input);
$eventName = explode('\\', $eventName);
$eventName = end($eventName);
$event = $input;
$event = $input;
} else {
// INVALID EVENT
return false;

View File

@ -1,11 +1,42 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Config Class
*
*
* This class gives access to the config files. Can read and write .php files with an array in a file
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Config extends Bus{
@ -75,7 +106,7 @@ class Config extends Bus{
}
throw new Exception("Config file '".strtolower($name)."' was not found", 1);
return false;
}
}
}
/**
@ -99,7 +130,7 @@ class Config extends Bus{
} else {
$DECODED[$key] = $value;
}
if (is_writable($file)) {
$config = var_export($DECODED, true);
file_put_contents($file, "<?php return $config ;");

View File

@ -1,12 +1,43 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
use \stdClass;
/**
* FuzeWorks Core
*
*
* Holds all the modules and starts the framework. Allows for starting and managing modules
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Core {
@ -135,7 +166,7 @@ class Core {
/**
* Load composer if it is present
* @access private
* @access private
* @param String directory of composer autoload file (optional)
*/
private function loadComposer($file = "vendor/autoload.php") {

View File

@ -1,21 +1,56 @@
<?php
/**
* @author FuzeNetwork
* @package files
*/
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Event Class
*
* Controls FuzeWorks Events. Events are classes that get loaded during special moments in the program.
* These Event objects get send to so-called 'listeners', which can modify the event object, and eventually return them to invoker.
* Typically an event process goes like this:
* - Event get's called
* - Event object is created
* - Event object is send to all listeners in order of EventPriority
* - Event is returned
/**
* Class Events
*
* FuzeWorks is built in a way that almost every core-event can be manipulated by modules. This class provides various ways to hook into the core (or other modules)
* and manipulate the outcome of the functions. Modules and core actions can 'fire' an event and modules can 'hook' into that event. Let's take a look at the example below:
*
* If we want to add the current time at the end of each page title, we need to hook to the corresponding event. Those events are found in the 'events' directory in the system directory.
* The event that will be fired when the title is changing is called layoutSetTitleEvent. So if we want our module to hook to that event, we add the following to the constructor:
*
* $this->events->addListener(array($this, "onLayoutSetTitleEvent"), "layoutSetTitleEvent", EventPriority::NORMAL);
*
* This will add the function "onLayoutSetTitleEvent" of our current class ($this) to the list of listeners with priority NORMAL. So we need to add
* a method called onLayoutSetTitleEvent($event) it is very important to add the pointer-reference (&) or return the event, otherwise it doesn't change the event variables.
*
* If we now add the following code to our method, it will add the current time at the front of each title.
*
* $event->title = date('H:i:s ').$event->title;
*
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Events extends Bus{

View File

@ -1,45 +1,87 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Class Exception
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Exception extends \Exception{}
/**
* Class LayoutException
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class LayoutException extends Exception{}
/**
* Class RouterException
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class RouterException extends Exception{}
/**
* Class CoreException
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class CoreException extends Exception{}
/**
* Class EventException
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class EventException extends Exception{}
/**
* Class DatabaseException
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class DatabaseException extends Exception{}
/**
* Class ModuleException
* @package System\Core
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class ModuleException extends Exception{}

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
@ -6,7 +34,10 @@ namespace FuzeWorks;
* Logger Class
*
* The main tool to handle errors and exceptions. Provides some tools for debugging and tracking where errors take place
* All fatal errors get catched by this class and get displayed if configured to do so.
* All fatal errors get catched by this class and get displayed if configured to do so.
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Logger extends Bus{
@ -31,7 +62,7 @@ class Logger extends Bus{
}
public function shutdown() {
// Load last error if thrown
// Load last error if thrown
$errfile = "Unknown file";
$errstr = "shutdown";
$errno = E_CORE_ERROR;
@ -42,8 +73,8 @@ class Logger extends Bus{
$errno = $error['type'];
$errfile = $error['file'];
$errline = $error['line'];
$errstr = $error['message'];
$errstr = $error['message'];
// Log it!
$this->errorHandler($errno, $errstr, $errfile, $errline);
$this->logInfo($this->backtrace());
@ -55,7 +86,7 @@ class Logger extends Bus{
}
}
/**
/**
* System that redirects the errors to the appropriate logging method
* @access public
* @param int $type Error-type, Pre defined PHP Constant
@ -68,10 +99,10 @@ class Logger extends Bus{
public function errorHandler($type = E_USER_NOTICE, $error = "Undefined Error", $errFile = null, $errLine = null, $context = null) {
// Check type
$thisType = self::getType($type);
$LOG = array('type' => (!is_null($thisType) ? $thisType : "ERROR"),
'message' => (!is_null($error) ? $error : ""),
'logFile' => (!is_null($errFile) ? $errFile : ""),
'logLine' => (!is_null($errLine) ? $errLine : ""),
$LOG = array('type' => (!is_null($thisType) ? $thisType : "ERROR"),
'message' => (!is_null($error) ? $error : ""),
'logFile' => (!is_null($errFile) ? $errFile : ""),
'logLine' => (!is_null($errLine) ? $errLine : ""),
'context' => (!is_null($context) ? $context : ""),
'runtime' => round($this->getRelativeTime(), 4));
$this->Logs[] = $LOG;
@ -81,7 +112,7 @@ class Logger extends Bus{
* Exception handler
* Will be triggered when an uncaught exception occures. This function shows the error-message, and shuts down the script.
* Please note that most of the user-defined exceptions will be caught in the router, and handled with the error-controller.
*
*
* @access public
* @param Exception $exception The occured exception.
* @return void
@ -139,18 +170,18 @@ class Logger extends Bus{
array_pop($trace); // remove call to this method
$length = count($trace);
$result = array();
for ($i = 0; $i < $length; $i++)
{
$result[] = ($i + 1) . ')' . substr($trace[$i], strpos($trace[$i], ' ')); // replace '#someNum' with '$i)', set the right ordering
}
return "<b>BACKTRACE: <br/>\t" . implode("<br/>", $result)."</b>";
}
/* =========================================LOGGING METHODS==============================================================*/
public function log($msg, $mod = null, $file = 0, $line = 0) {
$this->logInfo($msg, $mod, $file, $line);
}
@ -158,76 +189,76 @@ class Logger extends Bus{
public function logInfo($msg, $mod = null, $file = 0, $line = 0) {
$LOG = array('type' => 'INFO',
'message' => (!is_null($msg) ? $msg : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'context' => (!is_null($mod) ? $mod : ""),
'runtime' => round($this->getRelativeTime(), 4));
'runtime' => round($this->getRelativeTime(), 4));
$this->infoErrors[] = $LOG;
$this->Logs[] = $LOG;
}
public function logError($msg, $mod = null, $file = 0, $line = 0) {
$LOG = array('type' => 'ERROR',
$LOG = array('type' => 'ERROR',
'message' => (!is_null($msg) ? $msg : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'context' => (!is_null($mod) ? $mod : ""),
'runtime' => round($this->getRelativeTime(), 4));
'runtime' => round($this->getRelativeTime(), 4));
$this->criticalErrors[] = $LOG;
$this->Logs[] = $LOG;
}
public function logWarning($msg, $mod = null, $file = 0, $line = 0) {
$LOG = array('type' => 'WARNING',
$LOG = array('type' => 'WARNING',
'message' => (!is_null($msg) ? $msg : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'context' => (!is_null($mod) ? $mod : ""),
'runtime' => round($this->getRelativeTime(), 4));
'runtime' => round($this->getRelativeTime(), 4));
$this->warningErrors[] = $LOG;
$this->Logs[] = $LOG;
}
public function newLevel($msg, $mod = null, $file = null, $line = null) {
$LOG = array('type' => 'LEVEL_START',
$LOG = array('type' => 'LEVEL_START',
'message' => (!is_null($msg) ? $msg : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'context' => (!is_null($mod) ? $mod : ""),
'runtime' => round($this->getRelativeTime(), 4));
'runtime' => round($this->getRelativeTime(), 4));
$this->Logs[] = $LOG;
}
public function stopLevel($msg = null, $mod = null, $file = null, $line = null) {
$LOG = array('type' => 'LEVEL_STOP',
$LOG = array('type' => 'LEVEL_STOP',
'message' => (!is_null($msg) ? $msg : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'logFile' => (!is_null($file) ? $file : ""),
'logLine' => (!is_null($line) ? $line : ""),
'context' => (!is_null($mod) ? $mod : ""),
'runtime' => round($this->getRelativeTime(), 4));
'runtime' => round($this->getRelativeTime(), 4));
$this->Logs[] = $LOG;
}
/* =========================================OTHER METHODS==============================================================*/
/**
/**
* Returns a string representation of an error
* Turns a PHP error-constant (or integer) into a string representation.
*
*
* @access public
* @param int $type PHP-constant errortype (e.g. E_NOTICE).
* @return string String representation
*/
public function getType($type) {
switch ($type)
{
case E_ERROR:
return "ERROR";
case E_WARNING:
@ -259,12 +290,12 @@ class Logger extends Bus{
case E_DEPRECATED:
return "WARNING";
}
return $type = 'Unknown error: '.$type;
return $type = 'Unknown error: '.$type;
}
public function http_error($errno = 500, $view = true){
$http_codes = array(
400 => 'Bad Request',
@ -323,7 +354,7 @@ class Logger extends Bus{
}
}
/**
/**
* Enable error to screen logging
* @access public
*/
@ -331,7 +362,7 @@ class Logger extends Bus{
$this->print_to_screen = true;
}
/**
/**
* Disable error to screen logging
* @access public
*/

View File

@ -1,18 +1,46 @@
<?php
/**
* @author FuzeNetwork
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
/**
* Models Class
*
*
* Simple loader class for MVC Models. Typically loads models from Application/Models unless otherwise specified.
* If a model is not found, it will load a DatabaseModel type which will analyze the database and can directly be used.
* If a model is not found, it will load a DatabaseModel type which will analyze the database and can directly be used.
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Models extends Bus{
private $models_array = array();
private $model_types = array();
private $models_loaded = false;
@ -55,5 +83,5 @@ class Models extends Bus{
}
}
}
?>

View File

@ -1,6 +1,31 @@
<?php
/**
* @author FuzeNetwork
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
@ -8,7 +33,9 @@ use \stdClass;
/**
* Modules Class
*
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Modules extends Bus{
@ -43,7 +70,7 @@ class Modules extends Bus{
// Check if the module is disabled
if (isset($cfg->meta)) {
throw new ModuleException("Requested mod '".$name."' could not be loaded. Not enabled", 1);
return false;
return false;
}
// Check if the module is already loaded. If so, only return a reference, if not, load the module
@ -59,7 +86,7 @@ class Modules extends Bus{
// Load the dependencies before the module loads
$deps = (isset($cfg->dependencies) ? $cfg->dependencies : array());
for ($i=0; $i < count($deps); $i++) {
for ($i=0; $i < count($deps); $i++) {
$this->loadMod($deps[$i]);
}
@ -76,7 +103,7 @@ class Modules extends Bus{
} else {
// Throw Exception if the file does not exist
throw new ModuleException("Requested mod '".$name."' could not be loaded. Class file not found", 1);
return false;
return false;
}
// If it is an abstract module, load an StdClass for the module address
@ -216,7 +243,7 @@ class Modules extends Bus{
$this->events->buildEventRegister();
} else {
throw new ModuleException("Could not enable module '".$name."'. Module does not exist.", 1);
}
}
}
/**
@ -265,7 +292,7 @@ class Modules extends Bus{
// Build the module register
$register = array();
for ($i=0; $i < count($mod_dirs); $i++) {
for ($i=0; $i < count($mod_dirs); $i++) {
$mod_dir = $dir . $mod_dirs[$i] . "/";
// If a moduleInfo.php exists, load it
if (file_exists($mod_dir . "/moduleInfo.php")) {
@ -321,9 +348,9 @@ class Modules extends Bus{
$this->register = $register;
$this->logger->stopLevel();
}
}
?>

View File

@ -1,7 +1,77 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace FuzeWorks;
use \Application\Init;
/**
* Class Router
*
* This class handles the framework's routing. The router determines which controller should be called.
* The overall structure of the routing is as follows:
*
* The routes-array will hold a list of RegEx-strings. When the route-method is called, the framework will try
* to match the current path against all the RegEx's. When a RegEx matches, the linked callable will be called.
*
* The default route works as follows:
*
* Let's say the visitor requests /A/B/C
*
* A would be the 'controller' (default: home)
* B would be the function to be called in the 'controller' (default: index)
* C would be the first parameter
*
* All controllers are to be placed in the /application/çontrollers-directory.
*
* But because of this RegEx-table, modules can easily listen on completely different paths. You can, for example, make
* a module that only triggers when /admin/<controller>/<function>/.. is accessed. Or even complexer structure are
* available, e.g: /webshop/product-<controller>/view/<function>.
*
* BE AWARE:
*
* Callables are NO controllers!! By default, the 'defaultCallable' will load the correct controller from
* the default controller directory. When you make custom routes, the callable will need to call your own
* controllers. This means that the one callable you provide with your RegEx will be called for EVERYTHING
* the RegEx matches. The names groups 'controller' and 'function' will be passed as first two arguments,
* if no names groups are available; you will need to extract them yourself from the path.
*
* After the core has been loaded, the method setPath will be called with the request URI (e.g. obtained via .htaccess).
* That method will then call the route-method, which will call the right controller and it's method.
*
* @see Router::setPath
* @see Router::route
*
* @package net.techfuze.fuzeworks.core
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Router extends Bus{
/**
@ -169,11 +239,11 @@ class Router extends Bus{
*
* The path will be checked before custom routes before the default route(/controller/function/param1/param2/etc)
* When the given RegEx matches the current routing-path, the callable will be called.
*
*
* The callable will be called with three arguments:
*
*
* Callable($controller, $function, $parameters)
*
*
* These three variables will be extracted from the named groups of your RegEx. When one or more named groups are
* not matched, they will be set to NULL. The default RegEx is:
*

View File

@ -1,10 +1,47 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace Module\Database;
use \FuzeWorks\Module;
use \PDO;
use \FuzeWorks\DatabaseException;
/**
* Database Class
*
* This class is a wrapper for PDO.
*
* @package net.techfuze.fuzeworks.database
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Main extends Module {
/**
@ -82,29 +119,29 @@ class Main extends Module {
public function __call($name, $params) {
if ($this->is_active()) {
return call_user_func_array(array($this->DBH, $name), $params);
return call_user_func_array(array($this->DBH, $name), $params);
} else {
$this->connect();
return call_user_func_array(array($this->DBH, $name), $params);
return call_user_func_array(array($this->DBH, $name), $params);
}
}
public function __get($name) {
if ($this->is_active()) {
return $this->DBH->$name;
return $this->DBH->$name;
} else {
$this->connect();
return $this->DBH->$name;
}
return $this->DBH->$name;
}
}
public function __set($name, $value) {
if ($this->is_active()) {
$this->DBH->$name = $value;
$this->DBH->$name = $value;
} else {
$this->connect();
$this->DBH->$name = $value;
}
$this->DBH->$name = $value;
}
}
}

View File

@ -1,4 +1,33 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
return array(
'module_class' => 'Module\Database\Main',

View File

@ -1,4 +1,33 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace Module\DatabaseUtils;
use \FuzeWorks\Module;
@ -6,6 +35,12 @@ use \FuzeWorks\Bus;
use \FuzeWorks\ModelServer;
use \FuzeWorks\DatabaseException;
/**
* Main class of the database utilities and model providers
* @package net.techfuze.fuzeworks.databaseutils
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Main extends Module implements ModelServer {
public $fields = array();
@ -35,7 +70,11 @@ class Main extends Module implements ModelServer {
* Models also allow custom methods to be created on them. You can use those methods to create specific operations or joins and then use the newly created method
* everywhere in your project. The code is at one place, the usages all over your project. Isn't that great?
*
* @package Module\DatabaseUtils
* @package net.techfuze.fuzeworks.databaseutils
* @author GOScripting
* @copyright Copyright (c) 2014 - 2015, GOScripting B.V. (http://goscripting.com)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://goframework.net
*/
class Model extends Bus {
@ -153,7 +192,6 @@ class Model extends Bus {
* @return mixed
*/
public function getLastInsertId(){
return $this->mods->database->lastInsertId();
}

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace Module\DatabaseUtils;
use \FuzeWorks\Module;
@ -7,7 +35,11 @@ use \FuzeWorks\DatabaseException;
/**
* Class Query
* @package Module\DatabaseUtils
* @package net.techfuze.fuzeworks.databaseutils
* @author GOScripting
* @copyright Copyright (c) 2014 - 2015, GOScripting B.V. (http://goscripting.com)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://goframework.net
*
* @method $this or() or(string $field, string $arg2) OR $arg2 is the value of the field, or an operator in which case the value is pushed to the third argument
* @method $this and() and(string $field, string $arg2) AND $arg2 is the value of the field, or an operator in which case the value is pushed to the third argument

View File

@ -1,11 +1,43 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace Module\Example;
use \FuzeWorks\Module;
/**
* Sections module, see usage documentation
* @author TechFuze
* Example module.
*
* Use this is a reference to create new modules.
* @package net.techfuze.fuzeworks.example
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Main extends Module {

View File

@ -1,4 +1,33 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
return array(
'module_class' => 'Module\Example\Main',

View File

@ -1,4 +1,32 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
namespace Module\Mailer;
use \FuzeWorks\Module;
@ -6,10 +34,14 @@ use \PHPMailer;
/**
* Main class for the Mailer module
*
* This class is a simple wrapper for PHPMailer. It has a simple prepared config file and can create instances based on these config files.
* @package net.techfuze.fuzeworks.mailer
* @author Abel Hoogeveen <abel@techfuze.net>
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
*/
class Main extends Module {
/**
* Array of all the active PHPMailer instances
* @access private
@ -48,14 +80,14 @@ use \PHPMailer;
$this->mailers[$name]->Debugoutput = 'html';
$this->mailers[$name]->Host = $cfg->smtp_host;
$this->mailers[$name]->Port = $cfg->smtp_port;
// Authentication
if ($cfg->smtp_auth) {
$this->mailers[$name]->SMTPAuth = true;
$this->mailers[$name]->Username = $cfg->smtp_username;
$this->mailers[$name]->Password = $cfg->smtp_password;
}
// Set the sender correctly
if ($cfg->sender_name != '' && $cfg->sender_mail != '') {
$this->mailers[$name]->setFrom($cfg->sender_mail, $cfg->sender_name);
@ -68,7 +100,6 @@ use \PHPMailer;
return $this->mailers[$name];
}
}
?>

View File

@ -1,4 +1,33 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
return array(
# Sendmail Settings

View File

@ -1,4 +1,33 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
return array(
'module_class' => '\Module\Mailer\Main',

View File

@ -1,4 +1,33 @@
<?php
/**
* FuzeWorks
*
* The FuzeWorks MVC PHP FrameWork
*
* Copyright (C) 2015 TechFuze
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2015, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 1996 - 2015, Free Software Foundation, Inc. (http://www.fsf.org/)
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 License
* @link http://fuzeworks.techfuze.net
* @since Version 0.0.1
* @version Version 0.0.1
*/
// Include framework
require_once( dirname(__FILE__) . "/Core/System/class.core.php");