Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
.*

tmp/*
tmp/**/*

application/Entity/Proxy/*

data/*
data/**/*
43 changes: 24 additions & 19 deletions application/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,31 @@ public function _initAutoloader()
$bisnaAutoloader = new \Doctrine\Common\ClassLoader('Bisna');
$autoloader->pushAutoloader(array($bisnaAutoloader, 'loadClass'), 'Bisna');

$appAutoloader = new \Doctrine\Common\ClassLoader('eCamp');
$autoloader->pushAutoloader(array($appAutoloader, 'loadClass'), 'eCamp');



$appAutoloader = new \Doctrine\Common\ClassLoader('Inject');
$autoloader->pushAutoloader(array($appAutoloader, 'loadClass'), 'Inject');
}


$entityAutoloader = new \Doctrine\Common\ClassLoader('Entity', APPLICATION_PATH);
$autoloader->pushAutoloader(array($entityAutoloader, 'loadClass'), 'Entity');

$providerAutoloader = new \Doctrine\Common\ClassLoader('Logic', APPLICATION_PATH);
$autoloader->pushAutoloader(array($providerAutoloader, 'loadClass'), 'Logic');

$pModAutoloader = new \Doctrine\Common\ClassLoader('PMod', APPLICATION_PATH);
$autoloader->pushAutoloader(array($pModAutoloader, 'loadClass'), 'PMod');
}

public function _initInjectionKernel()
{
$kernel = new \Inject\Kernel();

$kernel
->Bind("EntityManager")
->ToProvider(new eCamp\Provider\EntityManager());
->ToProvider(new Logic\Provider\EntityManager());

$kernel
->Bind("CampRepository")
->ToProvider(new eCamp\Provider\Repository("eCamp\Entity\Camp"));
->ToProvider(new Logic\Provider\Repository("eCamp\Entity\Camp"));

$kernel->Bind("SomeService")->ToSelf()->AsSingleton();

Expand All @@ -76,25 +79,27 @@ protected function _initZtal()

protected function _initRoutes()
{
Zend_Controller_Front::getInstance()->getRouter()->addRoute(
'UserId', new Zend_Controller_Router_Route('/doctrine/index/:UserId',
array('controller' => 'doctrine', 'action' => 'index')));


Zend_Controller_Front::getInstance()->getRouter()->addRoute(
'LoginLoginId', new Zend_Controller_Router_Route('/login/login/:Id',
array('controller' => 'login', 'action' => 'login')));
'ControllerAction', new Zend_Controller_Router_Route(':controller/:action/*',
array('controller' => 'index', 'action' => 'index')));

Zend_Controller_Front::getInstance()->getRouter()->addRoute(
'EditCamp', new Zend_Controller_Router_Route('/camp/editcamp/:Id',
array('controller' => 'camp', 'action' => 'editcamp')));
'EntityId', new Zend_Controller_Router_Route(':controller/:action/:EntityId/*',
array('controller' => 'index', 'action' => 'index'),
array('EntityId' => '\d+')));

Zend_Controller_Front::getInstance()->getRouter()->addRoute(
'CommitToCamp', new Zend_Controller_Router_Route('/camp/commitToCamp/:Id',
array('controller' => 'camp', 'action' => 'commitToCamp')));
'CampId', new Zend_Controller_Router_Route(':CampId/:controller/:action/*',
array('controller' => 'index', 'action' => 'index'),
array('CampId' => '\d+')));

Zend_Controller_Front::getInstance()->getRouter()->addRoute(
'CancelFromCamp', new Zend_Controller_Router_Route('/camp/cancelFromCamp/:Id',
array('controller' => 'camp', 'action' => 'cancelFromCamp')));
'CampEntityId', new Zend_Controller_Router_Route(':CampId/:controller/:action/:EntityId/*',
array('controller' => 'index', 'action' => 'index'),
array('CampId' => '\d+', 'EntityId' => '\d+')));


}
}
Expand Down
6 changes: 3 additions & 3 deletions library/eCamp/Entity/Camp.php → application/Entity/Camp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\Entity;
namespace Entity;

/**
* @Entity
Expand Down Expand Up @@ -51,7 +51,7 @@ class Camp

/**
* @var User
* @OneToOne(targetEntity="eCamp\Entity\User")
* @OneToOne(targetEntity="Entity\User")
* @JoinColumn(name="creator_id", referencedColumnName="id")
*/
private $creator;
Expand All @@ -63,7 +63,7 @@ class Camp
* Page Object
* @var ArrayObject
*
* @OneToMany(targetEntity="eCamp\Entity\UserToCamp", mappedBy="camp")
* @OneToMany(targetEntity="Entity\UserToCamp", mappedBy="camp")
*/
private $userCamp;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\Entity;
namespace Entity;


/**
Expand All @@ -45,7 +45,7 @@ class Login

/**
* @var \Models\User
* @OneToOne(targetEntity="eCamp\Entity\User", mappedBy="login")
* @OneToOne(targetEntity="Entity\User", mappedBy="login")
* @JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
Expand Down
6 changes: 3 additions & 3 deletions library/eCamp/Entity/User.php → application/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\Entity;
namespace Entity;

/**
* @Entity
Expand Down Expand Up @@ -100,7 +100,7 @@ class User
/**
* @var ArrayObject
*
* @OneToMany(targetEntity="eCamp\Entity\UserToCamp", mappedBy="user")
* @OneToMany(targetEntity="Entity\UserToCamp", mappedBy="user")
*/
private $userCamp;

Expand Down Expand Up @@ -279,4 +279,4 @@ public function GetCamps()



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/


namespace eCamp\Entity;
namespace Entity;

/**
* @Entity
Expand All @@ -39,15 +38,15 @@ class UserToCamp
/**
* @var User
*
* @ManyToOne(targetEntity="eCamp\Entity\User")
* @ManyToOne(targetEntity="Entity\User")
*/
private $user;


/**
* @var Camp
*
* @ManyToOne(targetEntity="eCamp\Entity\Camp")
* @ManyToOne(targetEntity="Entity\Camp")
*/
private $camp;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\Provider;
namespace Logic\Provider;

class EntityManager
implements \Inject\Syntax\IProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\Provider;
namespace Logic\Provider;

class Repository
implements \Inject\Syntax\IProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\PMod;
namespace PMod;


class CampPMod
{
/**
* @var \eCamp\Entity\Camp
* @var \Entity\Camp
*/
private $camp;


public function __construct(\eCamp\Entity\Camp $camp)
public function __construct(\Entity\Camp $camp)
{
$this->camp = $camp;
}


/**
* @return \eCamp\Entity\Camp
* @return \Entity\Camp
*/
public function Camp()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\PMod;
namespace PMod;


class LoginPMod
{
/**
* @var \eCamp\Entity\Login
* @var \Entity\Login
*/
private $login;


public function __construct(\eCamp\Entity\Login $login)
public function __construct(\Entity\Login $login)
{
$this->login = $login;
}


/**
* @return \eCamp\Entity\Login
* @return \Entity\Login
*/
public function Login()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\PMod;
namespace PMod;

class UserPMod
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@
* along with eCamp. If not, see <http://www.gnu.org/licenses/>.
*/

namespace eCamp\PMod;
namespace PMod;


class UserToCampPMod
{

/**
* @var \eCamp\Entity\UserToCamp
* @var \Entity\UserToCamp
*/
private $userToCamp;


public function __construct(\eCamp\Entity\UserToCamp $userToCamp)
public function __construct(\Entity\UserToCamp $userToCamp)
{
$this->userToCamp = $userToCamp;
}


/**
* @return \eCamp\Entity\User
* @return \Entity\User
*/
public function User()
{
Expand All @@ -55,7 +55,7 @@ public function UserPMod()


/**
* @return \eCamp\Entity\Camp
* @return \Entity\Camp
*/
public function Camp()
{
Expand Down
15 changes: 11 additions & 4 deletions application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ resources.doctrine.orm.defaultEntityManager = default
resources.doctrine.orm.entityManagers.default.connection = default

resources.doctrine.orm.entityManagers.default.proxy.autoGenerateClasses = false
resources.doctrine.orm.entityManagers.default.proxy.namespace = "eCamp\Entity\Proxy"
resources.doctrine.orm.entityManagers.default.proxy.dir = APPLICATION_PATH "/../library/eCamp/Entity/Proxy"
resources.doctrine.orm.entityManagers.default.proxy.namespace = "Entity\Proxy"
resources.doctrine.orm.entityManagers.default.proxy.dir = APPLICATION_PATH "/Entity/Proxy"

resources.doctrine.orm.entityManagers.default.metadataDrivers.0.adapterClass = "Doctrine\ORM\Mapping\Driver\AnnotationDriver"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingNamespace = "eCamp\Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingDirs[] = APPLICATION_PATH "/../library/eCamp/Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingNamespace = "Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingDirs[] = APPLICATION_PATH "/Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderCache = default

Expand Down Expand Up @@ -143,3 +143,10 @@ phpSettings.display_errors = 1
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1




; ==============================================================================
[ForteDev : development]
; ==============================================================================
Loading