コード例 #1
0
ファイル: AdapterTest.php プロジェクト: azema/phigrate
 public function testDelimiterOnExecute()
 {
     $this->object->setExport(true);
     $query = 'SELECT * FROM users';
     $expected = $query . ';';
     $this->object->execute($query);
     $actual = $this->object->getSql();
     $this->assertStringStartsWith($expected, $actual);
     $this->object->setExport(true);
     $delimiter = '|';
     $this->object->setDelimiter($delimiter);
     $expected = $query . $delimiter;
     $this->object->execute($query);
     $actual = $this->object->getSql();
     $this->assertStringStartsWith($expected, $actual);
 }
コード例 #2
0
ファイル: TableDefinition.php プロジェクト: azema/phigrate
 /**
  * init sql
  *
  * @param string $name    The table name
  * @param array  $options The options definition of the table
  *
  * @return void
  */
 protected function _initSql($name, $options = array())
 {
     if (!is_array($options)) {
         $options = array();
     }
     //are we forcing table creation? If so, drop it first
     if (array_key_exists('force', $options) && $options['force'] == true) {
         $this->_adapter->dropTable($name);
     }
     $temp = '';
     if (array_key_exists('temporary', $options)) {
         $temp = ' TEMPORARY';
     }
     $create_sql = sprintf('CREATE%s TABLE ', $temp);
     $create_sql .= sprintf("%s (\n", $this->_adapter->identifier($name));
     $this->_sql .= $create_sql;
     $this->_initialized = true;
 }
コード例 #3
0
ファイル: migration.php プロジェクト: azema/phigrate
 public function quote($value)
 {
     $this->datas['quote'] = array('value' => $value);
     return parent::quote($value);
 }