1. Go to this page and download the library: Download iviphp/framework 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/ */
if ($framework->has('mailer')) {
$mailer = $framework->make('mailer');
}
use Ivi\Config\Config;
use Ivi\Container\Container;
use Ivi\Framework\Application;
use Ivi\Framework\Bootstrap\Bootstrapper;
use Ivi\Framework\Contracts\ApplicationInterface;
use Ivi\Framework\FrameworkManager;
$framework->make('app');
$framework->make(Application::class);
$framework->make(ApplicationInterface::class);
$framework->make('container');
$framework->make(Container::class);
$framework->make('config');
$framework->make(Config::class);
$framework->make('bootstrapper');
$framework->make(Bootstrapper::class);
$framework->make('framework');
$framework->make(FrameworkManager::class);
$framework->make('console');
$framework->make('console.manager');
$config = $framework->config();
declare(strict_types=1);
use Ivi\Config\Config;
use Ivi\Framework\Framework;
$config = new Config();
$framework = Framework::create(
basePath: dirname(__DIR__),
config: $config
);
declare(strict_types=1);
use Ivi\Container\Container;
use Ivi\Framework\Framework;
$container = new Container();
$framework = Framework::create(
basePath: dirname(__DIR__),
container: $container
);
use Ivi\Framework\Contracts\ApplicationInterface;
$framework->bootstrapWith(
'load.configuration',
static function (
ApplicationInterface $application
): void {
$configPath = $application->path(
'config/app.php'
);
if (is_file($configPath)) {
$values =
use App\Providers\MailServiceProvider;
if (
$framework->hasProvider(
MailServiceProvider::class
)
) {
$provider = $framework->getProvider(
MailServiceProvider::class
);
}
$providers = $framework
->registeredProviders();
$count = $framework->providerCount();
$framework->bootstrap();
$framework->boot();
if ($framework->isBootstrapped()) {
// Bootstrap operations completed.
}
if ($framework->isBooting()) {
// Provider booting is active.
}
if ($framework->isBooted()) {
// All providers completed booting.
}
if ($framework->isStarted()) {
// Application is fully initialized.
}
$console = $framework->console();
$consoleManager = $framework
->consoleManager();
declare(strict_types=1);
use Ivi\Console\Contracts\InputInterface;
use Ivi\Console\Contracts\OutputInterface;
$framework->command(
name: 'app:status',
handler: static function (
InputInterface $input,
OutputInterface $output
): int {
$output->success(
'The application is running.'
);
return 0;
},
description: 'Display application status.',
aliases: [
'status',
],
usage: 'app:status',
hidden: false
);
$framework->registerCommand(
new App\Console\Commands\CacheClearCommand()
);
$framework->registerCommands([
new App\Console\Commands\CacheClearCommand(),
new App\Console\Commands\DatabaseMigrateCommand(),
]);
public function basePath(): string;
public function path(
string $path = ''
): string;
public function environment(): string;
public function isEnvironment(
string ...$environments
): bool;
public function container(): Container;
public function config(): Config;
public function make(string $id): mixed;
public function has(string $id): bool;
public function register(
ServiceProviderInterface|string $provider
): ServiceProviderInterface;
public function hasProvider(
string $provider
): bool;
public function providers(): array;
public function bootstrap(): void;
public function isBootstrapped(): bool;
public function boot(): void;
public function isBooted(): bool;
declare(strict_types=1);
use Ivi\Framework\Application;
$application = new Application(
basePath: dirname(__DIR__),
environment: 'development'
);
$application->register(
App\Providers\AppServiceProvider::class
);
$application->start();