symfony starts

cathy@cathy-VirtualBox:~/sfprojects/myproject2$ mkdir -p lib/vendorcathy@cathy-VirtualBox:~/sfprojects/myproject2$ cd lib/vendor
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ cp /home/cathy/Downloads/symfony-1.4.20.tgz .
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ ls
symfony-1.4.20.tgz
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ tar zxpf symfony-1.4.20.tgz
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ mv symfony-1.4.20 symfony
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ rm symfony-1.4.20.tgz
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ ls -al
total 608
drwxrwxr-x 3 cathy cathy   4096 Mar  1 19:41 .
drwxrwxr-x 3 cathy cathy   4096 Mar  1 19:39 ..
-rw-r–r– 1 cathy cathy 608786 Jan  1  1970 package.xml
drwxrwxr-x 5 cathy cathy   4096 Mar  1 19:40 symfony
cathy@cathy-VirtualBox:~/sfprojects/myproject2/lib/vendor$ cd ../..
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ symfony generate:project myproject2
symfony: command not found
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ lib/vendor/symfony/data/bin/symfony generate:project myproject2
>> dir+      /home/cathy/sfprojects/myproject2/data
>> dir+      /home/cathy/sfprojects/myproject2/data/fixtures
>> file+     /home/cathy/sfprojects/myproject2/data/fixtures/fixtures.yml
>> file+     /home/cathy/sfprojects/myproject2/symfony
>> dir+      /home/cathy/sfprojects/myproject2/apps
>> dir+      /home/cathy/sfprojects/myproject2/plugins
>> dir+      /home/cathy/sfprojects/myproject2/test
>> dir+      /home/cathy/sfprojects/myproject2/test/bootstrap
>> file+     /home/cathy/sfprojects/myproject2/test/bootstrap/functional.php
>> file+     /home/cathy/sfprojects/myproject2/test/bootstrap/unit.php
>> dir+      /home/cathy/sfprojects/myproject2/test/functional
>> dir+      /home/cathy/sfprojects/myproject2/test/unit
>> dir+      /home/cathy/sfprojects/myproject2/log
>> dir+      /home/cathy/sfprojects/myproject2/lib/form
>> file+     /home/cathy/sfprojects/myproject2/lib/form/BaseForm.class.php
>> dir+      /home/cathy/sfprojects/myproject2/config
>> file+     /home/cathy/sfprojects/myproject…g/ProjectConfiguration.class.php
>> file+     /home/cathy/sfprojects/myproject2/config/properties.ini
>> file+     /home/cathy/sfprojects/myproject2/config/rsync_exclude.txt
>> dir+      /home/cathy/sfprojects/myproject2/cache
>> dir+      /home/cathy/sfprojects/myproject2/web
>> file+     /home/cathy/sfprojects/myproject2/web/robots.txt
>> file+     /home/cathy/sfprojects/myproject2/web/.htaccess
>> dir+      /home/cathy/sfprojects/myproject2/web/css
>> file+     /home/cathy/sfprojects/myproject2/web/css/main.css
>> dir+      /home/cathy/sfprojects/myproject2/web/uploads
>> dir+      /home/cathy/sfprojects/myproject2/web/uploads/assets
>> dir+      /home/cathy/sfprojects/myproject2/web/js
>> dir+      /home/cathy/sfprojects/myproject2/web/images
>> tokens    /home/cathy/sfprojects/myproject…g/ProjectConfiguration.class.php
>> tokens    /home/cathy/sfprojects/myproject2/config/properties.ini
>> tokens    /home/cathy/sfprojects/myproject2/config/rsync_exclude.txt
>> tokens    /home/cathy/sfprojects/myproject…g/ProjectConfiguration.class.php
>> tokens    /home/cathy/sfprojects/myproject2/config/properties.ini
>> tokens    /home/cathy/sfprojects/myproject2/config/rsync_exclude.txt
>> tokens    /home/cathy/sfprojects/myproject2/lib/form/BaseForm.class.php
>> dir+      /home/cathy/sfprojects/myproject2/config/doctrine
>> file+     /home/cathy/sfprojects/myproject2/config/doctrine/schema.yml
>> file+     /home/cathy/sfprojects/myproject2/config/databases.yml
>> chmod 777 /home/cathy/sfprojects/myproject2/web/uploads
>> chmod 777 /home/cathy/sfprojects/myproject2/cache
>> chmod 777 /home/cathy/sfprojects/myproject2/log
>> chmod 777 /home/cathy/sfprojects/myproject2/symfony
>> chmod 777 /home/cathy/sfprojects/myproject2/web/uploads/assets
>> tokens    /home/cathy/sfprojects/myproject2/config/doctrine/schema.yml
>> tokens    /home/cathy/sfprojects/myproject…g/ProjectConfiguration.class.php
>> tokens    /home/cathy/sfprojects/myproject2/config/properties.ini
>> tokens    /home/cathy/sfprojects/myproject2/config/rsync_exclude.txt
>> tokens    /home/cathy/sfprojects/myproject2/config/databases.yml
>> tokens    /home/cathy/sfprojects/myproject2/lib/form/BaseForm.class.php
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ php symfony generate:app frontend
>> dir+      /home/cathy/sfprojects/myproject2/apps/frontend/templates
>> file+     /home/cathy/sfprojects/myproject…ps/frontend/templates/layout.php
>> dir+      /home/cathy/sfprojects/myproject2/apps/frontend/modules
>> dir+      /home/cathy/sfprojects/myproject2/apps/frontend/i18n
>> dir+      /home/cathy/sfprojects/myproject2/apps/frontend/lib
>> file+     /home/cathy/sfprojects/myproject…ps/frontend/lib/myUser.class.php
>> dir+      /home/cathy/sfprojects/myproject2/apps/frontend/config
>> file+     /home/cathy/sfprojects/myproject2/apps/frontend/config/routing.yml
>> file+     /home/cathy/sfprojects/myproject2/apps/frontend/config/cache.yml
>> file+     /home/cathy/sfprojects/myproject2/apps/frontend/config/filters.yml
>> file+     /home/cathy/sfprojects/myproject…pps/frontend/config/settings.yml
>> file+     /home/cathy/sfprojects/myproject2/apps/frontend/config/app.yml
>> file+     /home/cathy/sfprojects/myproject2/apps/frontend/config/view.yml
>> file+     /home/cathy/sfprojects/myproject…pps/frontend/config/security.yml
>> file+     /home/cathy/sfprojects/myproject…plicationConfiguration.class.php
>> file+     /home/cathy/sfprojects/myproject…ps/frontend/config/factories.yml
>> tokens    /home/cathy/sfprojects/myproject…pps/frontend/config/settings.yml
>> file+     /home/cathy/sfprojects/myproject2/web/index.php
>> file+     /home/cathy/sfprojects/myproject2/web/frontend_dev.php
>> tokens    /home/cathy/sfprojects/myproject2/web/index.php
>> tokens    /home/cathy/sfprojects/myproject2/web/frontend_dev.php
>> rename    /home/cathy/sfprojects/myproject…/frontendConfiguration.class.php
>> tokens    /home/cathy/sfprojects/myproject…/frontendConfiguration.class.php
>> chmod 777 /home/cathy/sfprojects/myproject2/web/uploads
>> chmod 777 /home/cathy/sfprojects/myproject2/cache
>> chmod 777 /home/cathy/sfprojects/myproject2/log
>> chmod 777 /home/cathy/sfprojects/myproject2/symfony
>> chmod 777 /home/cathy/sfprojects/myproject2/web/uploads/assets
>> dir+      /home/cathy/sfprojects/myproject2/test/functional/frontend

cathy@cathy-VirtualBox:~/sfprojects/myproject2$ sudo cp /etc/apache2/sites-available/jobeet /etc/apache2/sites-available/myproject2
[sudo] password for cathy:
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ sudo nano /etc/apache2/sites-available/myproject2
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ sudo a2ensite myproject2
Enabling site myproject2.
To activate the new configuration, you need to run:
service apache2 reload
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ sudo /etc/init.d/apache2 restartSite should now be created.

Databases

Edit the schema.yml
Then create the databasemysqladmin -uroot -p create myproject2
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ php symfony doctrine:build –model
>> doctrine  generating model classes
>> file+     /tmp/doctrine_schema_83395.yml
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/PropertyTable.class.php
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/Area.class.php
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/Property.class.php
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/AreaTable.class.php
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/base/BaseProperty.class.php
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/base/BaseArea.class.php
>> autoload  Resetting application autoloaders
>> file-     /home/cathy/sfprojects/myproject2/cache/frontend/dev/config/config_autoload.yml.php
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ php symfony doctrine:build –sql
>> doctrine  generating model classes
>> file+     /tmp/doctrine_schema_53380.yml
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/base/BaseProperty.class.php
>> tokens    /home/cathy/sfprojects/myproject2/lib/model/doctrine/base/BaseArea.class.php
>> autoload  Resetting application autoloaders
>> file-     /home/cathy/sfprojects/myproject2/cache/frontend/dev/config/config_autoload.yml.php
>> doctrine  generating sql for models
>> dir+      /home/cathy/sfprojects/myproject2/data/sql
>> doctrine  Generated SQL successfully for models
cathy@cathy-VirtualBox:~/sfprojects/myproject2$ php symfony doctrine:insert-sql
>> doctrine  creating tables
>> doctrine  created tables successfully

Then tables are created.

mysql> describe property
-> ;
+————-+————–+——+—–+———+—————-+
| Field       | Type         | Null | Key | Default | Extra          |
+————-+————–+——+—–+———+—————-+
| id          | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| area_id     | bigint(20)   | NO   | MUL | NULL    |                |
| name        | varchar(255) | NO   |     | NULL    |                |
| address     | varchar(255) | NO   | UNI | NULL    |                |
| bedroom     | varchar(255) | NO   |     | NULL    |                |
| description | text         | NO   |     | NULL    |                |
| price       | bigint(20)   | NO   |     | NULL    |                |
| created_at  | datetime     | NO   |     | NULL    |                |
| updated_at  | datetime     | NO   |     | NULL    |                |
+————-+————–+——+—–+———+—————-+
9 rows in set (0.00 sec)

Loading Data

data/fixture.yml

Area:
auckland:
name: Auckland
wellington:
name: Wellington
christchurch:
name: Christchurch

Property:
p1:
name: Precinct One bedroom
address: 6 Lorne St
bedroom: 1
description: CIty apartment close to everything.
price: 280000
Area: auckland

Then

cathy@cathy-VirtualBox:~/sfprojects/myproject2$ php symfony doctrine:data-load
>> doctrine  Loading data fixtures from “/home/cathy/sfprojects/myproject2/data/fixtures”
>> doctrine  Data was successfully loaded

php symfony doctrine:build –all

(Had some troubles generateing the modules, do a doctrine:build -all seem to fix it)

php symfony doctrine:generate-module –with-show –non-verbose-templates frontend property property

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s