Closed onix-sergey closed 8 years ago
You can use the --bootstrap
argument to include files that define your constants. Is that what you're looking for?
not sure, can you show me examples of bootstrap file? I'm refer to the second parameter - "$constants" of AssetConfig::__construct(array $data = [], array $constants = []) There is should be some way to set it for "\bin\mini_asset", at less change the "root" folder.
That argument is primarily there for testing. The AssetConfig class will automatically import all the user defined constants when an object is built. If you use the --bootstrap
argument to load the files your constants are defined in they will be available for mini-asset to use.
Are you looking for a way to manually define constants as CLI options?
If you use the --bootstrap argument to load the files your constants are defined please show me example of the bootstrap file. or are you refer to composer bootstrap file?
Are you looking for a way to manually define constants as CLI options? as I have mentioned above, I'm looking some simple way to change the "root" path. Currently library does not work if "DocumentRoot" and pwd of asset.ini file are different patches. so, yes, I'm looking some CLI option to define it. Maybe "bootstrap" will resolve it.
A bootstrap file I've used in the past is pretty simple and could look something like:
<?php
// src/bootstrap.php
require '../vendor/autoload.php';
// Define global application path constants.
define('APP_DIR', __DIR__);
// Initialize other global state.
Then this file can be included by mini-asset with
vendor/bin/mini_asset --bootstrap src/bootstrap.php build
how to set constants from console? f.e. WEBROOT in your example