namespace Org\Mxchange\CoreFramework\Helper\Application;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Application\BaseApplication;
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Loader\ClassLoader;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
-use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication, Registerable {
+class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable {
/**
* The version number of this application
*/
));
}
- // Set it in registry
- GenericRegistry::getRegistry()->addInstance('application', $applicationInstance);
-
// Now call all methods in one go
foreach (array('setupApplicationData', 'initApplication', 'launchApplication') as $methodName) {
// Debug message
// Call parent constructor
parent::__construct($className);
- // Get registry instance
- $registryInstance = GenericRegistry::getRegistry();
-
- // Add this instance
- $registryInstance->addInstance('application', $this);
+ // Set this instance as application instance
+ GenericRegistry::getRegistry()->addInstance('application', $this);
}
}
return $compressorInstance;
}
- /**
- * Protected getter for a manageable application helper class
- *
- * @return $applicationInstance An instance of a manageable application helper class
- */
- protected final function getApplicationInstance () {
- $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- return $applicationInstance;
- }
-
- /**
- * Setter for a manageable application helper class
- *
- * @param $applicationInstance An instance of a manageable application helper class
- * @return void
- */
- public final function setApplicationInstance (ManageableApplication $applicationInstance) {
- GenericRegistry::getRegistry()->addInstance('application', $applicationInstance);
- }
-
/**
* Private getter for language instance
*
// Set template instance
$mailerInstance->setTemplateInstance($templateInstance);
- // Set application instance
- $mailerInstance->setApplicationInstance($applicationInstance);
-
// Set template name
$mailerInstance->setTemplateName($templateName);
$templateInstance->compileTemplate();
$templateInstance->assignTemplateWithVariable('footer', 'footer');
+ // Get master template name
+ $masterTemplateName = GenericRegistry::getRegistry()->getInstance('application')->buildMasterTemplateName();
+
// Load the master template
- $templateInstance->loadCodeTemplate(GenericRegistry::getRegistry()->getInstance('application')->buildMasterTemplateName());
+ $templateInstance->loadCodeTemplate($masterTemplateName);
// Then compile it again
$templateInstance->compileVariables();
throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Return the prepared instance
return $resolverInstance;
}
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Return the prepared instance
return $resolverInstance;
}
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Return the prepared instance
return $resolverInstance;
}
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Return the prepared instance
return $resolverInstance;
}
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set controller name
$resolverInstance->setControllerName($controllerName);
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set controller name
$resolverInstance->setControllerName($controllerName);
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set controller name
$resolverInstance->setControllerName($controllerName);
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
- // Set namespace and application instance
+ // Set namespace for command
$resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Command');
- $resolverInstance->setApplicationInstance($applicationInstance);
// Return the prepared instance
return $resolverInstance;
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set namespace and controller name
$resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Controller');
$resolverInstance->setControllerName($controllerName);