Skip to content

Changelog

Jorge Castro edited this page Mar 26, 2024 · 45 revisions

Version

  • 4.13
    • added @class, @style,@checked,@selected,@disabled,@readonly and @required.
  • 4.12
    • Updating dependency to PHP 7.4. The extended support of PHP 7.2 ended 3 years ago.
    • Adding more type "hinting" to the code.
  • 4.11
    • Added singleton, so it is possible to obtain the current instance (or create a default one) with BladeOne::$instance or BladeOne::getInstance()
    • Added the next methods to control the stack (the stack is used together with runtime controls
      • addControlStackChild
      • addControlStackSibling
      • closeControlStack
      • closeControlStackParent
      • lastControlStack
      • parentControlStack
      • clearControlStack
    • With addMethod we could add a new method without extending the class or using strut
    • New method clearMethods allows to clear the methods added with addMethod()
    • Runtime controls are now available, so now it is possible to create new controls (tags) without much complexity. https://github.com/EFTEC/BladeOne/wiki/Custom-Control
  • 4.10
    • pulled a request pending.
    • #185 changing exception -> throwable
    • changed some phpdocs because Visual Studio PHP extension does not work with < pre>< /pre> tags, so moved to markdown tags.
  • 4.09
    • #175 now @stack() allows to specify a wildcard at the end of the name, example @stack("name*") will show any stack that starts with "name".
  • 4.08.2
    • Pulling the latest PR.
    • And modifying the tests.
    • Since this version was published as 4.8 instead of 4.7, so I keep it as 4.8
  • 4.07.1
    • pull 16
  • 4.07
    • [optimization] A small optimization. The library does not check if the template folder is a directory or not, every time the file is compiled. No user intervention is required. It also doesn't create the compiles folder automatically, you can create it manually or using the cli.
    • [cli] cli (command line interface) now is installed in the bin folder of vendor. (vendor/bin)
    • [cli] cli now allows to the creation of the folders compilation and template (view).
  • 4.05.4
    • Solved a problem when a comment includes the word "@foreach". It could present other problems with other directives but it is the fix for now.
    • Solved a fix when the argument of e() is a number.
    • Simplified the expression regular that validates an IP
  • 4.05
    • Modified method getCompiledFile() to allow to set the name of the compiled file to no-change, encrypted with sha1 or encrypted with md5. It does not change the current behavior of the library.
    • Added the method setCompileTypeFileName() so you can set how the name of the compiled file will be generated.
    • Added the method getCompileTypeFileName()
    • All private methods were changed to "protected".
  • 4.04.2
    • fix method wrapPHP(), if $input is null then it raises a deprecated warning.
    • fix method parseArgs(), it raises a deprecated when the argument is a text with a single space.
  • 4.04.1
    • PR #148
    • Added more unit testing.
  • 4.04 2022-02-04
    • Elevating compatibility level to PHP >=7.2.5. Why? I am pairing the compatibility with Composer (Composer 2.2 requires PHP 7.2.5). PHP 7.2 is not supported officially but I will support it for a couple of years more. Older versions of BladeOne will still support PHP <7.2
    • Type hinting. The "new versions" (since PHP 7.1) of PHP include type hinting in the arguments and in the value returned by a method. However, it affects the performance (type hinting validates values). I add type hinting for return values but I can't add type hinting for the arguments without affecting the performance. Instead, I will stay with PHPDOCS. I must remark this library aims for performance.
    • CodeSniffer is out. I use PHPStorm and it does a better job without impacting the performance. Also, this code wasn't compatible with CodeSniffer, for example, the method compile_e() that sadly, I can't change its name.
    • A lot of cleanups. However, it didn't change the logic of any method.
  • 4.03 2022-02-03
    • PHP 8.1 breaks a lot of things with different libraries, including when the parameters are NULL. I added a new couple of fixes aimed at PHP 8.1
    • Updated dependency for PHPUnit 7.5.20
    • Corrected some tests that fails in PHP 8.1. Now, it works in PHP >=7.1
  • 4.02 2021-12-15
    • Added CLI, so you can clean the compile folder and check the validation of the folders.
  • 4.01 *
  • 4.00 2021-09-24
    • It drops support of PHP 5.6 and 7.0. If you want support for PHP 5.6, then you can use version 3.52 that which is still functional.
    • The code is refactored to be compatible with PHP 7.1 and higher.
    • I am not adding the type of arguments because PHP considers it as a validation (it impacts the performance a little but still impacts). So, I stick with PHPDOC.
  • 3.52 2021-04-17
    • Added $this->throwOnError that throw an exception on error (by default the value is false). However, a previous error that throws an exception still throws it.
    • [internal] Almost every exception is derived to the method showError() instead of throwing directly.
    • [optimization] Removed unneeding { }
    • [format] The arguments of PHPDOC blocks are aligned correctly.
  • 3.51 2021-02-26
    • added field $compileCallbacks
  • 3.50 2021-02-25
    • Performance: Replaced file_exists() with is_file() and is_folder().
  • 3.49.1 2021-01-14
    • Fixed @set: @set($var=$aa['aaa']) it is converted incorrectly into $var=$aa[aaa] instead of $var=$aa['aaa']
    • The method compileString is now public (it is used for testing).
  • 3.49 2021-01-10
    • Added field $includeScope (see wiki about Template-inheritance)
  • 3.48 2021-01-03
  • 3.47.3 2020-10-16
    • Fixed a bug calling the method addAssetDict() when the asset dictionary is null and the argument is an array.
  • 3.47.2 2020-09-25
    • fixed @inject. It failed to remove the quotes. Now, it trims the result before removing the quotes. Also, the function is optimized.
  • 3.47.1 2020-09-18
    • pipes now allow us to define a default value ($variable | "default").
    • Removed condition that it is not used.
    • The tag @component backups and recover the arguments used.
  • 3.47 2020-08-30
    • new method getRelativePath()
    • new method getCurrentUrlCalculated() and setCurrentUrlCalculated()
    • new method getCurrentUrl() and setCurrentUrl()
    • new method setCanonicalUrl() and getCanonicalUrl()
    • new tags @canonical and @base
  • 3.46.3 method composer() works with the main template and the extended template.
  • 3.46.2 2020-7-18
    • Some performance tune. @$var is x10 less efficient than isset($var) ? $var : null
  • 3.46.1 2020-6-16

    • Fix: The method BladeOne::setbaseurl() could generate a warning if the client does not set the server.
  • 3.46 2020-06-12

  • 3.45.1 2020-06-06

    • Fixed a small bug with the method wildCardComparison() used by the evaluation of composer(). Now, this example works:
   $this->composer('*',...); // it is executed for all pages.
  • 3.45 2020-06-06

    • The argument $view of the method run() is now optional. It allows us to work fluently.
    • The method run() resets the internal variables once the view is executed.
    • The method shared() now allows sets an array. Also, this method works fluently.
    • Added the method setView() to define the view fluently.
    • Added the method composer() to define logic before the view is called.
    • Added the method with() that is a wrapper of shared().
  • 3.44.3

  • 3.44.2

    • Fixed a bug in @foreach and $loop->last. Now it returns the correct value.
  • 3.44.1

    • if the view file is not found then it shows the full path.
  • 2020-05-08 3.44

    • It is important: The tags {{ }} and @foreach are heavily optimized.
    • {{$variable}} will fail if $variable is an array or object. Previously, it was turned into a json_encode. Why it was changed? Because it affected the performance. Solution: You could use @json() or @dump()
    • {{$variable}} used to generate a static call: static::e($variable). Now it calls \htmlentities() directly
    • @foreach was also optimized.
    • The library was re-optimized. $this->phpTag and $this->phpTagEcho are used everywhere in the code.
  • 2020-05-02 3.43

    • parseArgs() (it is an internal function), now considers empty arguments. It is used by eftec/BladeOneHtml.
  • 2020-04-25 3.41.1

    • updated BladeOneCache.php
  • 2020-04-24 3.41

    • updated BladeOneCache.php
  • 2020-04-22 3.40

    • Lots of cleanup.
    • new method getArgs() (protected). It is used for named parameters.
    • This library will never ever pass codesniffing (we have a method called _e for a purpose).
    • It adds a constructor feature for every trait.
  • 2020-04-21 3.39

    • fix method isQuoted() when the string is fewer than 2 chars.
    • new method isVariablePHP()
  • 2020-04-20 3.38.1

    • fix in method parseArgs() when it returns a single array
  • 2020-04-20 3.38

    • new feature: named arguments (the method must support it to use)
    • new method wrapPHP() used internally
    • new method enq() It's equals than e() but it doesn't encode quotes
    • new method stripQuotes() It removes quotes from a string "aaa"=>aaa, 'aaa'=>aaa
    • new method addInsideQuote() It adds a string inside a quote (if any)
    • new method isQuoted() Returns true if the text is quoted
    • BladeOneHtml is deprecated (but not deleted) use instead eftec\bladeonehtml
  • BladeOneHtmlBootstrap is deprecated (but not deleted) use instead eftec\bladeonehtml

  • 2020-03-10 3.37

    • new tag @compilestamp() shows the date and time where the template was compiled.
    • new tag @viewname() shows the current view template, compile filename or template filename
  • 2020-02-28 3.36.2

    • @splitforeach fixed. Now, it works as base zero.
  • 2020.02-28 3.36.1

    • @method returned and fixed.
    • BladeOneHtml2 still in WIP
  • 2020-02-19 3.36

    • removed compileExpression() // it was never used
    • solved csrfIsValid() when it is compile with mode BladeOne::MODE_FAST
    • @csrf tag it has a new argument (name of the token)
      • @csrf('_mytag')
    • method csrfIsValid has a new argument (name of the token)
      • $blade->csrfIsValid(true,'_mytag');
  • 2020-02-15 3.35

    • Added a new argument optional for csrfIsValid()
  • 2020-01-17 3.34

    • It allows to calls a static method inside a class
    • See section Calling a static methods inside the template.
    • new field $aliasClasses
    • new method getAliasClasses()
    • new method setAliasClasses()
    • new method addAliasClasses()
    • new method compileUse()
    • new method compileStatementClass()
    • new method fixNamespaceClass()
  • 2019-12-21 3.33

    • For #99 Fixed missingTranslation(). Also some cleanups.
  • 2019-12-21 3.32

    • For #96 added $loop->even and $loop->odd and $loop->iteration
    • Also, $loop->index now starts with 0 instead of 1
  • 2019-08-09 3.31 The operations _e(), _n() and _ef() used for language are now integrated on BladeOne. So we don't need BladeOneLang anymore.

  • 2019-06-14 3.30 Here it goes again.Returned cause psr-2 (but it breaks phpstorm so I added exceptions)

  • 2019-06-08 3.29 More cleanup. tabs removed, some exceptions were changed, added imports (instead of /)

  • 2019-06-08 3.28 Added setter and getters and solved some issues

  • 2019-05-25 3.27 #78 Some comments are corrected. The views folder(s) could be an string or an array. It also allows to specific the route of the template literally. Now "folder.template" is equals to "folder/template.blade.php"

  • 2019-05-25 3.26 #75 added method @pushonce('namestack') and @endpuchonce

  • 2019-05-24 3.25 #77 added method setOptimize(bool) and setIsCompiled(bool)

  • 2019-05-05 3.24 #75

  • 2019-04-24 10k downloads 👏 👏 👏!

  • 2019-04-23 3.23 method share()

  • 2019-04-03 3.22 it solves #70. It also adds some small optimizations.

  • 2019-03-07 3.21 method "addInclude()" for aliasing include.

  • 2019-03-01 3.20 I checked Laravel's blade and there is nothing new. This version is aligned with Blade 5.8

  • I added some fixes to @json. Now it allows arguments (the same arguments than PHP's json_encode)

  • 2019-01-18 3.19 New changes on new pull from @AVONnadozie

  • 2018-12-16 3.18 Maintenance version. I checked and BladeOne already support the new features of 5.7 (@method and @csrf)

  • 2018-10-25 3.17 Halloween version. Now if the command doesn´t exist,for example @media @font-face and such, it doesn't show the error but returns the same text as verbatim.

  • 2018-10-25 3.16 Fixed an error with compile() when it's called with information.

    • Now compile() returns true or false
    • isExpected() has an optional argument.
    • getCompiledFile() and getTemplateFile() now uses the default template ($this->fileName) if the arg is empty (null or '')
    • arguments $fileName are now called $templateName because $filename is not a filename (temp/file.blade.php) but the name of the template (temp.file)
  • 2018-10-22 3.15 Fixed an error if _e() is called by an array or object.

  • 2018-10-09 3.14 Added @includefast

  • 2018-10-06 3.13 Added @relative, setBaseUrl(),getBaseUrl() and addAssetDict(). @asset is changed, now it allows dictionary. $baseUrl is not public anymore

  • 2018-09-29 3.12 Added the function setPath so we can change the path of the templates/compile files at runtime.

  • 2018-09-21 3.11 @includeif fixed.

  • 2018-09-21 3.10 Testing travis.

  • 2018-09-16 3.9 Added unit test (gamification) and travis 🚀

  • 2018-09-01 3.8 Sorry Blade class,but you must go. \eftec\bladeone\BladeOneBlade.php is no-more so the static call and the instance. (#47)[https://github.com/EFTEC/BladeOne/issues/47] it was the last straw.

  • 2018-08-29 3.7 phpdoc block reduced. "To do" comments deleted. Fixed issue (#44)[https://github.com/EFTEC/BladeOne/issues/44]

  • 2018-08-24 3.5 Some fixes.

  • 2018-08-16 3.4 Custom if,@php tag and some fixes with @switch

  • 2018-08-08 3.3 Set extensions, constants and blade mode.

  • 2018-08-05 3.2 Fixed composer's problem

  • 2018-07-27 3.1 custom directive and directivert(runtime).

  • 2018-07-12 3.0 BladeOneLogic now is fused with BladeOne. And a lot of new changes.

  • 2018-07-11 2.4 Some fixes, new tags @json(var),@isset($records),@endisset,@includewhen,@includefirst,@prepend,@endprepend,@empty,@endempty,@append

  • 2018-06-12 2.3.3 Reorder folders.

  • 2018-06-11 2.3.2 Fixed bladeonehtml to allows readonly value.

  • 2018-05-06 2.3.1 Fixed a problem with @verbatim. Add the method runString for evaluating a function

  • 2018-04-13 2.3 The end result clean spaces. PHPDoc cleaned (checked with PHPStorm 2018.1). Fixed some typos (sorry about that).

  • 2017-12-18 Added BladeOneLang

  • 2017-12-14 2.2 Added @asset

  • 2017-10-20 2.1 Fixed with @parent Fixed @item (BladeOneHtml). Now, it considers null and 0 as different. Fixed foreach bug when the name of the variable contains the letters 'as' for example @foreach($listAsFast as $v)

  • 2017-09-28 2.0 Some fixes there and here.

  • 2017-07-21 1.9 Components and Slots. Note: I'm not really convinced in its usability.

  • 2017-05-24 1.8 Maintenance. Now, it runs with or without mb_string module

  • 2017-04-09 1.8 Creates a directory automatically. Some fixes. Add new feature @splitforeach.

  • 2017-02-20 1.6 More cleanups. Refactored file, image, and other tags.

  • 2016-08-14 1.6 Some cleanups. Add new documentation

  • 2016-07-03 1.5 New features such as @set command

  • 2016-06-24 1.4 Updates extensions. Now it uses strut instead of classes. Added a new extension BladeOneCache.

  • 2016-06-12 1.3 Lots of clean up. I removed some unused parameters. I fixed a problem with forced in BladeOne. I separate the doc per extension.

  • 2016-06-10 1.2 New changes. Added namespaces (for autocomplete and compatibility with Composer)

  • 2016-06-09 1.1 Some fine tune.

  • 2016-06-09 1.0 Version. Most works. Added extensions and error control with a tag are not defined.

  • 2016-06-08 0.2. Beta First publish launch.