Skip to content

Commit

Permalink
Merge af9d950 into ae9d95f
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Oct 15, 2016
2 parents ae9d95f + af9d950 commit 26c8f31
Show file tree
Hide file tree
Showing 68 changed files with 925 additions and 781 deletions.
4 changes: 2 additions & 2 deletions dist/twist/Classes/Autoload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Autoload{

/**
* Initialise the AutoLoader and register the class as an AutoLoader
* @param $strBaseDir Base directory of the framework
* @param string $strBaseDir Base directory of the framework
*/
public static function init($strBaseDir){
self::$strBaseDir = $strBaseDir;
Expand All @@ -44,7 +44,7 @@ public static function init($strBaseDir){

/**
* Handler for each individual request, the path for the required file will be worked out here
* @param $strRequest The full class and namespace of the file to be loaded
* @param string $strRequest The full class and namespace of the file to be loaded
* @throws \Exception
*/
public static function load($strRequest){
Expand Down
14 changes: 7 additions & 7 deletions dist/twist/Classes/Error.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ function __construct(){

/**
* Get an array of the Apache request headers.
* @todo Needs to be re-written/optimised
*
* @return array
*/
public static function apacheRequestHeaders(){
public static function apacheRequestHeaders(){ //TODO: Needs to be re-written/optimised

$arrOut = array();
$regxHTTP = '/\AHTTP_/';
Expand Down Expand Up @@ -242,10 +242,10 @@ protected static function debugDataOutput($arrData){

/**
* PHP Error handler to capture all PHP errors so that they can be logged to a file or output into the debug window later.
* @param $intErrorNo
* @param $strError
* @param $strErrorFile
* @param $intErrorLine
* @param integer $intErrorNo
* @param string $strError
* @param string $strErrorFile
* @param integer $intErrorLine
*/
public static function handleError($intErrorNo, $strError, $strErrorFile, $intErrorLine){

Expand Down Expand Up @@ -727,7 +727,7 @@ public static function outputLog(){

/**
* Detect the error type as a string based on an error number.
* @param $intErrorNo
* @param integer $intErrorNo
* @return string
*/
public static function getType($intErrorNo){
Expand Down
2 changes: 1 addition & 1 deletion dist/twist/Classes/Instance.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function retrieveObject($strObjectKey){

/**
* Removes the object from the instance holder and destroys the object.
* @param $strObjectKey
* @param string $strObjectKey
*/
public static function removeObject($strObjectKey){
unset(self::$arrFrameworkObjects[$strObjectKey]);
Expand Down
2 changes: 1 addition & 1 deletion dist/twist/Classes/Shutdown.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function callEvents(){

/**
* Remove a registered even from the event list
* @param $strEventKey
* @param string $strEventKey
*/
public static function cancelEvent($strEventKey){
unset(self::$arrCallbackEvents[$strEventKey]);
Expand Down
15 changes: 10 additions & 5 deletions dist/twist/Core/Controllers/Base.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Base{
* A function that is called by Routes both to ensure that the controller has been extended and so that we can pass in resources and information required by the controller.
*
* @param \Twist\Core\Utilities\Route $resRoute
* @param $arrRouteData
* @param array $arrRouteData
* @return bool
*/
final public function _extended($resRoute,$arrRouteData){
Expand Down Expand Up @@ -102,6 +102,7 @@ public function _fallback(){
/**
* Over-ride the base view for the current page only.
*
* @param null $mxdBaseView
* @return null|string
*/
public function _baseView($mxdBaseView = null){
Expand Down Expand Up @@ -181,7 +182,7 @@ public function _getReplacements(){
/**
* Function to call any controller response with the correct method prefix if any has been setup. If the response function is not found a 404 page will be output.
*
* @param $strCallFunctionName Name of the function to be called
* @param string $strCallFunctionName Name of the function to be called
* @return bool
*/
final protected function _callFunction($strCallFunctionName){
Expand Down Expand Up @@ -224,7 +225,7 @@ public function _upload($strFileKey,$strType = 'file'){
$arrOut = array();

if(count($_FILES) && array_key_exists($strFileKey,$_FILES)){
$resUpload = new \Twist\Core\Controllers\Upload();
$resUpload = new Upload();

if(is_array($_FILES[$strFileKey]['name'])){
foreach($_FILES[$strFileKey]['name'] as $intKey => $mxdValue){
Expand Down Expand Up @@ -265,7 +266,7 @@ final public function _error($intError){
* @return bool
*/
final public function _response($intError,$strCustomDescription = null){
Error::errorPage($intError,$strCustomDescription);
Error::response($intError,$strCustomDescription);
return false;
}

Expand Down Expand Up @@ -344,7 +345,7 @@ protected function _var($strVarKey = null){

/**
* Process a view template file and return the output.
* @param $dirView
* @param string $dirView
* @param null $arrViewTags
* @param bool $blRemoveUnusedTags
* @return string
Expand All @@ -355,6 +356,10 @@ protected function _view($dirView,$arrViewTags = null,$blRemoveUnusedTags = fals

/**
* @alias _view
* @param string $dirView
* @param null $arrViewTags
* @param bool $blRemoveUnusedTags
* @return string
*/
protected function _render($dirView,$arrViewTags = null,$blRemoveUnusedTags = false){
return $this->_view($dirView,$arrViewTags,$blRemoveUnusedTags);
Expand Down
5 changes: 3 additions & 2 deletions dist/twist/Core/Controllers/BaseAJAX.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function _baseCalls(){
/**
* Set the status for the Ajax response, true by default
*
* @param $blStatus
* @param bool $blStatus
*/
public function _ajaxStatus($blStatus){
$this->blAjaxResponse = ($blStatus !== false);
Expand All @@ -62,7 +62,7 @@ public function _ajaxFail(){

/**
* Set a message to be returned to the Ajax call, can be used for an error message
* @param $strMessage
* @param string $strMessage
*/
public function _ajaxMessage($strMessage=''){
$this->strAjaxResponseMessage = $strMessage;
Expand All @@ -71,6 +71,7 @@ public function _ajaxMessage($strMessage=''){
/**
* Encode the response of the AJAX output
* @param array $mxdData
* @param bool $blDebug
* @return string
*/
public function _ajaxRespond($mxdData=array(), $blDebug = false){
Expand Down
3 changes: 1 addition & 2 deletions dist/twist/Core/Controllers/InstallWizard.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ public function user(){
/**
* Pre-install some packages and setup some systems like the manager
* Currently skips this step in initial release of V3
* @return string
*/
public function package(){

Expand Down Expand Up @@ -354,7 +353,7 @@ public function package(){
}

if($arrSession['user']['status']){
//@todo Skip the interfaces step for the time being, it will become packages when ready
//TODO: Skip the interfaces step for the time being, it will become packages when ready
header('Location: finish');
}else{
header('Location: user');
Expand Down
2 changes: 1 addition & 1 deletion dist/twist/Core/Controllers/Manager.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function cache(){

/**
* Run through all the cache files and build up a list of what has been cached
* @param $strCacheFolder
* @param string $strCacheFolder
*/
protected function parseCache($strCacheFolder){

Expand Down
4 changes: 2 additions & 2 deletions dist/twist/Core/Controllers/Placeholder.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function _index(){
$intPadding = 10;
$intThickness = 5;

$intStartX = $intPadding;
$intStartY = $intPadding;
//$intStartX = $intPadding;
//$intStartY = $intPadding;
$intEndX = $intWidth - $intPadding;
$intEndY = $intHeight - $intPadding;

Expand Down
2 changes: 1 addition & 1 deletion dist/twist/Core/Controllers/Upload.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function asset($strFileKey = null,$intIndex = null){
protected function storeFile($strFileKey = null,$intIndex = null){

if(is_array($_FILES) && count($_FILES)){
$arrOut = \Twist::File()->upload($strFileKey,null,$intIndex);
$arrOut = \Twist::File()->upload($strFileKey,null,$intIndex); //TODO: Is $intIndex used?
}else{
$arrOut = \Twist::File()->uploadPUT();
}
Expand Down
16 changes: 8 additions & 8 deletions dist/twist/Core/Models/Archive/Native.model.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Native{

/**
* Create an archive resource ready to accept files and folders
* @param $strZipArchive
* @param string $strZipArchive
* @return boolean
*/
public function create($strZipArchive){
Expand All @@ -41,7 +41,7 @@ public function create($strZipArchive){

/**
* Load in an existing archive and store it as a resource ready to be manipulated/extracted.
* @param $strZipArchive
* @param string $strZipArchive
* @return boolean
*/
public function load($strZipArchive){
Expand All @@ -52,40 +52,40 @@ public function load($strZipArchive){

/**
* Add a file to the archive resource
* @param $strLocalFile
* @param $strZipPath
* @param string $strLocalFile
* @param string $strZipPath
*/
public function addFile($strLocalFile,$strZipPath){
$this->resZip->addFile($strLocalFile,$strZipPath);
}

/**
* Extract the files from the archive resource
* @param $strExtractPath
* @param string $strExtractPath
*/
public function extract($strExtractPath){
$this->resZip->extractTo($strExtractPath);
}

/**
* Add an empty folder to the archive resource
* @param $strDirectoryPath
* @param string $strDirectoryPath
*/
public function addEmptyDir($strDirectoryPath){
$this->resZip->addEmptyDir($strDirectoryPath);
}

/**
* Set a comment in the archive comment field, the comment can be seen when extracting the archive on commandline or using certain GUI tools.
* @param $strComment
* @param string $strComment
*/
public function setArchiveComment($strComment){
$this->resZip->setArchiveComment($strComment);
}

/**
* Delete a file or folder form the archive by its path.
* @param $strDirectoryPath
* @param string $strDirectoryPath
*/
public function deleteName($strDirectoryPath){
$this->resZip->deleteName($strDirectoryPath);
Expand Down
16 changes: 8 additions & 8 deletions dist/twist/Core/Models/Archive/PclZip.model.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(){

/**
* Create an archive resource using the PclZip Third party package ready to accept files and folders
* @param $strZipArchive
* @param string $strZipArchive
* @return mixed
*/
public function create($strZipArchive){
Expand All @@ -46,7 +46,7 @@ public function create($strZipArchive){

/**
* Load in an existing archive using the PclZip Third party package and store it as a resource ready to be manipulated/extracted.
* @param $strZipArchive
* @param string $strZipArchive
* @return boolean
*/
public function load($strZipArchive){
Expand All @@ -55,8 +55,8 @@ public function load($strZipArchive){

/**
* Add a file to the archive resource using the PclZip Third party package.
* @param $strLocalFile
* @param $strZipPath
* @param string $strLocalFile
* @param string $strZipPath
*/
public function addFile($strLocalFile,$strZipPath){

Expand All @@ -68,31 +68,31 @@ public function addFile($strLocalFile,$strZipPath){

/**
* Extract the files from the archive resource using the PclZip Third party package.
* @param $strExtractPath
* @param string $strExtractPath
*/
public function extract($strExtractPath){
return ($this->resZip->extract(PCLZIP_OPT_PATH, $strExtractPath) == 0) ? false : true;
}

/**
* Add an empty folder to the archive resource using the PclZip Third party package.
* @param $strDirectoryPath
* @param string $strDirectoryPath
*/
public function addEmptyDir($strDirectoryPath){
$this->resZip->addEmptyDir($strDirectoryPath);
}

/**
* Set a comment in the archive comment field using the PclZip Third party package, the comment can be seen when extracting the archive on commandline or using certain GUI tools.
* @param $strComment
* @param string $strComment
*/
public function setArchiveComment($strComment){
$this->resZip->setArchiveComment($strComment);
}

/**
* Delete a file or folder form the archive by its path using the PclZip Third party package.
* @param $strDirectoryPath
* @param string $strDirectoryPath
*/
public function deleteName($strDirectoryPath){
$this->resZip->deleteName($strDirectoryPath);
Expand Down

0 comments on commit 26c8f31

Please sign in to comment.