views:

20

answers:

1

I followed all the instructions on this page : http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/code-igniter-and-doctrine/en

i did all things but the Command Line Interface doesn't work for me

when i execute the doctrine shell script in terminal it show me this

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

instead of the real result :

$ cd system/application
$ ./doctrine

Doctrine Command Line Interface

./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

I don't know why?

A: 

The first line needs to tell the script where PHP can be found and that the following itself is written in PHP

So if you have a file called doctrine.sh, you can place the following inside it (note the very first line and the opening+closing PHP tags - I had the same problem)

#!/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 looks like the one from the link you posted

DrColossos