Tools For Better Developers

Latest Posts

Framework: View Prototypes And Render-Time Views

2022 March Osm Framework

2 years ago ∙ 1 minute read

A View is a short-living object that is created and computed during page rendering. You can also create a pre-configured a View object prototype in advance, and then clone it for rendering.

It's important not to execute render-time properties while configuring the prototype.

Use view() helper function to create render-time view instances, and mark render-time properties using #[RenderTime] attribute to prevent accessing them before rendering.

News: 2021 Oct 11 - Oct 22

2021 October News

2 years ago ∙ 1 minute read

This sprint was dedicated to writing Osm Framework documentation, and indeed, there are 8 new in-depth documentation articles, 4-5 minutes long each.

Despite documentation focus, I kept improving the website. From now on, you can assign a canonical URL to a blog post or a documentation page, and use GitHub friendly relative URLs in documentation.

But the most important thing - I started sharing progress and insights daily on Twitter.

News: 2021 Sep 27 - Oct 08

2021 October News

2 years ago ∙ 4 minutes read

osm.software website. From now on, Osm Framework documentation resides in the docs/ directory of the osmphp/framework repository, and it is displayed in a separate section of osm.software website. New data source indexing engine allows running complex interdependent data synchronization with a single command, osm index. New Placeholder class simplifies dynamic Markdown content generation.

Osm Framework. Apply dynamic traits within the same file using #[UseIn] attribute. Implement fast dynamic routing using new DynamicRoute class. Generate URLs using new $osm_app->base_url property.

News: 2021 Sep 13 - Sep 24

2021 September News

2 years ago ∙ 2 minutes read

This website got a completely new look. There are new blog posts diving into core Osm Framework features. Osm Framework itself offers more convenient page layout, website-wide header, footer and <head>, customizable error pages. The themes support theme-specific CSS styles and JS scripts not bound to any module. New projects come with a handy bin/install.sh script that simplifies installation on Linux. From now on, run osmh without any parameters.

Framework: Application

2021 September Osm Framework

2 years ago ∙ 4 minutes read

In Osm Framework, an application is a set of modules that you run as a whole. There are several applications defined in the project, each having its own PHP class. Mostly, deal with the main one, Osm\App\App. Beside the class name, every application also has a name, the main one is named Osm_App.

Access the current application object, and the main parts of Osm Framework, via the global $osm_app object and its properties. Add your own long-living objects there. Run an application using its HTTP or console entry point, or using Apps::run().

Note. This post is moved to Osm Framework documentation.

Framework: Modules

2021 September Osm Framework

2 years ago ∙ 4 minutes read

Modular software development is a well-known practice of dividing your application into several modules, each doing one thing, and doing it well. It increases readability and simplifies maintenance, as application concerns are fully separated from one another, easier to reason about, and to debug.

Modular development also encourages reuse. It's like a puzzle. Using one set of modules, you'll get an e-commerce application, using another set of modules - you'll get a blog application.

Note. This post is moved to Osm Framework documentation.

osm.software: Deploying Updates

2021 September osm.software Website

2 years ago ∙ 2 minutes read

After pushing changes to GitHub, osm.software website is updated without any additional manual action. On push, GitHub executes the deployment script on the production server. Most changes are done to content only, and in this case, the deployment script only updates the search index. Otherwise, with the website being on maintenance, it additionally updates Composer and Node dependencies, builds JS and CSS assets, and runs the database migrations.