[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/ -> AkInstaller.php (summary)

(no description)

Author: Bermi Ferrer
Copyright: Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
License: GNU Lesser General Public License
File Size: 783 lines (31 kb)
Included or required: 9 times
Referenced: 0 times
Includes or requires: 3 files
 AkActiveRecord.php
 Ak.php
 AkActiveRecord/AkDbSchemaCache.php

Defines 1 class

AkInstaller:: (56 methods):
  AkInstaller()
  install()
  up()
  uninstall()
  down()
  _upgradeOrDowngrade()
  installVersion()
  uninstallVersion()
  _runInstallerMethod()
  getInstallerName()
  _versionPath()
  _versionPath_Deprecated()
  _moveOldVersionsFileToNewLocation()
  getInstalledVersion()
  setInstalledVersion()
  getAvailableVersions()
  modifyTable()
  addColumn()
  changeColumn()
  removeColumn()
  renameColumn()
  createTable()
  _createOrModifyTable()
  dropTable()
  dropTables()
  addIndex()
  removeIndex()
  dropIndex()
  createSequence()
  dropSequence()
  getAvailableTables()
  tableExists()
  _getColumnsAsAdodbDataDictionaryString()
  _setColumnDefaults()
  _setColumnDefault()
  _needsDefaultAttributes()
  _setDefaultAttributes()
  getDefaultColumnAttributesRules()
  _castToMultilingualColumn()
  _getColumnsToIndex()
  _getUniqueValueColumns()
  _requiresSequenceTable()
  transactionStart()
  transactionComplete()
  transactionFail()
  transactionHasFailed()
  promptUserVar()
  promtUserVar()
  _loadDbDesignerDbSchema()
  _getDbDesignerFilePath()
  _ensureColumnNameCompatibility()
  _canUseColumn()
  _getInvalidColumnNames()
  execute()
  debug()
  usage()


Class: AkInstaller  - X-Ref

== Column Types ==

Akelos natively supports the following column data types.

integer|int, float, decimal,
string, text,
datetime|timestamp, date,
binary,
boolean

Caution: Because boolean is virtual tinyint on mysql, you can't use tinyint for other things!


== Default settings for columns ==

AkInstaller suggests some default values for the column-details.

So
<code>
$this->createTable('Post','title,body,created_at,is_draft');
</code>

will actually create something like this:

title => string(255), body => text, created_at => datetime, is_draft => boolean not null default 0 index


column_name                    | default setting
-------------------------------+--------------------------------------------
id                             | integer not null auto_increment primary_key
*_id,*_by                      | integer index
description,content,body       | text
position                       | integer index
*_count                        | integer default 0
lock_version                   | integer default 1
*_at                           | datetime
*_on                           | date
is_*,has_*,do_*,does_*,are_*   | boolean not null default 0 index
*somename                      | multilingual column => en_somename, es_somename
default                        | string

AkInstaller($db_connection = null)   X-Ref
No description

install($version = null, $options = array()   X-Ref
No description

up($version = null, $options = array()   X-Ref
No description

uninstall($version = null, $options = array()   X-Ref
No description

down($version = null, $options = array()   X-Ref
No description

_upgradeOrDowngrade($action, $version = null, $options = array()   X-Ref
No description

installVersion($version, $options = array()   X-Ref
No description

uninstallVersion($version, $options = array()   X-Ref
No description

_runInstallerMethod($method_prefix, $version, $options = array()   X-Ref
Runs a a dow_1, up_3 method and wraps it into a transaction.


getInstallerName()   X-Ref
No description

_versionPath($options = array()   X-Ref
No description

_versionPath_Deprecated($options = array()   X-Ref
No description

_moveOldVersionsFileToNewLocation($options)   X-Ref
No description

getInstalledVersion($options = array()   X-Ref
No description

setInstalledVersion($version, $options = array()   X-Ref
No description

getAvailableVersions()   X-Ref
No description

modifyTable($table_name, $column_options = null, $table_options = array()   X-Ref
No description

addColumn($table_name, $column_details)   X-Ref
Adds a new column to the table called $table_name


changeColumn($table_name, $column_details)   X-Ref
No description

removeColumn($table_name, $column_name)   X-Ref
No description

renameColumn($table_name, $old_column_name, $new_column_name)   X-Ref
No description

createTable($table_name, $column_options = null, $table_options = array()   X-Ref
No description

_createOrModifyTable($table_name, $column_options = null, $table_options = array()   X-Ref
No description

dropTable($table_name, $options = array()   X-Ref
No description

dropTables()   X-Ref
No description

addIndex($table_name, $columns, $index_name = '')   X-Ref
No description

removeIndex($table_name, $columns_or_index_name)   X-Ref
No description

dropIndex($table_name, $columns_or_index_name)   X-Ref
No description

createSequence($table_name)   X-Ref
No description

dropSequence($table_name)   X-Ref
No description

getAvailableTables()   X-Ref
No description

tableExists($table_name)   X-Ref
No description

_getColumnsAsAdodbDataDictionaryString($columns)   X-Ref
No description

_setColumnDefaults($columns)   X-Ref
No description

_setColumnDefault($column)   X-Ref
No description

_needsDefaultAttributes($column)   X-Ref
No description

_setDefaultAttributes($column)   X-Ref
No description

getDefaultColumnAttributesRules()   X-Ref
Returns a key => value pair of regular expressions that will trigger methods
to cast database columns to their respective default values or a replacement expression.


_castToMultilingualColumn($found, $column)   X-Ref
No description

_getColumnsToIndex($column_string)   X-Ref
No description

_getUniqueValueColumns($column_string)   X-Ref
No description

_requiresSequenceTable($column_string)   X-Ref
No description

transactionStart()   X-Ref
Transaction support for database operations

Transactions are enabled automatically for Intaller objects, But you can nest transactions within models.
This transactions are nested, and only the othermost will be executed

$UserInstalller->transactionStart();
$UserInstalller->addTable('id, name');

if(!isCompatible()){
$User->transactionFail();
}

$User->transactionComplete();

transactionComplete()   X-Ref
No description

transactionFail()   X-Ref
No description

transactionHasFailed()   X-Ref
No description

promptUserVar($message, $options = array()   X-Ref
Promts for a variable on console scripts


promtUserVar($message, $options = array()   X-Ref
No description

_loadDbDesignerDbSchema()   X-Ref
No description

_getDbDesignerFilePath()   X-Ref
No description

_ensureColumnNameCompatibility($columns)   X-Ref
No description

_canUseColumn($column_name)   X-Ref
No description

_getInvalidColumnNames()   X-Ref
No description

execute($sql)   X-Ref
No description

debug($toggle = null)   X-Ref
No description

usage()   X-Ref
No description



Generated: Mon Oct 27 12:43:49 2008 Cross-referenced by PHPXref 0.6