Marko Gajšt Case Studies

PHP Framework Mysli


            
            Status:      Archived
            Period:      Early Career
            Technology:  PHP
            Source Code: GitHub Repository
          

Introduction

Mysli was an experimental PHP application platform and framework that powered my personal website and several small production websites for local businesses.

What began as a simple exploration of PHP gradually evolved into a complete ecosystem of modular packages covering content management, templating, internationalization, testing, packaging, frontend rendering, command-line tooling, and developer workflows.

Rather than relying heavily on external libraries, I intentionally built many of the underlying systems myself. The goal was not simply to create websites, but to understand how frameworks, tooling, and software ecosystems work beneath the surface.

Looking back, I would make very different technology choices today, but Mysli remains one of the most ambitious and educational engineering projects I’ve undertaken.

Architecture

One of the core principles behind Mysli was modularity.

The framework was composed of independent packages that could be developed, tested, documented, packaged, and distributed separately. The application entry point itself remained intentionally small, while most functionality lived inside reusable modules with clearly defined responsibilities.

This approach allowed features to evolve independently while keeping the overall system relatively simple and maintainable.

Each package included its own documentation and, in many cases, its own command-line tooling. Mysli was designed not only as a framework for building applications, but also as a small ecosystem for developing, testing, packaging, and maintaining them.

Core Components

Over time, Mysli grew into a collection of independent modules and tools, including:

Content

The content layer handled collections, media, language support, state management, caching, and content processing. This became the foundation for many of the higher-level modules.

Page

A page management system used to organize and render website pages.

Blog

A blogging engine built on top of the content and templating systems.

Portfolio

A portfolio module designed for showcasing projects and structured content.

Frontend

Frontend rendering utilities responsible for generating user-facing output.

Assets

Asset management utilities and supporting frontend tooling.

Toolkit

A collection of shared utilities used throughout the ecosystem.

Internationalization

One of the more sophisticated components was the custom internationalization package.

The system supported:

  • Translation management
  • Variable interpolation
  • Template replacement
  • Singular and plural forms
  • Number-aware language rules

Building these capabilities from scratch provided valuable insight into localization challenges and language-aware software design.

At the time, this was one of the most technically interesting parts of the framework and significantly more advanced than a simple key-value translation system.

Template Engine

Mysli included its own template parser called Tplp.

Templates could be preprocessed and cached to improve performance while remaining relatively simple to work with.

Although modern projects would likely use established solutions, creating a custom template engine helped me better understand parsing, rendering, preprocessing, caching, and developer experience concerns.

Markdown Processing

The framework included a custom markdown parser that integrated directly into content workflows.

This was another opportunity to explore parsing, transformation pipelines, content processing, and document rendering from first principles.

Development Tooling

One of the aspects that makes Mysli interesting in hindsight is that it wasn’t limited to application functionality.

Many packages exposed command-line tools that supported development workflows.

Examples included:

  • Running automated tests
  • Packaging modules into PHAR archives
  • Development and maintenance utilities
  • Project-specific tooling

Rather than focusing solely on application features, I was also exploring developer experience, automation, tooling, and the workflows surrounding software development itself.

Testing Framework

Mysli included its own testing framework and supporting command-line tools.

The system provided:

  • Test execution
  • Custom test syntax
  • Console-based reporting
  • Diff-style output for failed assertions
  • Integration with the broader package ecosystem

Creating a testing framework offered valuable lessons about software quality, automation, and developer workflows.

Packaging & Distribution

One of the areas I became particularly interested in was deployment and distribution.

Mysli included a dedicated packaging utility capable of producing PHAR archives. This allowed modules and applications to be bundled into self-contained packages that could be distributed, deployed, and reused more easily.

Combined with the dependency and module-loading system, this created a lightweight ecosystem of reusable components.

This was one of the ideas I was most fascinated by at the time: building software as a collection of independently packaged modules rather than a single monolithic codebase.

Documentation

Every major package included its own documentation describing its purpose, architecture, and usage.

The goal was not only to build software, but also to make the individual modules understandable, reusable, and maintainable.

In hindsight, the amount of effort invested into documentation, testing, packaging, and tooling is one of the things that makes the project interesting to revisit today.

Real-World Usage

Although primarily an educational project, Mysli was used in production.

The framework powered:

  • My personal website
  • Several small websites for local businesses
  • Various experiments and side projects

This provided an opportunity to validate architectural decisions against real-world requirements rather than purely theoretical examples.

Motivation

The primary goal was exploration.

I wanted to understand PHP at a deeper level and explore how far the language could be pushed while still maintaining a clean and approachable architecture.

At the time, I became particularly interested in:

  • Framework architecture
  • Modular software design
  • Packaging and distribution
  • Internationalization
  • Developer tooling
  • Reusability and separation of concerns

The project became a laboratory where I could experiment with ideas and learn by building complete systems from first principles.

Retirement

Mysli was eventually retired as the PHP ecosystem matured and modern frameworks became significantly more capable and widely adopted.

The project was not abandoned because it stopped working. Instead, industry standards evolved, tooling improved, and my interests shifted toward newer technologies and different challenges.

Today I view Mysli less as a framework and more as a learning journey through framework architecture, modularity, testing, packaging, localization, parsing, content management, developer experience, and software tooling.

Many of the lessons learned while building it still influence how I approach software design today.

If you’re curious about the technical details, I invite you to explore the source code on GitHub. The bin/ directory contains the individual packages that make up the framework, many of which include surprisingly extensive documentation describing their architecture, purpose, and usage.