# css-javascript-toolbox/6.0.15/framework/installer/dbfile.class.php

CSS &amp; JavaScript Toolbox, version 6.0.15. 104 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.15/code/framework/installer/dbfile.class.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.15/raw/framework/installer/dbfile.class.php
- Modified: 2013-03-17T20:09:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.15/code/framework/installer/dbfile.class.php#L10-L20`.

```php
<?php
/**
* 
*/

// Disallow direct access.
defined('ABSPATH') or die("Access denied");

/**
* 
*/
class CJTDBFileInstaller {
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	protected $file;
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	protected $name;
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	protected $statements;
	
	/**
	* put your comment there...
	* 
	* @param mixed $file
	* @param mixed $name
	* @return CJTDBFileInstaller
	*/
	public function __construct($file, $name= null) {
		// Get content of the file!
		$this->file = is_file($file) ? file_get_contents($file) : $file;
		$this->name = $name;
		// Parse DB file ststements!
		$this->parse();
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function exec() {
		// Initialize!
		$driver = cssJSToolbox::getInstance()->getDBDriver();
		// Execute all statements!
		foreach ($this->statements as $statement) {
			// Terminate the statement with ;
			$statement = "{$statement};";
			// Execute statement!
			$driver->exec($statement);
		}
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $file
	* @param mixed $name
	*/
	public static function getInstance($file, $name = null) {
		return new CJTDBFileInstaller($file, $name);
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function getName() {
		return $this->name;	
	}
	
	/**
	* put your comment there...
	* 
	*/
	protected function parse() {
		// Initialize!
		$statementEndChar = ';';
		// SIMPLY! get statements!
		$this->statements = explode($statementEndChar, $this->file);
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function &statements() {
		return $this->statements;	
	}
	
} // End class.

```
