All Versions
39
Latest Version
Avg Release Cycle
57 days
Latest Release
76 days ago

Changelog History
Page 1

  • v1.0.0-alpha.1 Changes

    July 12, 2022

    ๐Ÿ”‹ Features

    • core Minimum PHP version required PHP 8.1.0.

    • core Core application updated from Slim 3 to Slim 4!

    See: Upgrade Guide

    • core New PHP-DI added instead of Pimple DI.

    See: Usage Guide

    • console Added Extendable Flextype CLI Application.

      Flextype CLI Application 1.0.0-alpha.1
      
      Usage:
        command [options] [arguments]
      
      Options:
        -h, --help            Display help for the given command. When no command is given display help for the list command
        -q, --quiet           Do not output any message
        -V, --version         Display this application version
            --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
        -n, --no-interaction  Do not ask any interactive question
        -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
      
      Available commands:
        about                       Get information about Flextype.
        completion                  Dump the shell completion script
        help                        Display help for a command
        list                        List commands
      cache
        cache:clear                 Clear cache.
        cache:clear-config          Clear cache config.
        cache:clear-data            Clear cache data.
        cache:clear-routes          Clear cache routes.
        cache:delete                Delete item.
        cache:delete-multiple       Delete mutiple items.
        cache:get                   Get item.
        cache:get-multiple          Get multiple items.
        cache:has                   Check whether cache item exists.
        cache:set                   Set item.
        cache:set-multiple          Set multiple items.
      entries
        entries:copy                Copy entry.
        entries:create              Create entry.
        entries:delete              Delete entry.
        entries:fetch               Fetch entry.
        entries:has                 Check whether entry exists.
        entries:move                Move entry.
        entries:update              Update entry.
      tokens
        tokens:create               Create a new unique token.
        tokens:delete               Delete token entry.
        tokens:fetch                Fetch token entry.
        tokens:generate             Generate token.
        tokens:generate-hash        Generate token hash.
        tokens:has                  Check whether token entry exists.
        tokens:update               Update tokens entry.
        tokens:verify-hash          Verify token hash.
      
    • core Added Thermage library for better Flextype CLI Application styling.

    • core Added ability to execute specific project related code.

      • before-plugins to bootstrap file before plugins intialization.
      • after-plugins to bootstrap file after plugins intialization.
    • core Added new core constants: FLEXTYPE_PROJECT_NAME, FLEXTYPE_PATH_PROJECT, FLEXTYPE_PATH_TMP, FLEXTYPE_START_TIME.

    • core Added ability to run Flextype in silent mode by disabling app and cli.

    • core Added New Glowy PHP Packages View, Macroable, Strings, Arrays, Csrf, Filesystem, Registry, Session.

    • core Added built-in I18n module.

    • core Added ability to override default constants

    • entries Added new functionality that allows implementing Virtual Entries by overriding default entries CRUD methods with the help of events.

    • entries Added ability to create completely customisable high-level collections for entries with their fields and various formats.

    • entries Added ability to set custom events for each entries collections.

    • entries Added ability to create and use entries fields directives.

    See: Documentation

    • entries Added ability to create custom entries macros.

    Built-in macros: entries, php, registry.

    • entries Added new method registry to get entries registry.

    • entries Added new method options to get entries options.

    • entries Added new method setOptions to set entries options.

    • entries Added new method setRegistry to set entries registry.

    • entries Added ability to override logic for built-in custom fields.

      Example: If you want to have your custom logic for processing field uuid just update flextype project settings.

      from:

      ...
      entries:
        default:
          ...
          fields:
            ...
            uuid:
              enabled: true
              path: "src/flextype/core/Entries/Fields/Default/UuidField.php"
            ...
          ...
        ...
      ...
      

      to:

      ...
      entries:
        default:
          ...
          fields:
            ...
            uuid:
              enabled: true
              path: "project/plugins/your-custom-plugin/Entries/Fields/Default/UuidField.php"
            ...
          ...
        ...
      ...
      
    • directives Added new directive @type to set field type.

    • directives Added new directive @markdown to parse markdown text inside current field.

    • directives Added new directive @shortcodes to parse shortcodes text inside current field.

    • directives Added new directive @textile to parse textile text inside current field.

    • directives Added new directive @php to execute php code text inside current field.

    • directives Added new directive [[ ]] to eval expression.

    • endpoints All Rest API Endpoints codebase was rewritten from scratch.

    • endpoints Added new Rest API Endpoint POST /api/v1/cache/clear to clear cache.

    • endpoints Added new Rest API Endpoint POST /api/v1/tokens/generate to generate token hash.

    • endpoints Added new Rest API Endpoint POST /api/v1/tokens/verify-hash to verify token hash.

    • endpoints Added new Rest API Endpoint POST /api/v1/tokens to create token entry.

    • endpoints Added new Rest API Endpoint PATCH /api/v1/tokens to update token entry.

    • endpoints Added new Rest API Endpoint DELETE /api/v1/tokens to delete token entry.

    • endpoints Added new Rest API Endpoint GET /api/v1/tokens to fetch token entry.

    • csrf Added Glowy CSRF protection for Cross Site Request Forgery protection by comparing provided token with session token to ensure request validity.

    • frontmatter Added ability to define custom frontmatter header parsers for entries. Example: instead of first --- you may set serializer ---json, ---json5 ---yaml or ---neon.

    • serializers Added new serializer Json5.

    See: Documentation

    • serializers Added new serializer Neon.

    See: Documentation

    • serializers Added ability to set global settings for all built-in serializers.

      src/flextype/settings.yaml

      serializers:
        json: 
          decode:
            cache: 
              enabled: true
              string: ""
            assoc: true
            depth: 512
            flags: 0
          encode: 
            options: 0
            depth: 512
        json5: 
          decode:
            cache: 
              enabled: true
              string: ""
            assoc: true
            depth: 512
            flags: 0
          encode: 
            options: 0
            depth: 512
        yaml:
          decode:
            cache: 
              enabled: true
              string: ""
            native: true
            flags: 0
          encode:    
            inline: 10
            indent: 2
            flags: 0
        frontmatter:
          decode:
            cache: 
              enabled: true
              string: ""
            cache_id_string: ""
            header:
              serializer: yaml
              allowed: ['yaml', 'json', 'json5', 'neon']
          encode:    
            header:
              serializer: yaml
              allowed: ['yaml', 'json', 'json5', 'neon']
        neon:
          decode:
            cache: 
              enabled: true
              string: ""
          encode:
            blockMode: false
            indentation: "\t"
        phparray:
          decode:
            cache: 
              enabled: true
              string: ""
          encode:
            wrap: true
      
    • serializers Added ability to set specific header serializer for Frontmatter serializer (default is YAML).

      src/flextype/settings.yaml

      frontmatter:
        decode:
          cache: 
            enabled: true
            string: ""
          cache_id_string: ""
          header:
            serializer: yaml
            allowed: ['yaml', 'json', 'json5', 'neon']
        encode:    
          header:
            serializer: yaml
            allowed: ['yaml', 'json', 'json5', 'neon']
      
    • ๐Ÿ“œ parsers Markdown parser Commonmark updated to v2

    • ๐Ÿ“œ parsers Added new Textile parser.

    • ๐Ÿ“œ parsers Added ability to set global settings for all parsers.

      src/flextype/settings.yaml

      parsers:
        markdown:
          cache: 
            enabled: true
            string: ""
          commonmark:
            renderer:
              block_separator: "\n"
              inner_separator: "\n"
              soft_break: "\n"
            commonmark:
              enable_em: true
              enable_strong: true
              use_asterisk: true
              use_underscore: true
              unordered_list_markers: ['-', '*', '+']
            html_input: 'allow'
            allow_unsafe_links: false
            max_nesting_level: 9223372036854775807
            slug_normalizer:
              max_length: 255
        textile:
          cache: 
            enabled: true
            string: ""
          restricted: false
          document_type: 'xhtml'
          document_root_directory: ''
          lite: false
          images: true
          link_relation_ship: ''
          raw_blocks: false
          block_tags: true
          line_wrap: true
          image_prefix: ''
          link_prefix: ''
          symbol: []
          dimensionless_images: true
        shortcodes:
          cache: 
            enabled: true
            string: ""
          cache_id_string: ""
          opening_tag: "("
          closing_tag: ")"
          closing_tag_marker: "/"
          parameter_value_separator: ":"
          parameter_value_delimiter: "'"
          shortcodes:
            entries:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php"
              fetch:
                enabled: true
            php:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/PhpShortcode.php"
            raw:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/RawShortcode.php"
            textile:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/TextileShortcode.php"
            markdown:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php"
            registry:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php"
              get:
                enabled: true
            url:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/UrlShortcode.php"
            strings:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/StringsShortcode.php"
            filesystem:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php"
              get:
                enabled: true
            i18n:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/I18nShortcode.php"
            if:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/IfShortcode.php"
            when:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/WhenShortcode.php"
            unless:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php"
            uuid:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/UuidShortcode.php"
            const:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/ConstShortcode.php"
            var:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/VarShortcode.php"
            field:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/FieldShortcode.php"  
            calc:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/CalcShortcode.php"  
            eval:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/EvalShortcode.php" 
            type:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/TypeShortcode.php" 
      
    • ๐Ÿ“œ parsers Added ability to override logic for built-in shortcodes.

      Example: If you want to have your custom logic for processing shortcode url just update flextype settings.

      from:

      ...
      parsers:
        shortcodes:
          shortcodes:
            ...
            url:
              enabled: true
              path: "src/flextype/core/Parsers/Shortcodes/UrlShortcode.php"
            ...
          ...
        ...
      ...
      

      to:

      ...
      parsers:
        shortcodes:
          shortcodes:
            ...
            url:
              enabled: true
              path: "project/plugins/your-custom-plugin/Parsers/Shortcodes/UrlShortcode.php"
            ...
          ...
        ...
      ...
      
    • routes Added ability to set custom projects routes in /projects/routes/routes.php.

    • shortcodes Added new shortcode (entries) to fetch entry (or entries collection) or specific field.

    • shortcodes Added new shortcode (registry) to fetch data from registry.

    • shortcodes Added new shortcode (filesystem) to work with filesystem.

    • shortcodes Added new shortcode (uuid) to generate uuid.

    • shortcodes Added new shortcode (strings) for strings manipulation.

    • shortcodes Added new shortcode (textile) to parse textile text.

    • shortcodes Added new shortcode (php) to execute php code.

    • shortcodes Added new shortcode (eval) to eval expression.

    • shortcodes Added new shortcode (calc) to calculate values.

    • shortcodes Added new shortcode (type) to set field type.

    • shortcodes Added new shortcode (markdown) to parse markdown text.

    • shortcodes Added new shortcode (getProjectUrl) to get project url.

    • shortcodes Added new shortcode (getBaseUrl) to get base url.

    • shortcodes Added new shortcode (getBasePath) to get base path.

    • shortcodes Added new shortcode (getAbsoluteUrl) to get absolute url.

    • shortcodes Added new shortcode (url) to get url.

    • shortcodes Added new shortcode (urlFor) to get url for route.

    • shortcodes Added new shortcode (getUriString) to get uri string.

    • shortcodes Added new shortcode (filesystem) to do filesytem manipulations.

    • shortcodes Added new shortcode (date) to get date.

    • shortcodes Added new shortcode (tr) to returns translation of a string.

    • shortcodes Added new shortcode (if) to use logical if conditions.

    • shortcodes Added new shortcode (when) to use logical positive if conditions.

    • shortcodes Added new shortcode (unless) to use logical negative if conditions.

    • shortcodes Added new shortcode (var) to get and set entry variables values.

    • shortcodes Added new shortcode (field) to get entry fields values.

    • shortcodes Added new shortcode (const) to get defined costants.

    • shortcodes Added new shortcode (raw) to ignore shortcodes processing.

    • expressions Added a new configurable and extendable expressions engine with a collection of predefined expressions.

    • expressions Added new expression function actions to get actions service.

    • expressions Added new expression function collection to create a new arrayable collection object from the given elements.

    • expressions Added new expression function collectionFromJson to create a new arrayable collection object from the given JSON string.

    • expressions Added new expression function collectionFromString to create a new arrayable collection object from the given string.

    • expressions Added new expression function collectionWithRange to create a new arrayable object with a range of elements.

    • expressions Added new expression function collectionFromQueryString to create a new arrayable object from the given query string.

    • expressions Added new expression function filterCollection to filter collection.

    • expressions Added new expression function const to get defined constants.

    • expressions Added new expression function var to get current entry var.

    • expressions Added new expression function field to get current entry field.

    • expressions Added new expression function csrf to get csrf hidden input.

    • expressions Added new expression function entries to get entries service.

    • expressions Added new expression function filesystem to get filesystem instance.

    • expressions Added new expression function strings to get strings instance.

    • expressions Added new expression function tr to return translation of a string. If no translation exists, the original string will be returned.

    • expressions Added new expression function __ to return translation of a string. If no translation exists, the original string will be returned.

    • expressions Added new expression function max to return the highest value in an array, or the highest value of several specified values.

    • expressions Added new expression function min to return the lowest value in an array, or the lowest value of several specified values.

    • expressions Added new expression function ceil to round a number up to the nearest integer.

    • expressions Added new expression function floor to round a number down to the nearest integer.

    • expressions Added new expression function parsers to get parsers service.

    • expressions Added new expression function serializers to get serializers service.

    • expressions Added new expression function registry to get registry service.

    • expressions Added new expression function slugify to get slugify service.

    • expressions Added new expression function date to get date.

    • expressions Added new expression function url to get the url.

    • expressions Added new expression function urlFor to get the url for a named route.

    • expressions Added new expression function fullUrlFor to get the full url for a named route.

    • expressions Added new expression function isCurrentUrl to determine is current url equal to route name.

    • expressions Added new expression function getCurrentUrl to get current path on given Uri.

    • expressions Added new expression function getBasePath to get the base path.

    • expressions Added new expression function getBaseUrl to get the base url.

    • expressions Added new expression function getAbsoluteUrl to get the absolute url.

    • expressions Added new expression function getProjectUrl to get the project url.

    • expressions Added new expression function getUriString to get the uri string.

    • expressions Added new expression function redirect to create redirect.

    • cache Added new cache driver Phparray to store cache data in raw php arrays files.

    • cache Added router cache.

    • cache Added ability to set custom cache ID string for entries, parsers and serializers.

    • tokens Added new Tokens API.

    • helpers All core helpers are located in the src/flextype/helpers/.

    • helpers Added helper function app to get Flextype Application instance.

    • helpers Added helper function container to get Flextype Application Container instance.

    • helpers Added helper function emitter to get Flextype Emitter Service.

    • helpers Added helper function cache to get Flextype Cache Service.

    • helpers Added helper function entries to get Flextype Entries Service.

    • helpers Added helper function parsers to get Flextype Parsers Service.

    • helpers Added helper function serializers to get Flextype Serializers Service.

    • helpers Added helper function logger to get Flextype Logger Service.

    • helpers Added helper function session to get Flextype Session Service.

    • helpers Added helper function csrf to get Flextype CSRF Service.

    • helpers Added helper function plugins to get Flextype Plugins Service.

    • helpers Added helper function console to get Flextype Console Service.

    • helpers Added helper function imageFile to create a new image instance for image file.

    • helpers Added helper function imageCanvas to create a new image canvas instance.

    • helpers Added helper function generateToken to generate unique token.

    • helpers Added helper function generateTokenHash to generate unique token hash.

    • helpers Added helper function verifyTokenHash to validate token hash.

    • helpers Added helper function url to get url.

    • helpers Added helper function urlFor to get url for a named route.

    • helpers Added helper function fullUrlFor to get full url for a named route.

    • helpers Added helper function isCurrentUrl to determine is current url equal to route name.

    • helpers Added helper function getCurrentUrl to get current path on given Uri.

    • helpers Added helper function getBasePath to get base path.

    • helpers Added helper function setBasePath to set base path.

    • helpers Added helper function redirect to create redirect.

    • helpers Added helper function upload to upload files and process uloaded images.

    • uploder Added Configurable Sirius Uploader for file upload.

      # Upload
      upload:
      
        # Uploads directory
        directory: '/uploads'
      
        # Overwrite existing files.
        overwrite: true
      
        # Auto-confirm uploads.
        autoconfirm: false
      
        # Prefixing uploads.
        prefix: ''
      
        # Validation options
        validation:
      
          # Allowed file extensions.
          allowed_file_extensions: ['gif', 'jpg', 'jpeg', 'png', 'ico', 'webm', 'svg']
      
          # Maximum file size.
          max_file_size: '24M'
      
          # Image validation options
          image:
      
            # Image maxiumum and minimum width
            width:
              max: 4920
              min: 100
      
            # Image maxiumum and minimum height
            height: 
              max: 3264
              min: 100
      
            # Image ratio
            #ratio:
            #  The option can be a number (eg: 1.3) or a ratio-like string (eg: 4:3, 16:9).
            #  size: 1.3
      
            #  The option error_margin specifies how much the image is allowed to 
            #  deviate from the target ratio. Default value is 0.
            #  error_margin: 0
      
        # Process uploaded files
        process:
      
          # Images process settings
          image:
      
            # Image quality
            quality: 70
      
    • macros All core macros are located in the src/flextype/macros/.

    • macros Added onlyFromCollection and exceptFromCollection macros for Arrays (#553)

    • actions Added new Actions API (#549)

      Usage

      Example 1
      // Set new action entries.create
      actions()->set('entries.create', function($id, $data) {
        return entries()->create($id, $data);
      });
      
      // Get action entries.create
      actions()->get('entries.create')('hello-world', []);
      
      Example 2
      // Set new action entries.update
      actions()->set('entries.update', function($id, $data) {
        if (entries()->update($id, $data)) {
          logger()->info("Content {$id} successfully updated");
          cache()->delete($id);
        } else {
          logger()->error("Content {$id} was not updated");
        }
      });
      
      // Get action entries.update
      actions()->get('entries.update')('hello-world', []);
      
      Example 3
      // Set new action entries.create
      actions()->set('entries.create', function($id, $data) {
        if(registry()->get('database') == 'MySQL') {
          // ... create new entry in the MySQL database.
        } else {
          return entries()->create($id, $data);
        }
      });
      
      // Get action entries.create
      actions()->get('entries.create')('blog/post-1', []);
      actions()->get('entries.create')('blog/post-2', []);
      actions()->get('entries.create')('blog/post-3', []);
      

      The Flextype Actions API provides new capabilities to extend the Flextype core by registering and reusing useful code snippets from global actions namespace.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ“œ parsers Fixed issue with double cashing.

    • htaccess Security fixes for .htaccess

    • entries Fixed issue when entries collection fetch returns empty result.

    • ๐Ÿ”Œ plugins Fixed Plugins API translation loading process.

    • ๐Ÿ”Œ plugins Fixed Plugins API initialization (#551)

    • ๐Ÿ”Œ plugins Fixed Plugins API dependency initialization.

    • ๐Ÿ”Œ plugins Fixed Plugins API issue with non valid plugins (#551)

    • ๐Ÿ”Œ plugins Fixed Plugins API loader issue with disabled plugins.

    ๐Ÿ’ฅ BREAKING CHANGES

    • media Media and Glide functionality removed from the flextype core due to security and perfomance reasons. Recomended to use imagekit or imgix instead.

    • core Use new constant FLEXTYPE_PATH_PROJECT instead of PATH['project'] and FLEXTYPE_PATH_TMP instead of PATH['tmp'].

    • shortcodes New default shortcodes syntax and signatures changes for all shortocodes.

      opening_tag: "("
      closing_tag: ")"
      closing_tag_marker: "/"
      parameter_value_separator: ":"
      parameter_value_delimiter: '"'
      
    • helpers Use new helpers functions to access Flextype Services.

      • use entries() instead of flextype('entries')
      • use session() instead of flextype('session')
      • use cache() instead of flextype('cache')
      • use app() instead of flextype()
      • use container() instead of flextype('container_name_here')
      • use parsers() instead of flextype('parsers')
      • use serializers() instead of flextype('serializers')
      • use plugins() instead of flextype('plugins')
      • use emitter() instead of flextype('emitter')
      • use logger() instead of flextype('logger')
      • use registry() instead of flextype('registry')
    • helpers Use helper function app to access Flextype Application instance instead of old helper function flextype().

    • helpers Use helper function container to access Flextype Application container instead of old helper function flextype() with container name argument.

      • use container()->get('entries') instead of flextype('entries')
      • use container()->set('entries', new Entries()) instead of flextype()['entries'] = new Entries()
    • helpers Use helper function filterCollection instead of old filter.

    • tokens Project tokens moved from project/tokens to project/entries/tokens.

    • entries Changes for etnries memory storage.

      • use entries()->registry()->get() instead of flextype('entries')->storage()->get()
      • use entries()->registry()->set() instead of flextype('entries')->storage()->set()
      • use entries()->registry()->has() instead of flextype('entries')->storage()->has()
      • use entries()->registry()->delete() instead of flextype('entries')->storage()->delete()

    note: all method from Glowy PHP Arrays are available for Arrays Storage Object manipulations docs: https://github.com/glowyphp/arrays

    ๐Ÿ”จ Refactoring

    • core General code refactoring and improvements.

    • โœ… tests All unit tests were rewritten.

  • v0.9.16 Changes

    January 14, 2021

    ๐Ÿ”‹ Features

    • ๐Ÿ“œ parsers: Added commonmark instead of parsedown (#540)
    • shortcodes: Added new shortcode - media_files_fetch

      example:

      [media_files_fetch id="entries/home/foo.txt" field="title" default="Bar"]
      

    ๐Ÿ› Bug Fixes

    • bootstrap: Fixed include path for dependencies.

    ๐Ÿ”จ Refactoring

    • core: general code refactoring and improvements.
  • v0.9.15 Changes

    January 03, 2021

    ๐Ÿ”‹ Features

    • media: Added method has() for Media Folders (#534)
    • entries: simplify functionality to work with online entries storage. (#536)
    • ๐Ÿ“œ parsers: move markdown and shortcode settings under parsers setting. (#539)

    ๐Ÿ› Bug Fixes

    • entries: Fixed issue with individual entries cache field (#537)
    • ๐Ÿ”Œ plugins: Fixed issue with empty manifest and settings yaml files (#538)

    ๐Ÿ’ฅ BREAKING CHANGES

    • entries: according to this ticket (#536) we have several changes for entries storage.

      • use flextype('entries')->storage()->get() instead of flextype('entries')->getStorage()
      • use flextype('entries')->storage()->set() instead of flextype('entries')->setStorage()
      • use flextype('entries')->storage()->has() instead of flextype('entries')->hasStorage()
      • use flextype('entries')->storage()->delete() instead of flextype('entries')->deleteStorage()

      note: all method from Atomastic Arrays are available for Arrays Storage Object manipulations docs: https://github.com/atomastic/arrays

  • v0.9.14 Changes

    December 30, 2020

    ๐Ÿ”‹ Features

    • core: Moving to PHP 7.4.0 (#524)

    • ๐Ÿ”Œ plugins: Set default plugin priority 100 and SORT them ascending (#523)

    ๐Ÿ› Bug Fixes

    • core: Fixed issue with Rest API endpoints detection. (#522)

    • entries: Fixed issue with empty variable $data in fetch() method. (#531)

    • entries: Fixed issue with deleteStorage() method return data.

    ๐Ÿ”จ Refactoring

    • core: general code refactoring and improvements.
  • v0.9.13 Changes

    December 20, 2020

    ๐Ÿ”‹ Features

    • media-files: we will use fetch() method as entry point to execute different methods with fetch prefix. (#508)

      /**
       * Fetch.
       *
       * @param string $id      The path to file.
       * @param array  $options Options array.
       *
       * @access public
       *
       * @return self Returns instance of The Arrays class.
       */
      public function fetch(string $id, array $options = []): Arrays
      

      Media Files API is macroable and we will able to Added any custom fetch methods for receiving data from different sources.

      flextype('media')->files()::macro('fetchFromOtherStorage', function(string $id, array $options) {
        // fetch data from Other Storage using $id and $options
      });
      
      $data = flextype('media')->files()-> fetchFromOtherStorage($id, $options);
      
    • media-folders: we will use fetch() method as entry point to execute different methods with fetch prefix. (#509)

      /**
       * Fetch.
       *
       * @param string $id      The path to folder.
       * @param array  $options Options array.
       *
       * @access public
       *
       * @return self Returns instance of The Arrays class.
       */
      public function fetch(string $id, array $options = []): Arrays
      

      Media Folders API is macroable and we will able to Added any custom fetch methods for receiving data from different sources.

      flextype('media')->folders()::macro('fetchFromOtherStorage', function(string $id, array $options) {
        // fetch data from Other Storage using $id and $options
      });
      
      $data = flextype('media')->folders()-> fetchFromOtherStorage($id, $options);
      
    • entries: we will use fetch() method as entry point to execute different methods with fetch prefix. (#495)

      /**
      * Fetch.
      *
      * @param string $id      Unique identifier of the entry.
      * @param array  $options Options array.
      *
      * @access public
      *
      * @return mixed
      */
      public function fetch(string $id, array $options = []): Arrays
      

      Entries API is macroable and we will able to Added any custom fetch methods for receiving data from different sources.

      flextype('entries')::macro('fetchXML', function(string $id, array $options) {
      // fetch data from XML using $id and $options
      });
      
      $data = flextype('entries')->fetchXML($id, $options);
      
    • images we will use media/ folder instead of uploads/entries/ (#516)

    • serializers: standardise serializers container names with macroable ability. (#518)

      New methods to access Serializers:

      flextype('serializers')->yaml()
      flextype('serializers')->json()
      flextype('serializers')->frontmatter()
      

      Adding macros:

      flextype('serializers')::macro('NAME', CALLBACK_FUNCTION() {});
      
    • ๐Ÿ“œ parsers: standardise parsers container names with macroable ability. (#519)

      New methods to access Parsers:

      flextype('parsers')->shortcode()
      flextype('parsers')->markdown()
      

      Adding macros:

      flextype('parsers')::macro('NAME', CALLBACK_FUNCTION() {});
      
    • media: standardise media container names with macroable ability for Media API. (#517)

      New macroable common class for all media - class Media

      New methods to access Media API:

      flextype('media')->files()
      flextype('media')->files()->meta()
      flextype('media')->folders()
      flextype('media')->folders()->meta()
      

      Adding macros:

      flextype('media')::macro('NAME', CALLBACK_FUNCTION() {});
      flextype('media')->files()::macro('NAME', CALLBACK_FUNCTION() {});
      flextype('media')->files()->meta()::macro('NAME', CALLBACK_FUNCTION() {});
      flextype('media')->folders()::macro('NAME', CALLBACK_FUNCTION() {});
      flextype('media')->folders()->meta()::macro('NAME', CALLBACK_FUNCTION() {});
      
    • fields Added new field registry.get for Registry API (#494)

      Registry API provides method get() for retrieving data from registry and we should able to access them inside entries frontmatter header for retrieving data right in the entries.

      Basic Example

      Sample entry with several queries and with several nested queries inside of children entries.

      File: /project/entries/registry-root/entry.md

      ---
      title: Root
      registry:
        get:
          flextype:
            key: flextype.manifest.name
          author.name:
            key: flextype.manifest.author.name
          license:
            key: flextype.manifest.license
      entries:
        fetch:
          level1:
            id: registry-root/level-1
      ---
      

      Setting for this fields

      File: /project/config/flextype/settings.yaml

      entries:
        fields:
          registry:
            get:
              enabled: true
      

      Valid values for setting enabled is true or false

    • fields Added new field entries.fetch for Entries API (#492)

      Entries API provides methods for entries fetch: fetch() and we should able to access them inside entries frontmatter header for fetching data right in the entries. Also, we will able to Added and use any kind of fetch methods with our macroable functionality.

      Basic Example

      Catalog entry with several queries and with several nested queries inside of children entries.

      File: /project/entries/catalog/entry.md

      ---
      title: Catalog
      visibility: visible
      entries:
        fetch:
          label1:
            id: discounts/50-off
            options:
              filter:
                limit: 4
          bikes:
            id: catalog/bikes
            options:
              collection: true
              filter:
                where:
                  -
                    key: brand
                    operator: eq
                    value: gt
                limit: 10
          discounts:
            id: discounts
            options:
              collection: true
              filter:
                where:
                  -
                    key: title
                    operator: eq
                    value: '30% off'
                  -
                    key: category
                    operator: eq
                    value: bikes
      ---
      

      Setting for this fields

      File: /project/config/flextype/settings.yaml

      entries:
        fields:
          entries:
            fetch:
              enabled: true
              result: toObject
      

      Valid values for setting enabled is true or false
      Valid values for setting result is toObject or toArray

    • fields Added new field media.files.fetch and media.folders.fetch for Media API's (#501) (#500)

      Media API's provides methods for files and folders fetch: fetch() and we should able to access them inside entries frontmatter header for fetching data right in the entries. Also, we will able to Added and use any kind of fetch methods with our macroable functionality.

      ---
      title: Media
      media:
        folders:
          fetch:
            macroable_folder:
              id: 'foo'
              options:
                method: fetchExtraData
            foo_folder:
              id: 'foo'
            collection_of_folders:
              id: '/'
              options:
                collection: true
        files:
          fetch:
            macroable_file:
              id: 'foo'
              options:
                method: fetchExtraData
            foo_file:
              id: foo.txt
            collection_of_files:
              id: '/'
              options:
                collection: true
      ---
      

      Setting for this fields

      File: /project/config/flextype/settings.yaml

      entries:
        fields:
          media:
            files:
              fetch:
                enabled: true
                result: toObject
            folders:
              fetch:
                enabled: true
                result: toObject
      

      Valid values for setting enabled is true or false
      Valid values for setting result is toObject or toArray

    • entries: Added new method deleteStorage() for Entries API (#498)

    • entries: Added new method hasStorage() for Entries API (#497)

    • core: Added new method isApiRequest to Determine API Request in the basic core functionality. (#507)

    • rest-api-entries Added ability to send options for fetch() methods in Entries Rest API. (#504)

      Fetch single

      GET /api/entries?id=YOUR_ENTRY_ID&token=YOUR_ENTRIES_TOKEN
      

      Fetch single with options

      GET /api/entries?id=YOUR_ENTRY_ID&options=[filter]&token=YOUR_ENTRIES_TOKEN
      

      Fetch collection

      GET /api/entries?id=YOUR_ENTRY_ID&options[collection]=true&token=YOUR_ENTRIES_TOKEN
      

      Fetch collection with options

      GET /api/entries?id=YOUR_ENTRY_ID&options[collection]=true&options=[find]&[filter]&token=YOUR_ENTRIES_TOKEN
      
    • rest-api-entries Added ability to call macroable fetch methods. (#505)

      With help of query option ?options[method]= we should able to call any macroable fetch methods.

      Example

      Macroable method XML

      flextype('entries')::macro('fetchXml', function(string $id, array $options) {
        return ['XML DATA HERE'];
      });
      

      HTTP GET:

      GET /api/entries?id=YOUR_ID&options[method]=fetchXml&token=YOUR_ENTRIES_TOKEN
      
    • rest-api-media reorganize endpoints for Media Rest API (#514)

    • rest-api-media Added ability to call macroable fetch methods for Folder. (#512)

      With help of query option ?options[method]= we should able to call any macroable fetch methods.

      Example

      Macroable method

      flextype('media')->folders()::macro('fetchFromOtherStorage', function(string $id, array $options) {
        // fetch data from Other Storage using $id and $options
      });
      

      HTTP GET:

      GET /api/folders?id=YOUR_MEDIA_FILES_ID&options[method]= fetchFromOtherStorage&token=YOUR_MEDIA_FOLDERS_TOKEN
      
    • rest-api-media Added ability to call macroable fetch methods for Files. (#513)

      With help of query option ?option[method]= we should able to call any macroable fetch methods.

      Example

      Macroable method

      flextype('media')->files()::macro('fetchFromOtherStorage', function(string $id, array $options) {
        // fetch data from Other Storage using $id and $options
      });
      

      HTTP GET:

      GET /api/files?id=YOUR_MEDIA_FILES_ID&option[method]=fetchFromOtherStorage&token=YOUR_MEDIA_FILES_TOKEN
      

    ๐Ÿ› Bug Fixes

    • fields Fixed issue with slug field in Entries API (#520)

    • core: Fixed issue with invalid timezone setting (#490)

    • entries: Fixed issue with not exists entries collections. (#503)

    • entries: Fixed issue with collisions in Entries API $storage for entries fetching. (#496)

    • rest-api-entries Fixed issue with 404 status code in Entries Rest API (#502)

    • rest-api: Fixed issue with Rest API endpoints initialisation. (#506)

    ๐Ÿ’ฅ BREAKING CHANGES

    • media: standardise media container names with macroable ability for Media API. (#517)

      NEW CONTAINER OLD CONTAINER
      media media_files, media_files_meta, media_folders, media_folders_meta
    • ๐Ÿ“œ parsers: standardise parsers container names with macroable ability. (#519)

      NEW CONTAINER OLD CONTAINER
      parsers shortcode, markdown
    • serializers: standardise serializers container names with macroable ability. (#518)

      NEW CONTAINER OLD CONTAINER
      serializers yaml, json, frontmatter
    • rest-api-media reorganize endpoints for Media Rest API (#514)

      NEW ENDPOINT OLD ENDPOINT
      GET /api/media/files /api/files
      POST /api/media/files /api/files
      PUT /api/media/files /api/files
      PATCH /api/media/files /api/files
      DELETE /api/media/files /api/files
      POST /api/media/files/copy /api/files/copy
      PATCH /api/media/files/meta /api/files/meta
      POST /api/media/files/meta /api/files/meta
      DELETE /api/media/files/meta /api/files/meta
      GET /api/media/folders /api/folders
      POST /api/media/folders /api/folders
      PATCH /api/media/folders /api/folders
      DELETE /api/media/folders /api/folders
      POST /api/media/folders/copy /api/folders/copy

      Tokens:

      • token for files should be moved from /tokens/files/ to /tokens/media/files/
      • token for folders should be moved from /tokens/folders/ to /tokens/media/folders/

      Settings:

      api:
        ...
        media:
          files:
            enabled: true
            default_token:
          folders:
            enabled: true
            default_token:
      
    • helpers filter helper return array result every time and not int or bool. (#493)

    • helpers filter helper not support slice_offset and slice_limit because they are are duplicates already exists functionality offset and limit. (#493)

    • helpers filter helper not support count and exists. (#493)

    • entries: we have changes in the events names for Entries API (#499)

      Events:

      onEntriesFetch
      onEntriesFetchSingle instead of onEntryInitialized
      onEntriesFetchSingleCacheHasResult instead of onEntryAfterCacheInitialized
      onEntriesFetchSingleNoResult
      onEntriesFetchSingleHasResult instead of onEntryAfterInitialized
      onEntriesFetchCollection instead of onEntriesInitialized
      onEntriesFetchCollectionHasResult instead of onEntriesAfterInitialized
      onEntriesFetchCollectionNoResult
      onEntriesMove instead of onEntryMove
      onEntriesUpdate instead of onEntryUpdate
      onEntriesCreate instead of onEntryCreate
      onEntriesDelete instead of onEntryDelete
      onEntriesCopy instead of onEntryCopy
      onEntriesHas instead of onEntryHas

    • entries: Flextype EMS structure is changes because of issues with collisions (#496)

      Updated structure:

      $storage = [
          'fetch' => [
            'id' => '',
            'data' => [],
            'options' => [
                'find' => [],
                'filter' => [],
            ],
          ],
          'create' => [
            'id' => '',
            'data' => [],
          ],
          'Updated' => [
            'id' => '',
            'data' => [],
          ],
          'delete' => [
            'id' => '',
          ],
          'copy' => [
            'id' => '',
            'newID' => '',
          ],
          'move' => [
            'id' => '',
            'newID' => '',
          ],
          'has' => [
            'id' => '',
          ],
      ];
      
    • rest-api-entries Entries Rest API - for collection fetch we should define this in the request query &options[collection]=true

    • rest-api-entries Entries Rest API - instead of &filter=[] we should define filtering in the request query like this &options[find] and &options[filter]

    • rest-api-media-files Media Files Rest API - for collection fetch we should define this in the request query &options[collection]=true

    • rest-api-media-folders Media Folders Rest API - instead of &filter=[] we should define filtering in the request query like this &options[find] and &options[filter]

    • images we will use media/ folder instead of uploads/entries/ (#516)

      • folder uploads/entries/ should should be renamed to media/entries/ related to this ticket: #515
      • in the endpoint /api/images/{path:.+} path for entries, should starts with /entries/.

      Example:

      old: /api/images/home/banner.jpg new: /api/images/entries/home/banner.jpg

    • entries: we should use only fetch() method as entry point to execute different methods with fetch prefix. (#495)

      • method fetchSingle() removed. Use fetch($id, $options) method.
      • methods fetchCollection removed. Use fetch($id, ['collection' => true]) method.
    • media-folders: we should use only fetch() method as entry point to execute different methods with fetch prefix. (#509)

      • method fetchSingle() removed. Use fetch($id, $options) method.
      • methods fetchCollection removed. Use fetch($id, ['collection' => true]) method.
    • media-files: we should use only fetch() method as entry point to execute different methods with fetch prefix. (#508)

      • method fetchSingle() removed. Use fetch($id, $options) method.
      • methods fetchCollection removed. Use fetch($id, ['collection' => true]) method.
  • v0.9.12 Changes

    December 07, 2020

    ๐Ÿ”‹ Features

    • core: Added Atomastic Components instead of Flextype Components (#478)

      Added:

      • atomastic/session
      • atomastic/arrays
      • atomastic/filesystem
      • atomastic/registry
      • atomastic/strings
    • entries: Entries API return Arrays Object instead of plain array on fetch. (#485)

      From no we have ability to work with entries singles and collections as with smart objects for further data manipulations with help of Atomastic Arrays Component.

      Example:

      // Fetch random 10 posts created by Awilum and sort them by published_at field.
      $posts = flextype('entries')
                 ->fetchCollection('blog')
                 ->where('author.name', 'eq', 'Awilum')
                 ->sortBy('published_at')
                 ->limit(10)
                 ->random();
      
    • entries: Standardize Entries API fetch. (#486)

    • entries: Standardize Media Files API fetch. (#487)

    • entries: Standardize Media Folders API fetch. (#488)

    • entries: Added ability to extend Core class with Macros. (#489)

    • cache: Added new cache engine - PHPFastCache instead of Doctrine Cache (#457)

      New config for PhpFastCache

      https://github.com/flextype/flextype/blob/dev/src/flextype/settings.yaml#L127-L241

      New methods from PhpFastCache

      We are start using PhpFastCache PSR16 adapter
      https://github.com/PHPSocialNetwork/phpfastcache

    • core: Unit Test powered by PestPHP.

    • media: Added new move() method instead of rename()

    • entries: Added new move() method instead of rename()

    • core: Added new PATH['tmp'] constant (#470)

      Now we have:

      PATH['tmp'] constant instead of PATH['cache'] and PATH['logs']

    • markdown: Added markdown basic settings (#471)

      markdown:
        auto_line_breaks: false
        auto_url_links: false
        escape_markup: false
      
    • markdown: Added ability to access markdown parser instance (#468)

      Usage:

      $markdown = flextype('markdown')->getInstance();
      
    • entries: Added new Flextype Entries Memory Storage (Flextype EMS). New private property $storage for storing current requested entry(or entries) data and all Entries CRUD operations data in memory with ability to change them dynamically on fly. New public methods getStorage() setStorage() (#467)

      Structure (Flextype EMS):

      $storage = [
          'fetch' => [
            'id' => '',
            'data' => '',
          ],
          'create' => [
            'id' => '',
            'data' => '',
          ],
          'Updated' => [
            'id' => '',
            'data' => '',
          ],
          'delete' => [
            'id' => '',
          ],
          'copy' => [
            'id' => '',
            'new_id' => '',
          ],
          'move' => [
            'id' => '',
            'new_id' => '',
          ],
          'has' => [
            'id' => '',
          ],
      ];
      

      Accessing storage example:

      flextype('emitter')->AddedListener('onEntryAfterInitialized', static function () : void {
          flextype('entries')->setStorage('fetch.data.title', 'New title');
      });
      
      $entry = flextype('entries')->fetchSingle('about');
      
      echo $entry['title'];
      
    • entries: Added new events: onEntryHas, onEntryInitialized, onEntriesInitialized (#467)

    • helpers Added new support helper find() for files and directories searching instead of find_filter()

    • helpers Added new support helper filter() for data collection filtering instead of arrays_filter()

    ๐Ÿ› Bug Fixes

    • entries: Fixed issue with delete() method (#465)

    • media: Fixed issue with exif_read_data() on files upload.

    ๐Ÿ”จ Refactoring

    • entries: Removed App from all core namespaces (#469)

    ๐Ÿ’ฅ BREAKING CHANGES

    • entries: removed properties from Entries API (#467)

      $entry_id
      $entry
      $entry_create_data
      $entry_update_data
      $entries_id
      $entries
      

      Use public methods getStorage() setStorage() instead.

      Example:

      // old
      flextype('entries')->entry['title'] = 'New title';
      
      // new
      flextype('entries')->setStorage('fetch.data.title', 'New title');
      
      // old
      $title = flextype('entries')->entry['title'];
      
      // new
      $title = flextype('entries')->getStorage('fetch.data.title');
      $title = flextype('entries')->getStorage('fetch.data')['title'];
      
    • core: Removed App from all core namespaces (#469)

      We should have

      use Flextype\Foundation\Entries\Entries;
      

      instead of

      use Flextype\App\Foundation\Entries\Entries;
      
    • core: use new PATH['tmp'] constant instead of PATH['cache'] and PATH['logs'] (#470)

    • cache: old cache config removed, use new config for PhpFastCache (#457)

    • cache: use methods has() set() get() instead of contains() save() fetch() (#457)

    • core: Removed flextype-components/session (#473)

    • core: Removed flextype-components/cookie (#473)

    • core: Removed flextype-components/number (#474)

    • core: Removed flextype-components/filesystem (#474)

    • core: Removed flextype-components/arrays (#474)

  • v0.9.11 Changes

    August 25, 2020

    ๐Ÿ”‹ Features

    ๐Ÿ†• New helper function added for access all Flextype features in one place

    flextype($container\_name = null, $container = [])
    

    IMPORTANT

    Do not use $flextype object to access Flextype features, use flextype() helper function.

    ๐Ÿ› Bug Fixes

    • core fix bug - Cannot access protected property Flextype\App\Foundation\Flextype::$container (#462)
    • core fix bug - Cannot use object of type Flextype\App\Foundation\Flextype as array (#461)
    • media fix Media exif_read_data warning - File not supported (#464)

    ๐Ÿ”จ Refactoring

    • ๐Ÿ”Œ plugins remove $flextype variable from plugins init method.
    • entries update return type for fetch() method.
    • entries add additional check for getTimestamp() method in the getCacheID()
    • entries remove dead code from fetchCollection() method.

    โšก๏ธ Vendor Updates

    • core: Update vendor flextype-components/filesystem to 2.0.8
    • core: Update vendor ramsey/uuid to 4.1.1

    โšก๏ธ Update from Flextype 0.9.10 to Flextype 0.9.11

    1. Backup your Site First!
    2. Read BREAKING CHANGES section!
    3. Download flextype-0.9.11.zip ๐Ÿ’ป 4. Unzip the contents to a new folder on your local computer. ๐Ÿšš 5. Remove on your server this folders and files:

      src/ vendor/ index.php

    4. Upload on your server this folders and files:

      src/ vendor/ index.php

    ๐Ÿ’ป 7. Clear browser cache!

  • v0.9.10 Changes

    August 19, 2020

    ๐Ÿ”‹ Features

    core Moving to PHP 7.3.0 (#456)

    core add new class Flextype that extends Slim\App (#458)

    with methods:

    /**
     * Get Dependency Injection Container.
     *
     * @param string $key DI Container key.
     */
    public function container(?string $key = null)
    
    /**
     * Returns Flextype Instance
     */
    public static function getInstance()
    
    /**
     * This method will returns the current Flextype version
     */
    public static function getVersion() : string
    

    collection Add only() method for Collection (#455)

    Example:

    ...->only(['id', 'title'])->...
    

    entries Rename path to id in Entries API (#453)

    ๐Ÿ†• New implementation

    // Entry properties
    $entry_id
    $entries_id
    
    // Arguments
    $id
    $new_id
    

    shortcode add New Shortcode (#454)

    [raw] Raw shortcode content [/raw]
    

    shortcode add New Shortcode Methods (#454)

    // Get shortcode instance.
    getInstance()
    
    // Add shortcode handler.
    addHandler(string $name, $handler)
    
    // Add event handler.
    addEventHandler($name, $handler)
    
    // Processes text and replaces shortcodes.
    process(string $input, bool $cache = true)
    

    ๐Ÿ› Bug Fixes

    • entries fix issue with entries paths on Windows (#460)
    • cache fix issue with purge() method. (#451)
    • entries fix wrong Implementation of Slug Field for Entries (#452)
    • entries add new entry field id (#452)

    ๐Ÿ’ฅ BREAKING CHANGES

    entries Rename path to id in Entries API (#453)

    Old Entry properties

    $entry_path
    $entries_path
    

    ๐Ÿ†• New Entry properties

    $entry_id
    $entries_id
    

    entries fix wrong Implementation of Slug Field for Entries (#452)

    From now we have entry fields:

    slug with current entry slug.

    Example:

    flextype-0.9.10
    

    id with current entry full path as it is was for slug field.

    Example:

    blog/flextype-0.9.10
    

    shortcode We should use process() method instead of parse() for shortcode processing. (#454)

    Example of new usage in PHP:

    ...->shortcode->process($input, $cache);
    

    core $container, $flextype and $app objects removed! (#458)

    We should use new object $flextype as it is a consolidate entry point to all Flextype features.

    Here is some examples:

    // OLD
    $app->get(...)
    $app->post(...)
    ...
    
    // NEW
    $flextype->get(...)
    $flextype->post(...)
    ...
    
    // OLD
    $container['registry'] = static function ($container) {
    return new Registry($container);
    };
    
    $container->registry->get(...)
    
    // NEW
    $flextype->container()['registry'] = static function () use ($flextype) {
    return new Registry($flextype);
    };
    
    $flextype->container('registry')->get(....)
    

    core class Container removed! (#458)

    We should use $flextype object to access all Flextype features inside Service Controllers and Models.

    Here is some examples:

    // OLD
    class FooController extends Container
    {
      public function bar()
      {
          return $this->registry->get('.....');
      }
    }
    
    // NEW
    class FooController
    {
      protected $flextype;
    
      public function __construct($flextype)
      {
          $this->flextype = $flextype;
      }
    
      public function bar()
      {
          return $this->flextype->container('registry')->get('.....');
      }
    }
    

    โšก๏ธ Update from Flextype 0.9.9 to Flextype 0.9.10

    1. Backup your Site First!
    2. Read BREAKING CHANGES section!
    3. Download flextype-0.9.10.zip ๐Ÿ’ป 4. Unzip the contents to a new folder on your local computer. ๐Ÿšš 5. Remove on your server this folders and files:

      src/ vendor/ index.php

    4. Upload on your server this folders and files:

      src/ vendor/ index.php

    ๐Ÿšš 7. Remove folder var/ ! ๐Ÿ’ป 8. Clear browser cache!

  • v0.9.9 Changes

    August 05, 2020

    ๐Ÿ”‹ Features

    core Moving to PHP 7.2.5 #444

    core Add PhpArrayFileAdapter and set PhpArrayFile Cache as a default fallback cache driver instead of Filesystem Cache driver. This new feature give us performance boost up to 25%

    core Add preflight to Flextype basic checks and performance boost.

    core Update all namespaces and core infrastructure. #437

    core Add Symfony Finder Component and find_filter() helper.

    cache Cache API improvements

    • Cache ID generation enhancements
    • add new public function fetchMultiple(array $keys)
    • add new public function saveMultiple(array $keysAndValues, $lifetime = 0)
    • add new public function deleteMultiple(array $keys)
    • add new public function deleteAll()
    • add new public function flushAll()
    • add new public function purge(string $directory)
    • add new public function purgeAll()
    • add new public function getStats()

    - add new events onCacheBeforePurgeAll, onCacheAfterPurgeAll, onCacheBeforePurge, onCacheAfterPurge

    core New Media API for work with media uploads.

    ๐Ÿ†• New objects:

    $flextype['media_files_meta']
    $flextype['media_folders_meta']
    $flextype['media_files']
    $flextype['media_folders']
    

    ๐Ÿ‘€ See: http://docs.flextype.org/en/core/media

    core New simplified parsers and serializers functionality #438

    ๐Ÿ†• New objects:

    $flextype['markdown']
    $flextype['shortcode']
    $flextype['json']
    $flextype['yaml']
    $flextype['frontmatter']
    

    ๐Ÿ†• New methods:

    $flextype->markdown->parse(string $input)
    
    $flextype->shortcode->add(string $name, $handler)
    $flextype->shortcode->parse(string $input, bool $cache = true)
    
    $flextype->json->decode(string $input, bool $cache = true, bool $assoc = true, int $depth = 512, int $flags = 0)
    $flextype->json->encode($input, int $options = 0, int $depth = 512) : string
    
    $flextype->yaml->decode(string $input, bool $cache = true, int $flags = 0) : array
    $flextype->yaml->encode($input, int $inline = 2, int $indent = 4, int $flags = 0) : string
    
    $flextype->frontmatter->decode(string $input, bool $cache = true)
    $flextype->frontmatter->encode($input) : string
    

    entries New simplified logic for entries methods: fetch() fetchSingle() and fetchCollection()

    โšก๏ธ We are stop doing unneeded things like extra scanning folders and files updates and etc... for fetching entries collections that's slowdowns the fetching process.

    We have improved filtering abilities for entries collections.

    From now there is a possible to path a much more rules for collections filtering inside the fetchCollection() and with using a standalone helper functions like collect_filter() and find_filter()

    • public function fetch(string $path, bool $collection = false, $filter = []) : array
      Fetch single entry or collections of entries.
    • public function fetchSingle(string $path) : array
      Fetch single entry.
    • public function fetchCollection(string $path, $filter = []) : array
      Fetch entries collection.

    ๐Ÿ‘€ See: http://docs.flextype.org/en/core/entries#methods

    entries New events added for Entries API.

    onEntryCreate
    onEntryCopy
    onEntryRename
    onEntryDelete
    onEntryUpdate
    onEntryAfterCacheInitialized
    onEntryAfterInitialized
    onEntriesAfterInitialized
    

    entries New decoupled and configurable fields added for entries instead of hardcoded.

    Entry fields decoupled into: /flextype/Foundation/Entries/Fields/

    Entry fields added into flextype.settings.entries.fields

    fields:
      slug:
        enabled: true
      published_at:
        enabled: true
      published_by:
        enabled: true
      modified_at:
        enabled: true
      created_at:
        enabled: true
      created_by:
        enabled: true
      routable:
        enabled: true
      parsers:
        enabled: true
      visibility:
        enabled: true
      uuid:
        enabled: true
    

    entries Add ability to set individual cache control for specific entries.

    cache:
      enabled: true
    
    or
    
    cache:
      enabled: false
    

    entries Add new Entries API class properties.

    /**
     * Current entry path
     *
     * @var string
     * @access public
     */
    public $entry_path = null;
    
    /**
     * Current entry create data array
     *
     * @var array
     * @access public
     */
    public $entry_create_data = [];
    
    /**
     * Current entry create data array
     *
     * @var array
     * @access public
     */
    public $entry_update_data = [];
    

    collections New Collection functionality on top of Doctrine Collections.

    We are able to use collections for any type of items, not just for entries.
    ๐Ÿ†• New Collection are simple and powerful!

    ๐Ÿ‘€ See: http://docs.flextype.org/en/core/collections

    settings Set max_file_size 8mb for uploads.

    yaml YAML set default inline = 5 and indent = 2

    vendors New Arrays library for Accessing PHP Arrays via DOT notation.

    rest-api New Files Rest API.

    Method Endpoint Description
    GET /api/files Fetch file(files)
    POST /api/files Upload file
    PUT /api/files Rename file
    PUT /api/files/copy Copy file
    DELETE /api/files Delete file
    โšก๏ธ PATCH /api/files/meta
    โšก๏ธ POST /api/files/meta
    DELETE /api/files/meta Delete file meta information

    rest-api New Folders Rest API.

    Method Endpoint Description
    GET /api/folders Fetch folder(folders)
    POST /api/folders Create folder
    PUT /api/folders Rename folder
    PUT /api/folders/copy Copy folder
    DELETE /api/folders Delete folder

    ๐Ÿ› Bug Fixes

    • frontmatter remove UTF-8 BOM if it exists.
    • frontmatter fix line endings to Unix style.
    • entries fix method rename() in Entries API #433
    • entries fix issue with parsing content on entry fetch #441
    • rest-api fix Rest API JSON Response #445
    • core fix all namespaces #437
    • core fix flextype config loading.
    • serializers fix YAML native parser.
    • ๐Ÿ”Œ plugins fix method getPluginsCacheID() for Plugins API

    ๐Ÿ”จ Refactoring

    • pimple remove unused $flextype variable and cleanup dependencies.
    • yaml save and mute error_reporting for native YAML parser.
    • cors remove unused parameter $args
    • ๐Ÿ”Œ plugins remove dead variables.
    • shortcode update return type for shortcode add() method.
    • cache update $driver type for DoctrineCache.

    โšก๏ธ Vendor Updates

    • core: Update vendor league/glide to 1.6.0
    • core: Update vendor doctrine/cache to 1.10.2
    • core: Update vendor doctrine/collections to 1.6.6
    • core: Update vendor respect/validation to 2.0.16
    • core: Update vendor monolog/monolog to 2.1.1
    • core: Update vendor thunderer/shortcode to 0.7.4
    • core: Update vendor flextype-components/filesystem to 2.0.7
    • core: Update vendor flextype-components/registry to 3.0.0
    • core: Update vendor flextype-components/number to 1.1.1
    • core: Update vendor composer/semver to 3.0.0
    • core: Update vendor symfony/yaml to 5.1.3
    • core: Update vendor ramsey/uuid to 4.1.0

    ๐Ÿ’ฅ BREAKING CHANGES

    • entries Wildcard * removed from parsers field.
    • entries Cache setup removed from parsers field.
    • settings /project/config/settings.yaml move to /project/config/flextype/settings.yaml
    • constants remove constant PATH['config'], use - PATH['project'] . '/config/'
    • core: remove Date Component from the system.
    • core: remove Text Component from the system.
    • cache: removed methods clear() and clearAll(), use purge() and purgeAll() instead.
    • cache: change return type for methods save(), delete() from void too bool.

    โšก๏ธ Update from Flextype 0.9.7 to Flextype 0.9.8

    1. Backup your Site First!
    2. Read BREAKING CHANGES section!
    3. Download flextype-0.9.9.zip ๐Ÿ’ป 4. Unzip the contents to a new folder on your local computer. ๐Ÿšš 5. Remove on your server this folders and files:

      /src/ /vendor/ /index.php

    4. Upload on your server this folders and files:

      /src/ /vendor/ /index.php

    ๐Ÿ’ป 7. Clear browser cache!

  • v0.9.8 Changes

    May 14, 2020

    ๐Ÿ”‹ Features

    core: New lightweight and powerful core for kickass Applications!

    core: New Content Management API (CMA) for Entries. #421

    The Content Management API (CMA), is a read-write API for managing content.

    You could use the CMA for several use cases, such as:

    • Automatic imports from WordPress, Joomla, Drupal, and more.
    • Integration with other backend systems, such as an e-commerce shop.
    • Building custom editing experiences.

    Endpoints for Content Management API:

    Method Endpoint Description
    GET /api/management/entries Fetch entry(entries)
    POST /api/management/entries Create entry
    โšก๏ธ PATCH /api/management/entries
    PUT /api/management/entries Rename entry
    PUT /api/management/entries/copy Copy entry(entries)
    DELETE /api/management/entries Delete entry

    API Tokens folder: /project/tokens/management/entries

    core: New Images API.

    Method Endpoint Description
    GET /api/images Fetch image

    API Tokens folder: /project/tokens/images

    core: New Access API to create secret tokens for Content Management API (CMA).

    API Tokens folder: /project/tokens/access

    core: add Container for extending Flextype Container instead of Controller(s)

    core: add Application URL url into the common Flextype settings #405

    core: add new improved plugins sorting in the Plugins API.

    core: add dependencies validation for Plugins API #411

    core: add configurable CORS (Cross-origin resource sharing).

    cors:
      enabled: true
      origin: "*"
      headers: ["X-Requested-With", "Content-Type", "Accept", "Origin", "Authorization"]
      methods: [GET, POST, PUT, DELETE, PATCH, OPTIONS]
      expose: []
      credentials: false
    

    core: add manifest file /src/flextype/config/flextype.yaml for Flextype.

    core: add Serializer for data encoding/decoding and Parser for data parsing #424

    ๐Ÿ› Bug Fixes

    • core: fix incorrect data merging of manifest and settings for plugins and themes #404

    ๐Ÿ’ฅ BREAKING CHANGES

    core: core decoupled in the plugins, and moved out of the Flextype release package!

    ๐Ÿ”Œ Install all needed plugins for your project by your self.
    ๐Ÿ”Œ Browse plugins: https://github.com/flextype-plugins

    core: new way for data merging of manifest and settings for plugins and themes #404

    for e.g. this is a wrong code to access site title:

    {{ registry.plugins.site.title|e('html') }}
    

    and this is a correct code to access site title:

    {{ registry.get('plugins.site.settings.title')|e('html') }}
    

    core: We should add app url into the core instead of base_url and site_url #405

    for e.g. this is a wrong code to access site url:

    {{ registry.plugins.site.url }}
    

    and this is a correct code to access app url:

    {{ registry.get('flextype.settings.url') }}
    

    core: new project folder instead of site

    • rename folder site into project

    - use new constant PATH['project'] instead of constant PATH['site']

    core: removed constants

    • PATH['plugins']
    • PATH['themes']
    • PATH['entries']
    • PATH['themes']
    • PATH['snippets']
    • PATH['fieldsets']
    • PATH['tokens']
    • PATH['accounts']

    - PATH['uploads']

    core: removed Snippets functionality

    โšก๏ธ Update from Flextype 0.9.7 to Flextype 0.9.8

    1. Backup your Site First!
    2. Read BREAKING CHANGES section!
    3. Download flextype-0.9.8.zip ๐Ÿ’ป 4. Unzip the contents to a new folder on your local computer. ๐Ÿšš 5. Remove on your server this folders and files:

      /flextype/ /vendor/ /index.php

    4. Upload on your server this folders and files:

      /src/ /vendor/ /index.php

    5. Rename /site/ to /project/ ๐Ÿ’ป 8. Clear browser cache!

    6. Create CDA, CMA and Access tokens for your project using this webpage.