我正在关注正式的Propel教程:Propel chapter 2: build time
但是当我执行vendor / bin / propel sql:build脚本时,没有任何反应!
我创建了一个composer.json文件然后安装了composer,就像解释的那样。 文件已成功下载。
我去了我的项目: /媒体/ sf_sandbox /测试/温度/推进/书店
我使用了schema.xml文件的示例:
<?xml version="1.0" encoding="UTF-8"?>
<database name="bookstore" defaultIdMethod="native">
<table name="book" phpName="Book">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="title" type="varchar" size="255" required="true" />
<column name="isbn" type="varchar" size="24" required="true" phpName="ISBN"/>
<column name="publisher_id" type="integer" required="true"/>
<column name="author_id" type="integer" required="true"/>
<foreign-key foreignTable="publisher" phpName="Publisher" refPhpName="Book">
<reference local="publisher_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="author">
<reference local="author_id" foreign="id"/>
</foreign-key>
</table>
<table name="author" phpName="Author">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="first_name" type="varchar" size="128" required="true"/>
<column name="last_name" type="varchar" size="128" required="true"/>
</table>
<table name="publisher" phpName="Publisher">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
<column name="name" type="varchar" size="128" required="true" />
</table>
</database>
我使用了用户名和密码的propel.php示例,其余的保持不变:
<?php
return [
'propel' => [
'database' => [
'connections' => [
'bookstore' => [
'adapter' => 'mysql',
'classname' => 'Propel\Runtime\Connection\ConnectionWrapper',
'dsn' => 'mysql:host=localhost;dbname=my_db_name',
'user' => 'myusername',
'password' => 'mypassword',
'attributes' => []
]
]
],
'runtime' => [
'defaultConnection' => 'bookstore',
'connections' => ['bookstore']
],
'generator' => [
'defaultConnection' => 'bookstore',
'connections' => ['bookstore']
]
]
];
但是当我执行这个脚本时: vendor / bin / propel sql:build
但没有任何反应,没有新的数据库,没有错误,只是重复这一行:
/media/sf_sandbox/test/temp/propel/bookstore
/media/sf_sandbox/test/temp/propel/bookstore
我项目的路径,我无法理解这个......