PHP code example of blackcube / core

1. Go to this page and download the library: Download blackcube/core 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/ */

    

blackcube / core example snippets

 
// main configuration file
   'container' => [
      'singletons' => [
         // local filesystem
         blackcube\core\components\Flysystem::class => [
            'class' => blackcube\core\components\FlysystemLocal::class,
            'path' => getstrenv('FILESYSTEM_LOCAL_PATH'),
         ],
         // or s3
         blackcube\core\components\Flysystem::class => [
            'class' => blackcube\core\components\FlysystemAwsS3::class,
           'key' => getstrenv('FILESYSTEM_S3_KEY'),
           'secret' => getstrenv('FILESYSTEM_S3_SECRET'),
           'bucket' => getstrenv('FILESYSTEM_S3_BUCKET'),
           'region' => getstrenv('FILESYSTEM_S3_REGION'),
           'version' => 'latest',
           'endpoint' => getstrenv('FILESYSTEM_S3_ENDPOINT'),
           'pathStyleEndpoint' => getboolenv('FILESYSTEM_S3_PATH_STYLE'),
         ],
      ]
   ],
// ...
    'bootstrap' => [
        // ... boostrapped modules
        'blackcube', // blackcube core
    ],
    'modules' => [
        // ... other modules
        'blackcube' => [
            'class' => blackcube\core\Module::class,
            'plugins' => [
               // additional plugins
            ],
            'cmsEnabledmodules' => [
               // additional modules
            ],
            'allowedParameterDomains' => ['],
            // override components if needed
            'components' => [
               'db' => ...
               'cache' => ...
               'fs' => ...
            ],
            /// end override
        ],
    ],
// ...

php yii.php migrate

php yii.php bc:init