doctrine命令行界面不起作用

时间:2010-09-27 01:34:31

标签: codeigniter orm doctrine

我按照此页面上的所有说明操作:http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/code-igniter-and-doctrine/en

我做了所有事情,但命令行界面对我不起作用

当我在终端中执行doctrine shell脚本时,它会向我显示

define('BASEPATH','.'); // mockup that this app was executed from ci ;)
chdir(dirname(__FILE__));
include('doctrine.php');

而非实际结果:

$ cd system/application
$ ./doctrine

Doctrine命令行界面

./doctrine build-all
./doctrine build-all-load
./doctrine build-all-reload
./doctrine compile
./doctrine create-db
./doctrine create-tables
./doctrine dql
./doctrine drop-db
./doctrine dump-data
./doctrine generate-migration
./doctrine generate-migrations-db
./doctrine generate-migrations-models
./doctrine generate-models-db
./doctrine generate-models-yaml
./doctrine generate-sql
./doctrine generate-yaml-db
./doctrine generate-yaml-models
./doctrine load-data
./doctrine migrate
./doctrine rebuild-db

我不知道为什么?

1 个答案:

答案 0 :(得分:0)

第一行需要告诉脚本可以找到PHP的位置以及以下本身是用PHP编写的

因此,如果您有一个名为doctrine.sh的文件,您可以在其中放置以下内容(请注意第一行和开始+关闭PHP标记 - 我遇到了同样的问题)

#!/usr/bin/env php

<?php 
 define('BASEPATH','.'); // mockup that this app was executed from ci ;)
 include(dirname(dirname(__FILE__)) . '/libs/Doctrine/doctrine.php');
?>

doctrine.php看起来就像您发布的链接