| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
$this->installDir(dirname(__FILE__).'/sandbox_skeleton');
|
|
|
4 |
|
|
|
5 |
$this->logSection('install', 'add symfony CLI for Windows users');
|
|
|
6 |
$this->getFilesystem()->copy(dirname(__FILE__).'/symfony.bat', sfConfig::get('sf_root_dir').'/symfony.bat');
|
|
|
7 |
|
|
|
8 |
$this->logSection('install', 'add LICENSE');
|
|
|
9 |
$this->getFilesystem()->copy(dirname(__FILE__).'/../../LICENSE', sfConfig::get('sf_root_dir').'/LICENSE');
|
|
|
10 |
|
|
|
11 |
$this->logSection('install', 'default to sqlite');
|
|
|
12 |
$this->runTask('configure:database', sprintf("'sqlite:%s/sandbox.db'", sfConfig::get('sf_data_dir')));
|
|
|
13 |
|
|
|
14 |
$this->logSection('install', 'create an application');
|
|
|
15 |
$this->runTask('generate:app', 'frontend');
|
|
|
16 |
|
|
|
17 |
$this->logSection('install', 'publish assets');
|
|
|
18 |
$this->runTask('plugin:publish-assets');
|
|
|
19 |
|
|
|
20 |
$this->logSection('install', 'fix sqlite database permissions');
|
|
|
21 |
touch(sfConfig::get('sf_data_dir').'/sandbox.db');
|
|
|
22 |
chmod(sfConfig::get('sf_data_dir'), 0777);
|
|
|
23 |
chmod(sfConfig::get('sf_data_dir').'/sandbox.db', 0777);
|
|
|
24 |
|
|
|
25 |
$this->logSection('install', 'add an empty file in empty directories');
|
|
|
26 |
$seen = array();
|
|
|
27 |
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(sfConfig::get('sf_root_dir')), RecursiveIteratorIterator::CHILD_FIRST) as $path => $item)
|
|
|
28 |
{
|
|
|
29 |
if ($item->isDir() && !$item->isLink() && !isset($seen[$path]))
|
|
|
30 |
{
|
|
|
31 |
touch($item->getRealPath().'/.sf');
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
$seen[$item->getPath()] = true;
|
|
|
35 |
}
|