Download the PHP package abollinger/bricolo without Composer

On this page you can find all versions of the php package abollinger/bricolo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bricolo

Bricolo

Bricolo is a PHP command-line utility library that provides tools for managing databases, running servers, and enhancing PHP framework functionality. With features like dynamic port assignment and color-coded output, Bricolo is designed to simplify and automate server setup, database management, and terminal output styling.

Features

Table of Contents
  1. Installation
  2. Usage
    • Viewing Help Information
    • Launching a Local Server
    • Database Management
    • Page Creation
    • Color-Coded CLI Output
  3. Example Command
  4. Contributing
  5. Contact

Installation

Install the last version via Composer:

Then you can call the functions by typing:

Note

We strongly recommand to add a file named bricolo (without extension) at the route of your project, with the following content:

You can use this command to automatically create this file:

This will allow you to type php bricolo functionName instead of vendor/bin/bricolo. For the rest of this documentation, we'll use the php bricolo functionName format.

Usage

Bricolo provides several command-line commands. The serve command is one of the main functionalities, enabling quick and flexible server setup directly from the CLI.

Viewing Help Information

To see a list of available commands and get a quick overview of each, you can run:

Launching a Local Server

The serve command launches a PHP server on a specified port and host. If the chosen port is already in use, Bricolo will automatically increment the port number until an available one is found.

Example of usage

  1. Start a Server on the Default Port and Host:

This will attempt to start a server at localhost:1234 with the current directory as the root. If port 1234 is in use, it will try 1235, then 1236, and so on until it finds an open port.

  1. Specify a Custom Port and Host:

The server will start on the specified host and port, using /path/to/your/project as the document root.

Database Management

The migrate command in Bricolo enables you to initialize and set up your database with tables and default data. This command automates the creation of essential tables and can insert sample data to get your database up and running quickly.

Step 1: Configure Database Connection in .env

To enable database functionality, set up a .env file in the root directory of the Partez framework with the following required database connection variables:

Step 2: Customize the SQL Dump File (Optional)

Bricolo uses a default SQL dump file located at src/Data/templates/populate.sql to create tables and insert data. By default, this file includes SQL commands to create a basic users table:

The password used here a 1234 ecnrypt with the password_hash() function, following this model:

We strongly recommend to customize this method in your own app.

Providing a Custom SQL Dump File

If you’d like to use a different SQL dump file, specify its path in the .env file with the optional variable APP_DUMP_SQL. For example:

When APP_DUMP_SQL is set and the specified file exists, Bricolo will use it instead of src/Data/templates/populate.sql. This feature gives you the flexibility to customize database setup while keeping a default structure available.

Note: Ensure that the path specified in APP_DUMP_SQL is relative to the root of the Partez framework or provide an absolute path.

Step 3: Run the Migration Command

To initialize the database and set up tables as defined in the SQL dump file, run the migrate command:

Migration Process

When you run the migrate command, Bricolo will follow these steps:

  1. Verify Database Connection: Bricolo will check if it can connect to the specified database server using the credentials from .env. If the database specified in DB_NAME does not already exist, it will be created.

  2. Locate SQL Dump File: Bricolo will first check for a custom SQL dump file path in APP_DUMP_SQL. If this variable is set and the file exists, it will be used for the migration. Otherwise, Bricolo will fall back to the default src/Data/templates/populate.sql.

  3. Execute SQL Commands: Bricolo will read the SQL commands from the selected dump file and execute them in sequence to set up tables and insert any predefined data.

This automated setup process simplifies initializing a new database environment, making it efficient to prepare a clean, ready-to-use database for development.

Example .env file

Page Creation

Bricolo provides a straightforward way to generate a new controller and view for a page. This functionality is accessed from the command line and can quickly create files based on your predefined templates.

Using createPage from the Command Line

The createPage command generates:

  1. A Controller file based on a controller template.
  2. A View file in .twig format, using a view template.

Command Syntax

To create a new page, use the following command:

Parameters

File Locations

Error Handling

If either name or route is missing, createPage will display an error message. Any other errors will also be displayed for troubleshooting.

Color-Coded CLI Output

Bricolo includes a sprintc function to apply color formatting to CLI output, making it easier to differentiate messages by their type (e.g., errors in red, success messages in green).

Example Command

Below is an example sequence to set up and launch a development environment with Bricolo:

Contributing

We welcome contributions! Here’s how to contribute:

Contact

If you have any questions, feel free to reach out:

Antoine Bollinger - LinkedIn - [email protected]

You can talk to me in 🇫🇷, 🇧🇷 or 🇬🇧.


All versions of bricolo with dependencies

PHP Build Version
Package Version
Requires abollinger/helpers Version ^1.2
vlucas/phpdotenv Version ^5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package abollinger/bricolo contains the following files

Loading the files please wait ....