looking for wrong seperator
[Pman.Core] / RefreshDatabaseCache.php
1 <?php
2
3 /**
4  * 
5  * this is technically a cli wrapper for the generator..
6  * 
7  * we will test it on the web initially..
8  * 
9  * 
10  */
11 require_once 'Pman.php';
12
13 class Pman_Core_RefreshDatabaseCache extends Pman
14 {     
15     static $cli_desc = "Refresh the database schema cache";
16    
17     var $cli = false;
18     function getAuth() 
19     {
20         if($_SERVER['HTTP_HOST'] == 'localhost'){
21             return true;
22         }
23         
24         $ff = HTML_FlexyFramework::get();
25         if (!empty($ff->cli)) {
26             $this->cli = true;
27             return true;
28         }
29         parent::getAuth(); // load company!
30         $au = $this->getAuthUser();
31         if (!$au || $au->company()->comptype != 'OWNER') {
32             $this->jerr("Not authenticated", array('authFailure' => true));
33         }
34         $this->authUser = $au;
35         return true;
36     
37     
38     }
39      
40     function get($args, $opts=array())
41     {
42         // technically it would be good to trash the cached ini files here.. 
43         // however we can not really do that, as the ownships are off..
44         //we can however regen our own files..
45         //DB_DataObject::debugLevel(1);
46         //HTML_FlexyFramework::get()->debug = 1;
47         
48         HTML_FlexyFramework::get()->generateDataobjectsCache(true);
49         
50         $this->jok('DONE');
51         
52     }
53     
54 }