Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to zf3 functionality #7

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
17 changes: 0 additions & 17 deletions Module.php

This file was deleted.

13 changes: 0 additions & 13 deletions autoload_classmap.php

This file was deleted.

12 changes: 0 additions & 12 deletions autoload_function.php

This file was deleted.

2 changes: 0 additions & 2 deletions autoload_register.php

This file was deleted.

15 changes: 6 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
],
"require": {
"php": ">=5.3.0"
},
"minimum-stability" : "stable",
"autoload": {
"psr-0": {
"TccAbstractModule": "src/"
},
"classmap": [
"./Module.php"
]
},
"minimum-stability" : "stable",
"autoload": {
"psr-4": {
"TccAbstractModule\\": "src/TccAbstractModule/"
}
}
}
4 changes: 0 additions & 4 deletions src/TccAbstractModule/Module/AbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

namespace TccAbstractModule\Module;

use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ControllerProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\ModuleManager\Feature\ViewHelperProviderInterface;

abstract class AbstractModule implements
AutoloaderProviderInterface,
ConfigProviderInterface,
ControllerProviderInterface,
ServiceProviderInterface,
ViewHelperProviderInterface
{
use \TccAbstractModule\ModuleManager\Feature\ClassDirTrait;
use \TccAbstractModule\ModuleManager\Feature\ClassNamespaceTrait;
use \TccAbstractModule\ModuleManager\Feature\AutoloaderProviderDefaultTrait;
use \TccAbstractModule\ModuleManager\Feature\ConfigProviderTrait;
use \TccAbstractModule\ModuleManager\Feature\ControllerConfigProviderTrait;
use \TccAbstractModule\ModuleManager\Feature\ServiceConfigProviderTrait;
Expand Down
43 changes: 1 addition & 42 deletions src/TccAbstractModule/Module/AbstractModuleNoTraits.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Zend\Stdlib\ArrayUtils;

abstract class AbstractModuleNoTraits implements
AutoloaderProviderInterface,
ConfigProviderInterface,
ControllerProviderInterface,
ServiceProviderInterface,
Expand All @@ -35,34 +34,6 @@ abstract class AbstractModuleNoTraits implements
*/
protected $relativeModuleDir = '';

/**
* Return an array to configure a default autoloader instance.
*
* @return array
*/
public function getAutoloaderConfig()
{
$autoloaderArray = array();

// If this module has a defined classmap, add a classmap autoloader.
$classmapPath = $this->getDir() . '/' . $this->relativeModuleDir . 'autoload_classmap.php';
if (file_exists($classmapPath)) {
$autoloaderArray['Zend\Loader\ClassMapAutoloader'] = array(
$classmapPath
);
}

// Fallback to a PSR-0 autoloader.
$autoloaderArray['Zend\Loader\StandardAutoloader'] = array(
'namespaces' => array(
$this->getNamespace() =>
$this->getDir() . '/' . $this->relativeModuleDir . 'src/' . $this->getNamespace(),
),
);

return $autoloaderArray;
}

/**
* Return and merge configuration for this module from the default location of ./config/module.config{,.*}php.
*
Expand Down Expand Up @@ -167,18 +138,6 @@ public function getViewHelperConfig()
protected function getDir()
{
$reflectionClass = new \ReflectionClass(get_class($this));
return dirname($reflectionClass->getFileName());
}

/**
* Because __NAMESPACE__ in a child class returns the namespace for the parent class, this workaround is required
* to get the namespace of the child class.
*
* @returns string
*/
protected function getNamespace()
{
$reflectionClass = new \ReflectionClass(get_class($this));
return dirname($reflectionClass->getNamespaceName());
return dirname($reflectionClass->getFileName()) . '/..';
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ trait ClassDirTrait
*/
protected function getDir()
{
return dirname((new \ReflectionClass(get_class($this)))->getFileName());
return dirname((new \ReflectionClass(get_class($this)))->getFileName()) . '/..';
}
}