<?php $entities = array(); foreach (Storm::all() as $storm) { $entities[] = $storm->getName(); } sort($entities); echo json_encode($entities);
<?php foreach (Storm::all() as $item) { $item->regenerate(); }
echo shell_exec("git init --bare .git"); echo "\n# Adding git hook 'post-receive'...\n"; $hook_file = $cwd . '/.git/hooks/post-receive'; $hook_data = "#!/bin/sh\nGIT_WORK_TREE={$cwd} git checkout -f\ncd {$cwd}\n"; file_put_contents($hook_file, $hook_data); chmod($hook_file, 0755); echo shell_exec("ls -la {$hook_file}"); echo "\n# Upload your repo\n\n"; echo "= Execute this commands in your local machine:================================\n\n"; echo "git remote add REMOTE_NAME ssh://USER@SERVER{$cwd}/.git\n"; echo "git push REMOTE_NAME YOUR_PREFERRED_BRANCH:master\n\n"; command('When the repo will be uploaded, press ENTER:'); echo "\n# Configuring database\n"; $host = command('Host: '); $db = command('Database: '); $user = command('User: '******'Pass: '******'class/Main.class.php'; Main::goCli(); Database::configure($host, $db, $user, $pass); echo "\n# Installing TreeWeb...\n"; foreach (Storm::all() as $s) { $s->install(); } echo "\n# Adding post-receive line...\n"; file_put_contents($hook_file, "php.ORIG.5_4 -n install.php --install\n", FILE_APPEND); echo "\n\n TreeWeb is now installed\n\n"; } } } }