Giter Site home page Giter Site logo

Comments (4)

roxblnfk avatar roxblnfk commented on August 23, 2024 3

@Skrol29 what do you think about releasing a new major version of the TBS package, which will support minimum PHP 7.4?

This can be done with preservation of API and compatibility (using a decorators). This will have modern code that adheres to PSR, with phpunit 9 for testing, etc.

from tinybutstrong.

Skrol29 avatar Skrol29 commented on August 23, 2024 1

@Skrol29 what do you think about releasing a new major version of the TBS package, which will support minimum PHP 7.4?
This can be done with preservation of API and compatibility (using a decorators). This will have modern code that adheres to PSR, with phpunit 9 for testing, etc.

Having a major version suitable for PHP 7 and modern coding is a very nice idea which I often think of.
I also think about leaving unused features (such as Assigned merging for which I have zero feedback) ; add new a barrel feature for the Engine in order to have it processing sub-templates in the same way as OpenTBS ; and some few renaming.
So it is not clear for me to have all this in one major version or several.

from tinybutstrong.

Skrol29 avatar Skrol29 commented on August 23, 2024

Hi,

Sorry I need more time to reproduce this issue since Preloading is not available on PHP for Windows for now. (shame on me, I use Windows). My Linux environment is far from here.

It’s surprising that constants are ignored with preloading. The documentation is unclear on this point :

Any symbols (functions, classes, etc.) in those files will then become globally available

I wonder if PHP 8 has the same behavior.

Nevertheless I agree the next major TBS version should avoid named constants (define) and use Class constants instead.

A waiting solution could be to have TBS and OpenTBS constants defined only once dynamically at the first instantation of the class.
Does such a solution sounds ok for you ?

from tinybutstrong.

spackmat avatar spackmat commented on August 23, 2024

@Skrol29 I was also surprised, but it is consequent as define() is a function called at runtime and preloading doesn't run any code, but only compiles the symbols and keeps them in memory. So code in preloaded files outside those symbols will never run, because the actual files are not required/included anymore.

A waiting solution could be to have TBS and OpenTBS constants defined only once dynamically at the first instantation of the class. Does such a solution sounds ok for you ?

You mean inside the constructor of the main classes with a check like if (!defined('MY_GLOBAL_CONSTANT')){define('MY_GLOBAL_CONSTANT', 'MY_VALUE');}? Could work.

My devsystem is also on windows, so I see that problem only in staging/production. Nice surprise. ;)

Besides that: A new major version with contemporary coding is always a good idea.

from tinybutstrong.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.