<?php
namespace Moto\Application\Installation; use Moto; class InstallationProvider extends Moto\System\ServiceProvider { const MODE_INSTALLATION = 'installation'; const MODE_RESTORING = 'restoring'; public function register() { if (!Moto\System::isInstallEngine()) { return; } Moto\System::app()->bind('Installation.Application', function ($app, $params) { $backupPath = Moto\System::getAbsolutePath(Moto\Application\Installation\Restoring::RESTORING_SOURCE_DIR); if (is_dir($backupPath)) { $application = new Moto\Application\Installation\Restoring($params); } else { $application = new Moto\Application\Installation\Processor($params); } return $application; }); } public function boot() { if (!Moto\System::isInstallEngine()) { return; } } } 