From: Roland Häder Date: Sun, 16 Jul 2017 12:24:09 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=deb4c766b3c6af391dc3beb4a7a450ae2a6249c2;p=core.git Continued: - imported much more framework stuff, found by CodeCoverage - renamed some namespaces - FuseWrapper seems to be no longer maintained? ;-( Signed-off-by: Roland Häder --- diff --git a/framework/config/class_FrameworkConfiguration.php b/framework/config/class_FrameworkConfiguration.php index 9da74c43..014c08cd 100644 --- a/framework/config/class_FrameworkConfiguration.php +++ b/framework/config/class_FrameworkConfiguration.php @@ -18,7 +18,7 @@ use CoreFramework\Registry\Registerable; * * @see ClassLoader * @author Roland Haeder - * @version 0.0.0 + * @version 1.0.1 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org diff --git a/framework/main/classes/controller/html/class_Html b/framework/main/classes/controller/html/class_Html index 8057f3be..d884b243 100644 --- a/framework/main/classes/controller/html/class_Html +++ b/framework/main/classes/controller/html/class_Html @@ -1,6 +1,17 @@ * @version 0.0.0 diff --git a/framework/main/classes/controller/html/class_HtmlConfirmController.php b/framework/main/classes/controller/html/class_HtmlConfirmController.php index 48c2b71b..685f9e0d 100644 --- a/framework/main/classes/controller/html/class_HtmlConfirmController.php +++ b/framework/main/classes/controller/html/class_HtmlConfirmController.php @@ -6,6 +6,7 @@ namespace CoreFramework\Controller\Confirm; use CoreFramework\Controller\BaseController; use CoreFramework\Controller\Controller; use CoreFramework\Factory\ObjectFactory; +use CoreFramework\Request\Requestable; use CoreFramework\Resolver\Command\CommandResolver; use CoreFramework\Response\Responseable; diff --git a/framework/main/classes/controller/html/class_HtmlDefaultNewsController.php b/framework/main/classes/controller/html/class_HtmlDefaultNewsController.php index a0204ecb..b6085f75 100644 --- a/framework/main/classes/controller/html/class_HtmlDefaultNewsController.php +++ b/framework/main/classes/controller/html/class_HtmlDefaultNewsController.php @@ -6,6 +6,7 @@ namespace CoreFramework\Controller\News; use CoreFramework\Controller\BaseController; use CoreFramework\Controller\Controller; use CoreFramework\Factory\ObjectFactory; +use CoreFramework\Request\Requestable; use CoreFramework\Resolver\Command\CommandResolver; use CoreFramework\Response\Responseable; diff --git a/framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php b/framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php index 25ea8bad..578f6fd9 100644 --- a/framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php +++ b/framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php @@ -4,6 +4,7 @@ namespace CoreFramework\Database\Frontend; // Import framework stuff use CoreFramework\Database\Frontend\BaseDatabaseWrapper; +use CoreFramework\Registry\Registerable; /** * A database wrapper for payments diff --git a/framework/main/classes/database/frontend/class_UserPointsDatabaseWrapper.php b/framework/main/classes/database/frontend/class_UserPointsDatabaseWrapper.php index dd6ea62e..c73f23df 100644 --- a/framework/main/classes/database/frontend/class_UserPointsDatabaseWrapper.php +++ b/framework/main/classes/database/frontend/class_UserPointsDatabaseWrapper.php @@ -6,6 +6,7 @@ namespace CoreFramework\Database\Frontend\Points; use CoreFramework\Database\Frontend\BaseDatabaseWrapper; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Registry\Registerable; +use CoreFramework\Result\Update\UpdateableResult; /** * A database wrapper for user points classes diff --git a/framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php b/framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php index fcd58dfb..f499e7c0 100644 --- a/framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php +++ b/framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php @@ -3,6 +3,8 @@ namespace CoreFramework\Discovery\Payment; // Import framework stuff +use CoreFramework\Discovery\BaseDiscovery; +use CoreFramework\Discovery\Discoverable; use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Filter\Filterable; diff --git a/framework/main/classes/factories/index/class_FileStackIndexFactory.php b/framework/main/classes/factories/index/class_FileStackIndexFactory.php index f4594997..baf1b389 100644 --- a/framework/main/classes/factories/index/class_FileStackIndexFactory.php +++ b/framework/main/classes/factories/index/class_FileStackIndexFactory.php @@ -5,7 +5,7 @@ namespace CoreFramework\Factory\Filesystem\Stack; // Import framework stuff use CoreFramework\Factory\ObjectFactory; use CoreFramework\Registry\Registry; -use CoreFramework\Stack\Index\IndexableStack; +use CoreFramework\Stacker\Index\IndexableStack; /** * A factory class for file-based stack indexes diff --git a/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php b/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php index e55a95fb..bfbf4dbf 100644 --- a/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php +++ b/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php @@ -6,6 +6,7 @@ namespace CoreFramework\Filesystem\File; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Filesystem\Block; use CoreFramework\Filesystem\Block\CalculatableBlock; +use CoreFramework\Filesystem\File\BaseAbstractFile; /** * A general binary file class diff --git a/framework/main/classes/file_directories/text/class_BaseTextFile.php b/framework/main/classes/file_directories/text/class_BaseTextFile.php index af363cfe..b37010ba 100644 --- a/framework/main/classes/file_directories/text/class_BaseTextFile.php +++ b/framework/main/classes/file_directories/text/class_BaseTextFile.php @@ -3,6 +3,7 @@ namespace CoreFramework\Filesystem\File; // Import framework stuff +use CoreFramework\Filesystem\File\BaseAbstractFile; use CoreFramework\Generic\UnsupportedOperationException; /** diff --git a/framework/main/classes/file_directories/text/output/class_BaseOutputTextFile.php b/framework/main/classes/file_directories/text/output/class_BaseOutputTextFile.php index 5e988f9a..90bdc6c8 100644 --- a/framework/main/classes/file_directories/text/output/class_BaseOutputTextFile.php +++ b/framework/main/classes/file_directories/text/output/class_BaseOutputTextFile.php @@ -4,6 +4,7 @@ namespace CoreFramework\Filesystem\Text; // Import framework stuff use CoreFramework\Factory\ObjectFactory; +use CoreFramework\Filesystem\File\BaseAbstractFile; use CoreFramework\Output\BaseOutput; /** diff --git a/framework/main/classes/fuse/class_FrameworkFuseWrapper.php b/framework/main/classes/fuse/class_FrameworkFuseWrapper.php deleted file mode 100644 index 794b6fcc..00000000 --- a/framework/main/classes/fuse/class_FrameworkFuseWrapper.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * 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 . - */ -class FrameworkFuseWrapper extends FuseWrapper implements Registerable { - /** - * Get attributes - * - * @param $path Path to get attributes from - * @param $stbuf An instance of a FuseStat class - * @return Status code - */ - public function FsGetAttr ($path, FuseStat $stbuf) { - if (strcmp($path, '/') == 0 ) { - $stbuf->st_mode = FUSE_S_IFDIR | 0750; - $stbuf->st_nlink = 2; - } else { - $stbuf->st_uid = posix_getuid(); - $stbuf->st_gid = posix_getgid(); - $stbuf->st_mode = FUSE_S_IFREG | 0640; - $stbuf->st_nlink = 1; - $stbuf->st_size = 56; - $stbuf->st_mtime = 1226379246; - } - - return -FUSE_ENOERR; - } - - /** - * Open operation - * - * @param $path Path to open - * @param $fi An instance of a FuseFileInfo class - * @return Status code - */ - public function FsOpen ($path, FuseFileInfo $fi) { - if (($fi->flags & FUSE_O_ACCMODE) != FUSE_O_RDONLY) { - return -FUSE_ENOACCES; - } // END - if - - return -FUSE_ENOERR; - } - - /** - * Read operation - * - * @param $path Path to open - * @param $buf Read data - * @param $size Maximum expected size (?) - * @param $offset Seek offset - * @param $fi An instance of a FuseFileInfo class - * @return Length of read data - */ - public function FsRead ($path, &$buf, $size, $offset, FuseFileInfo $fi) { - $data = 'You have implemented your first FUSE file system with PHP!' . PHP_EOL; - - if ($offset > strlen($data)) { - return 0; - } // END - if - - $buf = substr( $data, $offset, $size ); - - return strlen($data); - } - - /** - * Read directory operation - * - * @param $path Path to open - * @param $buf An array with all read entries - * @return Status code - */ - public function FsReadDir ($path, array &$buf) { - if (strcmp($path, '/') != 0) { - return -FUSE_ENOENT; - } // END - if - - $buf[] = '.'; - $buf[] = '..'; - $buf[] = 'helloworld.txt'; - - return -FUSE_ENOERR; - } - -} diff --git a/framework/main/classes/fuse/class_FrameworkFuseWrapper.php_discontinued b/framework/main/classes/fuse/class_FrameworkFuseWrapper.php_discontinued new file mode 100644 index 00000000..f3ebcae4 --- /dev/null +++ b/framework/main/classes/fuse/class_FrameworkFuseWrapper.php_discontinued @@ -0,0 +1,117 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * 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 . + */ +class FrameworkFuseWrapper extends FuseWrapper implements Registerable { + /** + * Get attributes + * + * @param $path Path to get attributes from + * @param $stbuf An instance of a FuseStat class + * @return Status code + */ + public function FsGetAttr ($path, FuseStat $stbuf) { + if (strcmp($path, '/') == 0 ) { + $stbuf->st_mode = FUSE_S_IFDIR | 0750; + $stbuf->st_nlink = 2; + } else { + $stbuf->st_uid = posix_getuid(); + $stbuf->st_gid = posix_getgid(); + $stbuf->st_mode = FUSE_S_IFREG | 0640; + $stbuf->st_nlink = 1; + $stbuf->st_size = 56; + $stbuf->st_mtime = 1226379246; + } + + return -FUSE_ENOERR; + } + + /** + * Open operation + * + * @param $path Path to open + * @param $fi An instance of a FuseFileInfo class + * @return Status code + */ + public function FsOpen ($path, FuseFileInfo $fi) { + if (($fi->flags & FUSE_O_ACCMODE) != FUSE_O_RDONLY) { + return -FUSE_ENOACCES; + } // END - if + + return -FUSE_ENOERR; + } + + /** + * Read operation + * + * @param $path Path to open + * @param $buf Read data + * @param $size Maximum expected size (?) + * @param $offset Seek offset + * @param $fi An instance of a FuseFileInfo class + * @return Length of read data + */ + public function FsRead ($path, &$buf, $size, $offset, FuseFileInfo $fi) { + $data = 'You have implemented your first FUSE file system with PHP!' . PHP_EOL; + + if ($offset > strlen($data)) { + return 0; + } // END - if + + $buf = substr( $data, $offset, $size ); + + return strlen($data); + } + + /** + * Read directory operation + * + * @param $path Path to open + * @param $buf An array with all read entries + * @return Status code + */ + public function FsReadDir ($path, array &$buf) { + if (strcmp($path, '/') != 0) { + return -FUSE_ENOENT; + } // END - if + + $buf[] = '.'; + $buf[] = '..'; + $buf[] = 'helloworld.txt'; + + return -FUSE_ENOERR; + } + +} diff --git a/framework/main/classes/helper/captcha/class_BaseCaptcha.php b/framework/main/classes/helper/captcha/class_BaseCaptcha.php index ce4ba7f9..1102996a 100644 --- a/framework/main/classes/helper/captcha/class_BaseCaptcha.php +++ b/framework/main/classes/helper/captcha/class_BaseCaptcha.php @@ -1,10 +1,11 @@ . */ -class ConnectionAlreadyRegisteredException extends AbstractConnectionException { +class ConnectionAlreadyRegisteredException extends FrameworkException { /** * A Constructor for this exception * diff --git a/framework/main/exceptions/database/general/class_SqlException.php b/framework/main/exceptions/database/general/class_SqlException.php index 05003dc2..862cc5e9 100644 --- a/framework/main/exceptions/database/general/class_SqlException.php +++ b/framework/main/exceptions/database/general/class_SqlException.php @@ -2,6 +2,9 @@ // Own namespace namespace CoreFramework\Database\Sql; +// Import framework stuff +use CoreFramework\Database\DatabaseException; + /** * A SQL exception thrown when an SQL error was detected. * diff --git a/framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php b/framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php index 6447f931..454558f1 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php @@ -3,6 +3,7 @@ namespace CoreFramework\Deprecated; // Import framework stuff +use CoreFramework\Database\DatabaseException; use CoreFramework\Generic\FrameworkInterface; /** diff --git a/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php b/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php index 3725cf7e..49d104f6 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php @@ -2,6 +2,9 @@ // Own namespace namespace CoreFramework\Deprecated; +// Import framework stuff +use CoreFramework\Database\DatabaseException; + /** * An exception thrown when the save path is no directory * diff --git a/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php b/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php index a8db0666..0b32e1dc 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php @@ -2,6 +2,9 @@ // Own namespace namespace CoreFramework\Deprecated; +// Import framework stuff +use CoreFramework\Database\DatabaseException; + /** * An exception thrown when the save path is read-protected * diff --git a/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php b/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php index 7bb8ead5..49add0a4 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php @@ -2,6 +2,9 @@ // Deprecated: namespace CoreFramework\Deprecated; +// Import framework stuff +use CoreFramework\Database\DatabaseException; + /** * An exception thrown when the save path is write-protected * diff --git a/framework/main/exceptions/helper/class_FormOpenedException.php b/framework/main/exceptions/helper/class_FormOpenedException.php index d88f87d5..cdd74ce7 100644 --- a/framework/main/exceptions/helper/class_FormOpenedException.php +++ b/framework/main/exceptions/helper/class_FormOpenedException.php @@ -4,6 +4,7 @@ namespace CoreFramework\Deprecated; // Import framework stuff use CoreFramework\Generic\FrameworkException; +use CoreFramework\Helper\BaseHelper; /** * An exception thrown when the form is still opened but we e.g. shall flush diff --git a/framework/main/exceptions/helper/class_InvalidFormNameException.php b/framework/main/exceptions/helper/class_InvalidFormNameException.php index 0ddf0278..f336599a 100644 --- a/framework/main/exceptions/helper/class_InvalidFormNameException.php +++ b/framework/main/exceptions/helper/class_InvalidFormNameException.php @@ -4,6 +4,7 @@ namespace CoreFramework\Deprecated; // Import framework stuff use CoreFramework\Generic\FrameworkException; +use CoreFramework\Helper\BaseHelper; /** * An exception thrown when the form name is invalid (set to false) diff --git a/framework/main/exceptions/main/class_DimNotFoundInArrayException.php b/framework/main/exceptions/main/class_DimNotFoundInArrayException.php index 858119e9..9e48957f 100644 --- a/framework/main/exceptions/main/class_DimNotFoundInArrayException.php +++ b/framework/main/exceptions/main/class_DimNotFoundInArrayException.php @@ -3,6 +3,7 @@ namespace CoreFramework\Deprecated; // Import framework stuff +use CoreFramework\Generic\FrameworkException; use CoreFramework\Generic\FrameworkInterface; /** diff --git a/framework/main/exceptions/main/class_InvalidClassNameException.php b/framework/main/exceptions/main/class_InvalidClassNameException.php index 43bb8ec8..69061f7c 100644 --- a/framework/main/exceptions/main/class_InvalidClassNameException.php +++ b/framework/main/exceptions/main/class_InvalidClassNameException.php @@ -3,6 +3,7 @@ namespace CoreFramework\Deprecated; // Import framework stuff +use CoreFramework\Generic\FrameworkException; use CoreFramework\Generic\FrameworkInterface; /** diff --git a/framework/main/exceptions/main/class_InvalidInterfaceException.php b/framework/main/exceptions/main/class_InvalidInterfaceException.php index 1458a3cb..2204526e 100644 --- a/framework/main/exceptions/main/class_InvalidInterfaceException.php +++ b/framework/main/exceptions/main/class_InvalidInterfaceException.php @@ -2,6 +2,9 @@ // Own namespace namespace CoreFramework\Object; +// Import framework stuff +use CoreFramework\Generic\FrameworkException; + /** * An exception thrown when an class instance does not implement a given interface * diff --git a/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php b/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php index 5c7f98eb..743af0fa 100644 --- a/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php +++ b/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php @@ -3,6 +3,7 @@ namespace CoreFramework\Response; // Import framework stuff +use CoreFramework\Generic\FrameworkException; use CoreFramework\Generic\FrameworkInterface; /** diff --git a/framework/main/interfaces/captcha/class_SolveableCaptcha.php b/framework/main/interfaces/captcha/class_SolveableCaptcha.php index 5f20ee59..c17c370f 100644 --- a/framework/main/interfaces/captcha/class_SolveableCaptcha.php +++ b/framework/main/interfaces/captcha/class_SolveableCaptcha.php @@ -1,10 +1,10 @@ . */ -interface SolveableCaptcha extends FrameworkInterface { +interface SolveableCaptcha extends Helper { /** * Initiates the CAPTCHA * diff --git a/framework/main/interfaces/database/wrapper/class_BookablePointsWrapper.php b/framework/main/interfaces/database/wrapper/class_BookablePointsWrapper.php index eb34681d..0129bcff 100644 --- a/framework/main/interfaces/database/wrapper/class_BookablePointsWrapper.php +++ b/framework/main/interfaces/database/wrapper/class_BookablePointsWrapper.php @@ -1,6 +1,6 @@