Initial commit

This commit is contained in:
Felix Förtsch
2020-10-20 14:39:50 +02:00
commit 648ded8896
1225 changed files with 216511 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* Factory.class.php
*/
# Define Namespace
namespace WCFE;
# Imports
use WPPFW\Plugin\PluginFactory;
/**
* WCFE Plugin base and currently the only object factory
*
* The class is to provide objects factory and objects storage
* Its used for interconnectios between different comonents and between
* Plugins and Plugins Framework
*
* @author AHMeD SAiD
*/
class Factory extends PluginFactory {
/**
* CReate class maps for Framework class to
* be constructed through WCFE Plugin
*
* @return void
*/
protected function createMap() {
# Create Map.
$this->addClassMap('WPPFW\Database\Wordpress\WordpressOptions', 'WordpressOptions');
}
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* WordpressOptions.class.php
*/
# Define namespace
namespace WCFE\Factory;
# Imports
use WPPFW\Obj;
# Original object
use WPPFW\Database\Wordpress;
/**
* Factoring Wordpress Database Options Table
*
* @author AHMeD SAiD
*/
class WordpressOptions {
/**
* Creating new WPPFW\Database\Wordpress\WordpressOptions object
* configued for WCFE Plugin
*
* @param Obj\Factory $factory
* @return Wordpress\WordpressOptions
*/
public function getInstance( Obj\Factory & $factory )
{
# Getting Plugin instance.
$plugin =& $factory->get( 'WPPFW\Plugin\PluginBase' );
# Return Wordpress options object instance
return new Wordpress\WordpressOptions( strtolower( $plugin->getNamespace()->getNamespace() . '-' ) );
}
}