Roland Häder [Fri, 19 May 2017 13:56:31 +0000 (15:56 +0200)]
Continued a bit:
- in the wake of mcrypt being deprecated, an OpenSSL-based implementation
needs to be written. This commit marks the start for it. Please note, that
currently you don't have *ANY* encryption as the methods are unfinished
- moved DATA_PAYLOAD_SEPARATOR to EncryptableStream
- updated TODOs.txt
Roland Häder [Thu, 18 May 2017 20:23:46 +0000 (22:23 +0200)]
Rewrite continued:
- the framework now attempts to initialize the application more OOP-ed
- this is done by calling 3 simple methods:
+ FrameworkBootstrap::initFramework();
+ FrameworkBootstrap::prepareApplication();
+ FrameworkBootstrap::startApplication();
- initFramework: 3 simple steps again:
+ scanFrameworkClasses: scans for framework-related classes, interfaces and
exceptions
+ determineRequestType: determines request-type (console, html) and loads all
given parameter into the initialized request class. It also initializes the
response instance
+ validateApplicationParameter: validates the parameter 'app' if it is there
and points to a valid application (very basic check, more later on)
- prepareApplication: Prepares detected application by attempting to load all
required include files and only optional if present. Please note that some
files are now deprecated and should be ported to the new methods (see below)
- startApplication: Starts the application by calling 3 methods:
+ setupApplicationData: replacement for data.php, sets all application's data.
Please don't set any configuration stuff here, this is still done in
config.php!
+ initApplication: Calls some additional methods to initialize application.
Here is a good place to init database instance by calling the shiny new
method initDatabaseInstance().
+ launchApplication: Still old method name which starts the application.
Please remove any request/response-init stuff from here as it is now
generically done in FrameworkBootstrap
- include files in framework/database/ are now all deprecated
- renamed framework/config.inc.php -> framework/config-global.php
- PrimeraPortal's API is history, so let us remove the obsolete file here, too
- some "contrib" files updated
- updated TODOs.txt
- moved rand.php to contrib/ folder
Roland Häder [Wed, 3 May 2017 16:05:20 +0000 (18:05 +0200)]
Continued:
- the word "Default" and "Array" is not possible to use alone in namespace like
<?php
namespace Some\Foo\Array;
?> <-- yes, discouraged. just to clearify end-of-php
- some math stuff "fixed".
- removed discouraged headers from all remaining scripts
Roland Haeder [Sun, 2 Apr 2017 18:44:02 +0000 (20:44 +0200)]
Continued:
- renamed BootstrapFramework -> FrameworkBootstrap as there are also similar
classes around, like FrameworkConfiguration
- require/include are no functions, don't use parentheses here (including old
tests, I know)
- continued with rewriting bootstrap: more methods in FrameworkBootstrap and
lesser include files in framework/ path
Roland Haeder [Sun, 26 Mar 2017 14:39:13 +0000 (16:39 +0200)]
Continued with rewrites:
- rewrote bootstrap to a more easier way, still index.php will contain a class
- this class has a method to detect the framework's path on common places
- splitted application_base_path and framework_base_path, was only base_path
before
Roland Häder [Tue, 14 Mar 2017 11:20:54 +0000 (12:20 +0100)]
strict naming-convention check can be disabled, but is not recommended in
general use. For example for PhpUnit unit tests this must be disabled, else
PHP_Invoker cannot be loaded.
Roland Häder [Thu, 9 Mar 2017 09:44:30 +0000 (10:44 +0100)]
Cleanup:
- removed old scripts which were used in SVN times
- some may become useful, like remote-deprecated.sh and find-bad-php.sh
- the later one now searches for discouraged ?> closing tag
- the first one can now be used with GIT to remove deprecated files
Roland Haeder [Tue, 28 Feb 2017 20:40:21 +0000 (21:40 +0100)]
Continued:
- added namespace to class config entries
- added "import" of CryptoHelper and Cryptable
- added "import" of Cacheable
- fixed tpzo in namespace
Roland Haeder [Tue, 28 Feb 2017 19:51:53 +0000 (20:51 +0100)]
Continued:
- added namespace to class config entries
- added "import" of SeekableWritableFileIterator and BaseIterator
- added "import" of Iterator (SPL)
- added "import" of BaseFeature and Feature
- added missing class EmailVerifierFilter
- added "import" of BaseFilter, Filterable, Requestable and Responseable
- added "import" of BaseInputTextFile and CsvInputStreamer
- also added missing namespace in class
Roland Haeder [Sun, 26 Feb 2017 21:19:53 +0000 (22:19 +0100)]
Continued:
- added namespace to class config entries
- added "import" of LanguageSystem
- added "import" of BaseTask (and in class template, too)
- added "import" of Visitable
- added "import" of ManageableGuest
- added "import" of BaseIndex, Indexable and IndexableStack
- added "import" of CalculatableBlock
- and no "we", better neutral words
Roland Haeder [Sun, 26 Feb 2017 21:05:14 +0000 (22:05 +0100)]
Continued:
- added "import" of BaseStacker and Stackable
- added "import" of BaseMailer and DeliverableMail
- added missing namespace in config entries
- killed more [EOF] and discouraged ?>
Roland Haeder [Sun, 26 Feb 2017 20:57:03 +0000 (21:57 +0100)]
Continued:
- added namespace to class config entries
- opps, need to multiply by 100
- added "import" of RandomNumberGenerator
- added "import" of BaseAction
Roland Haeder [Sun, 26 Feb 2017 20:47:30 +0000 (21:47 +0100)]
Continued:
- added basic interface Poolable (seems to be lost?)
- added "import" for it as well
- added "import" of ListenerVisitor and DecoratorVisitor
- added "import" of Listenable
- added "import" of BaseDecorator
Roland Haeder [Sun, 26 Feb 2017 20:34:28 +0000 (21:34 +0100)]
Continued:
- expanded class config entry with namespace
- added "import" of BaseVisitor, Visitor and TaskVisitor, PoolVisitor
- added "import" of Taskable
Roland Haeder [Sun, 26 Feb 2017 19:46:05 +0000 (20:46 +0100)]
Continued:
- it cannot be "List" as this is reserved (list() command), so take "Lists"
- added "import" of IteratorAggregate and Countable (both SPL)
- added "import" of BaseList and Listable
- added "import" of BaseFileIo, InputPointer and OutputPointer
Roland Haeder [Sun, 26 Feb 2017 18:58:40 +0000 (19:58 +0100)]
Continued:
- added generic test on loading classes configured in some_foo_class entries
- now you can see, why "_class" must be set
- added method getConfigurationArray() in FrameworkConfiguration which returns
the whole configuration array ...
- added "import" of XmlParser + fixed config entry with namespace
- added "import" of BaseParser and Parseable
Roland Haeder [Sun, 26 Feb 2017 16:07:55 +0000 (17:07 +0100)]
Moving-session has started:
- moved all files in application/tests/classes/ to framework/main/tests/ as
they can (and should) be used by any application that wishes to run (unit)
tests.
Roland Haeder [Sun, 26 Feb 2017 14:05:28 +0000 (15:05 +0100)]
Continued with tests and renaming:
- filters are also classes, so keep '_class' suffix for later (upcoming) tests
on it
- added base filter which currently does nothing special but later will
- added filter for pre-checking PHP requirements (some may come, such as
PHPUnit and more)
Roland Haeder [Sun, 26 Feb 2017 13:34:30 +0000 (14:34 +0100)]
Continued with renaming-season:
- renamed inc -> framework
- fixed all loaders and old tests (they will be rewritten anyway)
- added initial start message for tests application
- maybe the application will later have pre-filters for checking e.g.
if all requirements in PHP are given?
- no "hub" or "node" here
Roland Haeder [Sun, 26 Feb 2017 13:00:29 +0000 (14:00 +0100)]
Rewrites:
- rewrote detectCorePath() so it can handle more than one (.) path
- all my applications have this framework cloned to "./core/" and currently
uses a symbolic link inc/ -> core/inc/. This is then no longer needed and
should be removed from all projects. This surely implies that index.php has
been distributed on all projects.
- later on this will be changed, then there is no class in index.php, but only
one include file and one call to main() method.
Roland Haeder [Sat, 25 Feb 2017 17:16:42 +0000 (18:16 +0100)]
Continued:
- added "import" of SeekableIterator (SPL)
- added "import" of Registry
- InvalidFilterChainException is no longer deprecated
- added "import" of it
- added 'shutdown' filter chain
Roland Haeder [Sat, 25 Feb 2017 16:30:42 +0000 (17:30 +0100)]
Fixed and continued:
- need to call ApplicationHelper::createDebugInstance() before inc/database.php
is being loaded. This is old way anyway and will be rewritten right after this
rewrite.
- added "import" of CachedDatabaseResult and moved it to better namespace
- added "import of SearchableResult
- fixed config entry for it
- first BaseDatabaseResult is a result, then it is for databases (queries)
Roland Haeder [Sat, 25 Feb 2017 16:23:04 +0000 (17:23 +0100)]
Continued:
- all compressors now have own distinct namespace, so also the
CompressorChannel class needs some fixing
- added "import" of Compressor
- added "import" of DatabaseConnection
- added "import" of DatabaseConnector
Roland Haeder [Sat, 25 Feb 2017 16:10:57 +0000 (17:10 +0100)]
Continued:
- config entry for CompressorChannel expanded with namespace
- added "import" for same class
- it is a "middlware" class
- config entry for framework directory pointer expanded with namespace
- added "import" for FrameworkDirectory
- added "import" for DirectoryIterator (SPL)
Roland Haeder [Sat, 25 Feb 2017 15:58:18 +0000 (16:58 +0100)]
Continued:
- added missing config entry
- expanded config entry local_file_database_class with namespace
- need to load inc/database.php (which will later also be rewritten to an OOPed way)
- added "import" of FrameworkDatabase
- added "import" of BaseDatabaseBackend
- added "import" of DatabaseBackend
- added "import" of StoreableCriteria
Roland Haeder [Sat, 25 Feb 2017 15:43:20 +0000 (16:43 +0100)]
Continued:
- added "import" of DatabaseWrapperFactory
- added "import" of BaseDatabaseWrapper
- added "import" of SearchCriteria
- added "import" of Criteria
- expanded configuration entry with namespace (more will come)
Roland Haeder [Sat, 25 Feb 2017 15:37:56 +0000 (16:37 +0100)]
Continued:
- tests may later have filters but now let's not focus on it
- added "import" of BaseFactory
- added "import" of HtmlNewsFactory
- added "import" of ReadableNews
- added config entry news_reader_main_class
Roland Haeder [Sat, 25 Feb 2017 15:31:17 +0000 (16:31 +0100)]
Continued:
- to ease things, EmptyVariableException is no longer deprecated as it nicely
wraps the message, else if InvalidArgumentException or other SPL exception is
being used, the message must be copied all around.
- added "import" of EmptyVariableException
Roland Haeder [Fri, 24 Feb 2017 21:57:24 +0000 (22:57 +0100)]
Continued:
- add "import" for InvalidCommandException
- is<Action|Command|Controller>Valid() methods now have 2 parameters:
$namespace and $fooName
- InvalidCommandException is no longer deprecated
- removed [EOF] and ?>
Roland Haeder [Fri, 24 Feb 2017 21:10:34 +0000 (22:10 +0100)]
Continued:
- no need to have namespace as parameter (only isValidFoo() calls) as it can be
set in BaseResolver and all resolvers can use it which they must do anyway.
- added "import" for DefaultControllerException
- added "import" for Controller
Roland Haeder [Fri, 24 Feb 2017 20:23:05 +0000 (21:23 +0100)]
Continued:
- scanApplicationClasses() must be called before starter.php is being included.
- this whole thing is old and needs an entire rewrite (which will take place
slowly while this "namespace rewrite" and much more after it.
- added "import" for BaseResolver and Resolver
Roland Haeder [Fri, 24 Feb 2017 19:24:59 +0000 (20:24 +0100)]
Continued:
- added "import" for Responseable
- added "import" for StreamableInput
- all configured class names should not start with a backslash so the class
loader is not "confused" that there is an empty project/vendor name ... Well,
currently it ignores it but later maybe not.
- and last but not least, everywhere else no backslash is used for framework
"imports" so it is more consistent
Roland Haeder [Thu, 23 Feb 2017 21:00:39 +0000 (22:00 +0100)]
Continued with debugging:
- added exception InvalidClassNameException which is only being thrown by
ObjectFactory when the given class name is not following naming convention.
This is now strictly applied to all objects being created by that factory.
- introduced stripNamespaceFromClassName()
Roland Haeder [Thu, 23 Feb 2017 20:31:28 +0000 (21:31 +0100)]
Continued:
- added "import" for Streamable + fixed namespace, no plural
- added "import" for OutputStreamer
- added "import" for NullPointerException + thrown one in middleware
Roland Haeder [Wed, 22 Feb 2017 21:37:29 +0000 (22:37 +0100)]
Continued:
- "imported" Registry class
- rewrote exception handler to also handle anything else that implements
Throwable
- please note that application/<foo>/exceptions.php may become generalized
and will no longer be loaded as the same functionality is provided by this
framework then.
Roland Haeder [Tue, 21 Feb 2017 20:39:36 +0000 (21:39 +0100)]
Finished first cleanup (still a lot is broken):
- added more namespaces
- made more exceptions deprecated as there are better exceptions or names for it
- removed own [EOF] (old coding style)
- removed discouraged ?> from all files
Roland Haeder [Mon, 20 Feb 2017 22:08:14 +0000 (23:08 +0100)]
Continued:
- removed more [EOF] (own old style)
- removed more closing PHP tag as this is discouraged
- added namespaces + some more deprecation (can be replaced with generic
exceptions)
Roland Haeder [Wed, 15 Feb 2017 21:40:24 +0000 (22:40 +0100)]
Continued rewriting:
- 'loader.php' is now deprecated and also no longer loaded, instead selector.php
(also deprecated but still around) will load application's classes
- class name ApplicationHelper is now hard-wired
Roland Haeder [Mon, 13 Feb 2017 19:08:26 +0000 (20:08 +0100)]
Introduced namespaces:
- always use this pattern CoreFramework\Foo[\Bar] for namespaces
- added lots of namespaces (breaks all stuff)
- added "import" for FrameworkInterface
Roland Haeder [Wed, 29 Jun 2016 21:01:49 +0000 (23:01 +0200)]
Prepared rewrite of framework bootstrap:
- added initial class 'BootstrapFramework' which doesn't need to be
instanciated as only static methods will come
- $cfg in inc/config.php is now being unset, it is not good coding practice
to then use it outside the scope of the included file
- you then need to get $cfg again from
FrameworkConfiguration::getSelfInstance() to be able to set/get configuration
entries.
- added note how to deal with inc/config/config-local.php-dist which is an
example how to use it in your own applications.
- minor improvements (comments)
Roland Haeder [Wed, 29 Jun 2016 19:47:58 +0000 (21:47 +0200)]
Continued a bit:
- config-hubmaster.php is long time deprecated (from very early days) and the
'hub' project is the only one using it, so why keep it around?
- Some (needed by FrameworkInterface) methods now throw an
UnsupportedOperationException indicating that they are not implemented.
- Constructors are not even returning void, they are constructors (no real method)
Roland Haeder [Wed, 29 Jun 2016 18:04:56 +0000 (20:04 +0200)]
Continued a bit:
- line-feed is now Linux/Uni* way
- no more language-dependent templates, keep language out of them as they
should only define the structure of the website. Localization should be done
with e.g. php_intl