PHP Класс Newscoop\Installer\Services\DatabaseService

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$errorQueries

Защищенные свойства (Protected)

Свойство Тип Описание
$logger

Открытые методы

Метод Описание
__construct ( object $logger )
createNewscoopDatabase ( Doctrine\DBAL\Connection $connection ) Create Newscoop Database
fillNewscoopDatabase ( Doctrine\DBAL\Connection $connection ) : boolean Fill database with default data and run all not applied upgrades
importDB ( string $sqlFilePath, Doctrine\DBAL\Connection $connection, mixed $logger = null ) : integer Import sql file to databas
installDatabaseSchema ( Doctrine\DBAL\Connection $connection, string $host = null, $publicationName = null ) Install database schema
installSampleData ( Doctrine\DBAL\Connection $connection ) Fill database with sample data
loadGeoData ( Doctrine\DBAL\Connection $connection ) : boolean Fill datatabase with geodata
renderFile ( string $template, string $target, array $parameters ) : boolean Save TWIG template to file
saveDatabaseConfiguration ( Doctrine\DBAL\Connection $connection ) Save database configuration to file
saveDatabaseVersion ( Doctrine\DBAL\Connection $connection, string $version, string $roll ) : boolean Sava new database version in Versions table
searchDbRolls ( string $roll_base_dir, string $last_db_roll ) : array Search for db roll in rols directory
versionCompare ( string $p_version1, string $p_version2 ) : integer Compares versions of Newscoop for upgrades 3.1.0 before 3.1.x, 3.5.2 before 3.5.11

Защищенные методы

Метод Описание
renderTwigTemplate ( string $template, array $parameters ) : string render Twig template

Приватные методы

Метод Описание
combinePaths ( string $dirFirst, string $dirSecond ) : string Puts together two paths, usually an absolute one (directory), plus a relative one (filename)
splitSQL ( string $sqlFile ) : array Split big sql to array fo queries
withMysqlAllIsOk ( $mysqlClientCommand ) : boolean Check if current mysql instance is ok for Newscoop

Описание методов

__construct() публичный Метод

public __construct ( object $logger )
$logger object

createNewscoopDatabase() публичный Метод

Create Newscoop Database
public createNewscoopDatabase ( Doctrine\DBAL\Connection $connection )
$connection Doctrine\DBAL\Connection

fillNewscoopDatabase() публичный Метод

Fill database with default data and run all not applied upgrades
public fillNewscoopDatabase ( Doctrine\DBAL\Connection $connection ) : boolean
$connection Doctrine\DBAL\Connection
Результат boolean

importDB() публичный Метод

Import sql file to databas
public importDB ( string $sqlFilePath, Doctrine\DBAL\Connection $connection, mixed $logger = null ) : integer
$sqlFilePath string
$connection Doctrine\DBAL\Connection
$logger mixed
Результат integer

installDatabaseSchema() публичный Метод

Install database schema
public installDatabaseSchema ( Doctrine\DBAL\Connection $connection, string $host = null, $publicationName = null )
$connection Doctrine\DBAL\Connection
$host string

installSampleData() публичный Метод

Fill database with sample data
public installSampleData ( Doctrine\DBAL\Connection $connection )
$connection Doctrine\DBAL\Connection

loadGeoData() публичный Метод

Fill datatabase with geodata
public loadGeoData ( Doctrine\DBAL\Connection $connection ) : boolean
$connection Doctrine\DBAL\Connection
Результат boolean

renderFile() публичный Метод

Save TWIG template to file
public renderFile ( string $template, string $target, array $parameters ) : boolean
$template string
$target string
$parameters array
Результат boolean

renderTwigTemplate() защищенный Метод

render Twig template
protected renderTwigTemplate ( string $template, array $parameters ) : string
$template string
$parameters array
Результат string

saveDatabaseConfiguration() публичный Метод

Save database configuration to file
public saveDatabaseConfiguration ( Doctrine\DBAL\Connection $connection )
$connection Doctrine\DBAL\Connection

saveDatabaseVersion() публичный Метод

Sava new database version in Versions table
public saveDatabaseVersion ( Doctrine\DBAL\Connection $connection, string $version, string $roll ) : boolean
$connection Doctrine\DBAL\Connection
$version string
$roll string
Результат boolean

searchDbRolls() публичный Метод

Search for db roll in rols directory
public searchDbRolls ( string $roll_base_dir, string $last_db_roll ) : array
$roll_base_dir string
$last_db_roll string
Результат array

versionCompare() публичный Метод

Compares versions of Newscoop for upgrades 3.1.0 before 3.1.x, 3.5.2 before 3.5.11
public versionCompare ( string $p_version1, string $p_version2 ) : integer
$p_version1 string
$p_version2 string
Результат integer

Описание свойств

$errorQueries публичное свойство

public $errorQueries

$logger защищенное свойство

protected $logger