PHP code example of jevets / kirby-phpdotenv

1. Go to this page and download the library: Download jevets/kirby-phpdotenv library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jevets / kirby-phpdotenv example snippets


# site/config/config.php
c::set('debug', env('APP_DEBUG', false));

# elsewhere
c::get('debug'); // true


 
new Jevets\Kirby\Dotenv\Dotenv(__DIR__ . DS, '.env');

c::set('license', env('KIRBY_LICENSE', 'put your license in .env'));
c::set('debug', env('APP_DEBUG', false));

c::get('license'); // "1234-12345-123456"
c::get('debug'); // true

# Composer autoload
s\Kirby\Dotenv\Dotenv(__DIR__ . DS . '..');

# Setup Kirby
$kirby = kirby();
$kirby->roots()->site = __DIR__ . DS . '..' . DS . 'site';
bash
project/
  .env
  .env.example
  .gitignore
  package.json
  composer.json
  site/
    accounts/
    blueprints/
    cache/
    config/
    snippets/
    templates/
  public/
    kirby/
      toolkit/
    panel/
    content/
    assets/
    thumbs/
    index.php
    site.php
  src/
  vendor/