Symfony 1.4: Custom directory structure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Ragnis
Forum Commoner
Posts: 31
Joined: Thu Nov 13, 2008 12:35 pm
Location: Saaremaa, Estonia, Europe, Asia, Planet Earth, The Solar System, Milky way.

Symfony 1.4: Custom directory structure

Post by Ragnis »

I want to use the following directory strucure:
home
---xx
------private_html
---------api
------------apps
------------cache
------------config
------------...
------public_html
---------api
------------index.php
------------frontend_dev.php
------------...

But i don't know what files i need to edit to get it work.
ProjectConfiguration.class.php

Code: Select all

<?php 
//require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/ 
sfCoreAutoload.class.php'; 
require_once '../../private_html/api/lib/vendor/symfony/lib/autoload/ 
sfCoreAutoload.class.php'; 
sfCoreAutoload::register(); 
class ProjectConfiguration extends sfProjectConfiguration 
{ 
  public function setup() 
  { 
    $this->setWebDir($this->getRootDir().'../../public_html/api'); 
    $this->enablePlugins('sfDoctrinePlugin'); 
  } 
} 
frontend_dev.php

Code: Select all

<?php 
// this check prevents access to debug front controllers that are 
deployed by accident to production servers. 
// feel free to remove this, extend it or make something more 
sophisticated. 
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')) && 
false) 
{ 
  die('You are not allowed to access this file. Check 
'.basename(__FILE__).' for more information.'); 
} 

//require_once(dirname(__FILE__).'/config/ 
ProjectConfiguration.class.php'); 
require_once('../../private_html/api/config/ 
ProjectConfiguration.class.php'); 
$configuration = 
ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', 
true); 
sfContext::createInstance($configuration)->dispatch(); 
I get an php error:

Code: Select all

Warning: require(/home/xx/public_html/api/lib/vendor/symfony/lib/ 
plugins/sfDoctrinePlugin/lib/database/sfDoctrineDatabase.class.php) 
[function.require]: failed to open stream: No such file or directory 
in /home/xx/private_html/api/lib/vendor/symfony/lib/autoload/ 
sfAutoload.class.php on line 188 
Fatal error: require() [function.require]: Failed opening required '/ 
home/xx/public_html/api/lib/vendor/symfony/lib/plugins/ 
sfDoctrinePlugin/lib/database/ 
sfDoctrineDatabase.class.php' (include_path='.:/usr/lib/php:/usr/local/ 
lib/php') in /home/xx/private_html/api/lib/vendor/symfony/lib/autoload/ 
sfAutoload.class.php on line 188 
---
It's never too late to answer. Even, if this topic will be several months old, i will be still waiting for the answer.


Last bumped by Ragnis on Sat May 29, 2010 9:51 am.
Post Reply