private function clearTableSchema($name)
 {
     if (preg_match('#m[\\d]+(Create|Alter)(?<table>[a-zA-Z][a-zA-Z0-9\\_]+)Table#i', $name, $matches)) {
         $table = strtolower(Strings::camelToSnake($matches['table']));
         $path = App::path('cache') . "/schema/" . DB::getDatabaseName() . "/{$table}.dat";
         if (file_exists($path)) {
             unlink($path);
         }
     }
 }
Beispiel #2
0
 public function __construct($table)
 {
     if (!isset($table)) {
         throw new DataTableException($table, "Table name invalid - [{$table}]");
     }
     $this->tableSymbol = TableSymbol::create($table);
     $this->table = $this->tableSymbol->getName();
     $schema = App::path('schema');
     if (!isset($schema)) {
         throw new DatabaseException("Can't find schema cache directory.");
     }
     $this->source = $schema . '/' . DB::getDatabaseName() . '/' . $this->table . '.dat';
     $this->initialize();
 }
 public function getDatabase()
 {
     return DB::getDatabaseName();
 }