Ejemplo n.º 1
0
 public function setUp()
 {
     $dumper = new CDumper();
     $content = file_get_contents(dirname(__FILE__) . '/import.sql');
     $dumper->import($content);
     $this->clearSystemRegister();
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     $fs = DAO_FileSystem::getInstance();
     $fs->createPath(self::getViewPath());
     Configure::write(SitemapTemplateHelper::ConfigureKey, $this->getViewPath());
     CDumper::importFile(dirname(__FILE__) . '/import.sql');
 }
Ejemplo n.º 3
0
<?php

require_once dirname(__FILE__) . '/../_cfg/mysql_connect.php';
require_once dirname(__FILE__) . '/../3.2/class/dumper/dumper.class.php';
set_time_limit(0);
$dumper = new CDumper();
$szContent = file_get_contents('./original-dump.sql');
$dumper->import($szContent);
print 'Database restored' . "\r\n";
$path = dirname(__FILE__) . '/../_cache/system_register_get';
if (file_exists($path)) {
    unlink($path);
}
$path = dirname(__FILE__) . '/../_cache/system_register_child';
if (file_exists($path)) {
    unlink($path);
}
print 'System Register cache cleared' . "\r\n";
Ejemplo n.º 4
0
 public static function exportFile($szFileName, $dbase = '', $db_table = '')
 {
     $dumper = new CDumper();
     $result = $dumper->export($dbase, $db_table);
     file_put_contents($szFileName, $result);
 }
Ejemplo n.º 5
0
 public function setUp()
 {
     parent::setUp();
     CDumper::importFile(dirname(__FILE__) . '/import.sql');
     include __DIR__ . '/import.php';
 }
Ejemplo n.º 6
0
 /**
  *   -------------------------------------------------------------------------------------------
  *   Импортирует SQL-console
  *   @return
  *   -------------------------------------------------------------------------------------------
  */
 public function import()
 {
     if (!empty($_FILES['file'])) {
         $fs = DAO_FileSystem::getInstance();
         $fs->upload('file', FILE_PATH . 'import.sql');
         if (file_exists(FILE_PATH . 'import.sql')) {
             $szImport = file_get_contents(FILE_PATH . 'import.sql');
             $dumper = new CDumper();
             $szDump = $dumper->import($szImport);
             $this->addAlert('Файл импортирован');
         }
     }
     $this->jump('sql.php');
 }
Ejemplo n.º 7
0
 public function setUp()
 {
     CDumper::importFile(dirname(__FILE__) . '/import.sql');
     SystemRegisterSample::createCache();
 }
Ejemplo n.º 8
0
<?php

require_once dirname(__FILE__) . '/../_cfg/init.php';
require_once CLASS_PATH . 'dumper/dumper.class.php';
set_time_limit(0);
// СОХРАНЕНИЕ СТАРОЙ БД :)
$dumper = new CDumper();
$szContent = $dumper->export();
file_put_contents('./original-dump.sql', $szContent);
print 'Database created' . "\r\n";
SystemRegisterSample::createCache();
print 'System register cache cleared' . "\r\n";
Ejemplo n.º 9
0
<?php

use Extasy\tests\Helper;
\Extasy\tests\system_register\Restorator::restore();
require_once CLASS_PATH . 'dumper/dumper.class.php';
$sql = <<<SQL
\tDROP TABLE IF EXISTS acl_actions ;
\tDROP TABLE IF EXISTS acl_grants;
\tCREATE TABLE acl_actions (
\t\t`id` INT NOT NULL auto_increment,
\t\t`name` varchar(40) not null COMMENT 'Имя события',
\t\t`title` varchar(80) null COMMENT 'Подпись к событию',
\t\t`parentId` int not null,
\t\t`fullPath` varchar(255) not null,
\t\tPRIMARY KEY (`id`),
\t\tindex `searchParent` (`parentId`),
\t\tindex `searchChild` (`parentId`,`name`),
\t\tindex `searchPath` (`fullPath`)
\t);
\tCREATE TABLE acl_grants (
\t\t`actionId` int not null COMMENT 'Индекс события',
\t\t`entity` varchar(80) not null COMMENT 'Имя объекта',
\t\t unique `search` (`actionId`,`entity`),
\t\t index search_by_entity (`entity`)
\t);

SQL;
$dumper = new CDumper();
$dumper->import($sql);