Propel ORM установка по-русски -- windows
Primary tabs
Устанавливать будем с помощью композера -- в корне проекта (сайта) создаём файл composer.json с содержимым:
{
"require": {
"propel/propel": "~2.0@dev"
}
}
После чего выполняем команду (или эту её версию)
php composer.phar install
Тестируем
Чтобы протестировать работу перейдите во всю ту же корневую папку проекта, например:
cd myproject
и запустите команду (на винде может потребоваться её окружение двойными кавычками):
vendor/bin/propel
В ответ должны получить что-то вроде:
Propel version 2.0.0-dev
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
build Build the model classes based on Propel XML schemas
build-sql Build SQL files
convert-conf Transform the configuration to PHP code leveraging the ServiceContainer
diff Generate diff classes
down Execute migrations down
graphviz Generate Graphviz files (.dot)
help Displays help for a command
init Initializes a new project
insert-sql Insert SQL statements
list Lists commands
migrate Execute all pending migrations
reverse Reverse-engineer a XML schema file based on given database. Uses given `connection` as name, as dsn or your `reverse.connection` configuration in propel config as connection.
status Get migration status
up Execute migrations up
config
config:convert Transform the configuration to PHP code leveraging the ServiceContainer
database
database:reverse Reverse-engineer a XML schema file based on given database. Uses given `connection` as name, as dsn or your `reverse.connection` configuration in propel config as connection.
graphviz
graphviz:generate Generate Graphviz files (.dot)
migration
migration:create Create an empty migration class
migration:diff Generate diff classes
migration:down Execute migrations down
migration:migrate Execute all pending migrations
migration:status Get migration status
migration:up Execute migrations up
model
model:build Build the model classes based on Propel XML schemas
sql
sql:build Build SQL files
sql:insert Insert SQL statements
test
test:prepare Prepare the Propel test suite by building fixtures
Также добавьте путь к данному скрипту в систему переменную Path -- чтобы не было такой ошибки. -- Лучше не добавлять этот путь, а вызывать скрипт как есть "vendor/bin/propel" -- это позволит надежнее работать на одном компьютере с разными проектами использующими композер.
- Log in to post comments
- 3740 reads