This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/install/ApplicationInstaller/CompileAssets.php

26 lines
627 B
PHP
Raw Normal View History

2013-10-27 06:40:05 +01:00
<?php
namespace ApplicationInstaller;
/**
* Post-install script ran when installing the system
* using composer. It compiles assets.
*/
class CompileAssets
{
static public function compile()
{
2013-10-27 06:51:15 +01:00
$railsRoot = __DIR__ . '/../..';
# Create temporary config/config.php file
$file = $railsRoot . '/config/config.php.example';
$target = $railsRoot . '/config/config.php';
copy($file, $target);
require $railsRoot . '/config/boot.php';
2013-10-27 06:40:05 +01:00
\Rails::assets()->compileAll();
2013-10-27 06:51:15 +01:00
# Delete temporary config file.
unlink($target);
2013-10-27 06:40:05 +01:00
}
}