Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
New basic skeleton modules
Browse files Browse the repository at this point in the history
- Restore
- Statistics
- User
- composer.phar update
  • Loading branch information
fbergkemper committed Jan 9, 2014
1 parent 69ee72a commit da6f986
Show file tree
Hide file tree
Showing 24 changed files with 394 additions and 30 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified composer.phar
Binary file not shown.
6 changes: 3 additions & 3 deletions config/application.config.php
Expand Up @@ -15,10 +15,10 @@
'Job',
'File',
'Log',
//'Restore',
//'Statistics',
'Restore',
'Statistics',
'Admin',
//'User',
'User',
);

if($env == 'development') {
Expand Down
6 changes: 0 additions & 6 deletions module/Application/config/module.config.php
Expand Up @@ -157,17 +157,14 @@
'label' => 'Job',
'route' => 'job',
),
/*
array(
'label' => 'File',
'route' => 'file',
),
*/
array(
'label' => 'Log',
'route' => 'log',
),
/*
array(
'label' => 'Restore',
'route' => 'restore',
Expand All @@ -176,17 +173,14 @@
'label' => 'Statistics',
'route' => 'statistics',
),
*/
array(
'label' => 'Administration',
'route' => 'admin',
),
/*
array(
'label' => 'User',
'route' => 'user',
),
*/
),
),
);
Expand Down
33 changes: 25 additions & 8 deletions module/Restore/Module.php
Expand Up @@ -7,13 +7,8 @@
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;

class Module {

public function getServiceConfig()
{
return array(
);
}
class Module
{

public function getAutoloaderConfig()
{
Expand All @@ -22,7 +17,7 @@ public function getAutoloaderConfig()
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespace' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
Expand All @@ -34,4 +29,26 @@ public function getConfig()
return include __DIR__ . '/config/module.config.php';
}

public function getServiceConfig()
{
return array(
'factories' => array(
'Restore\Model\RestoreTable' => function($sm)
{
$tableGateway = $sm->get('RestoreTableGateway');
$table = new RestoreTable($tableGateway);
return $table;
},
'RestoreTableGateway' => function($sm)
{
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Restore());
return new TableGateway('restore', $dbAdapter, null, $resultSetPrototype);
},
),
);
}

}

4 changes: 2 additions & 2 deletions module/Restore/config/module.config.php
Expand Up @@ -7,7 +7,7 @@
'Restore\Controller\Restore' => 'Restore\Controller\RestoreController',
),
),

'router' => array(
'routes' => array(
'restore' => array(
Expand All @@ -26,7 +26,7 @@
),
),
),

'view_manager' => array(
'template_path_stack' => array(
'restore' => __DIR__ . '/../view',
Expand Down
5 changes: 3 additions & 2 deletions module/Restore/src/Restore/Controller/RestoreController.php
Expand Up @@ -7,10 +7,11 @@

class RestoreController extends AbstractActionController
{

public function indexAction()
public function indexAction()
{
return new ViewModel();
}

}

10 changes: 10 additions & 0 deletions module/Restore/src/Restore/Model/Restore.php
@@ -0,0 +1,10 @@
<?php

namespace Restore\Model;

class Restore
{



}
28 changes: 28 additions & 0 deletions module/Restore/src/Restore/Model/RestoreTable.php
@@ -0,0 +1,28 @@
<?php

namespace Restore\Model;

//use Zend\Db\TableGateway\TableGateway;

class RestoreTable
{
// protected $tableGateway;
/*
public function __construct(TableGateway $tableGateway)
{
$this->tableGateway = $tableGateway;
}
public function fetchAll()
{
$resultSet = $this->tableGateway->select();
return $resultSet;
}
*/

public function __construct()
{
}

}

8 changes: 3 additions & 5 deletions module/Restore/view/restore/restore/index.phtml
@@ -1,11 +1,9 @@
<?php

$title = 'Restore';
$this->headTitle($title);

$title = 'Restore';
$this->headTitle($title);
?>

<h2><?php echo $this->translate($title); ?></h2>
<h2><?php echo $title; ?></h2>
<hr />


54 changes: 54 additions & 0 deletions module/Statistics/Module.php
@@ -0,0 +1,54 @@
<?php

namespace Statistics;

use Statistics\Model\Statistics;
use Statistics\Model\StatisticsTable;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;

class Module
{

public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}

public function getServiceConfig()
{
return array(
'factories' => array(
'Statistics\Model\StatisticsTable' => function($sm)
{
$tableGateway = $sm->get('StatisticsTableGateway');
$table = new StatisticsTable($tableGateway);
return $table;
},
'StatisticsTableGateway' => function($sm)
{
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Statistics());
return new TableGateway('statistics', $dbAdapter, null, $resultSetPrototype);
},
),
);
}

}

4 changes: 4 additions & 0 deletions module/Statistics/autoload_classmap.php
@@ -0,0 +1,4 @@
<?php

return array();

36 changes: 36 additions & 0 deletions module/Statistics/config/module.config.php
@@ -0,0 +1,36 @@
<?php

return array(

'controllers' => array(
'invokables' => array(
'Statistics\Controller\Statistics' => 'Statistics\Controller\StatisticsController',
),
),

'router' => array(
'routes' => array(
'statistics' => array(
'type' => 'segment',
'options' => array(
'route' => '/statistics[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Statistics\Controller\Statistics',
'action' => 'index',
),
),
),
),
),

'view_manager' => array(
'template_path_stack' => array(
'statistics' => __DIR__ . '/../view',
),
),

);
@@ -0,0 +1,17 @@
<?php

namespace Statistics\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

class StatisticsController extends AbstractActionController
{

public function indexAction()
{
return new ViewModel();
}

}

10 changes: 10 additions & 0 deletions module/Statistics/src/Statistics/Model/Statistics.php
@@ -0,0 +1,10 @@
<?php

namespace Statistics\Model;

class Statistics
{



}
28 changes: 28 additions & 0 deletions module/Statistics/src/Statistics/Model/StatisticsTable.php
@@ -0,0 +1,28 @@
<?php

namespace Statistics\Model;

//use Zend\Db\TableGateway\TableGateway;

class StatisticsTable
{
// protected $tableGateway;
/*
public function __construct(TableGateway $tableGateway)
{
$this->tableGateway = $tableGateway;
}
public function fetchAll()
{
$resultSet = $this->tableGateway->select();
return $resultSet;
}
*/

public function __construct()
{
}

}

9 changes: 9 additions & 0 deletions module/Statistics/view/statistics/statistics/index.phtml
@@ -0,0 +1,9 @@
<?php
$title = 'Statistics';
$this->headTitle($title);
?>

<h2><?php echo $title; ?></h2>
<hr />


0 comments on commit da6f986

Please sign in to comment.