cli rebuild.php

This commit is contained in:
Yuri Kuznetsov
2014-06-02 16:14:58 +03:00
parent 5d78730dde
commit 6284b56718
2 changed files with 22 additions and 0 deletions

View File

@@ -128,6 +128,15 @@ class Application
$cronManager = new \Espo\Core\CronManager($this->container);
$cronManager->run();
}
public function runRebuild()
{
$auth = $this->getAuth();
$auth->useNoAuth(true);
$dataManager = $this->getContainer()->get('dataManager');
$dataManager->rebuild();
}
public function isInstalled()
{

13
rebuild.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
$sapiName = php_sapi_name();
if (substr($sapiName, 0, 3) != 'cli') {
die("cron can be run only via CLI");
}
include "bootstrap.php";
$app = new \Espo\Core\Application();
$app->runRebuild();