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

Replace Zend\Autoload with Composer #164

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions composer.json
Expand Up @@ -9,5 +9,34 @@
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.*",
"zendframework/zendservice-recaptcha": "2.0.*"
},
"autoload": {
"psr-4": {
"Api\\": "./module/Api",
"Application\\": "./module/Application/src/Application",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about "Application\": "./module/Application/src/" ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm I'm working in PSR-4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as psr-4, we don't need too deep folder imo

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this step I keep same folding :)
maybe module/Application/src/Application in my opinion is a standard ZF module folder now

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the dots? i think all can go away? 👴

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps that module folder has to go and give way to just src

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes yes :) would you send me a PR?

2015-02-21 19:50 GMT+01:00 Luis Cordova notifications@github.com:

In composer.json
#164 (comment):

@@ -9,5 +9,34 @@
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.",
"zendframework/zendservice-recaptcha": "2.0.
"

  • },
  • "autoload": {
  •    "psr-4": {
    
  •        "Api\": "./module/Api",
    
  •        "Application\": "./module/Application/src/Application",
    

why the dots? i think all can go away? [image: 👴]


Reply to this email directly or view it on GitHub
https://github.com/zendframework/zf-web/pull/164/files#r25124488.

Gianluca Arbezzano
www.gianarb.it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will send a PR if at least @Ocramius or some other maintainer gives me green light

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"Archives\\": "./module/Archives/src/Archives",
"Changelog\\": "./module/Changelog/src/Changelog",
"Downloads\\": "./module/Downloads/src/Downloads",
"Issues\\": "./module/Issues/src/Issues",
"Manual\\": "./module/Manual/src/Manual",
"PageController\\": "./module/PageController/src/PageController",
"Search\\": "./module/Search/src/Search",
"Security\\": "./module/Security/src/Security",
"Sitemap\\": "./module/Sitemap/src/Sitemap",
"ZfSiteBlog\\": "./module/ZfSiteBlog/src/ZfSiteBlog"
},
"classmap": [
"./module/Application/Module.php",
"./module/Archives/Module.php",
"./module/Changelog/Module.php",
"./module/Downloads/Module.php",
"./module/Issues/Module.php",
"./module/Manual/Module.php",
"./module/PageController/Module.php",
"./module/Search/Module.php",
"./module/Security/Module.php",
"./module/Sitemap/Module.php",
"./module/ZfSiteBlog/Module.php"
]
}
}
23 changes: 0 additions & 23 deletions init_autoloader.php

This file was deleted.

7 changes: 0 additions & 7 deletions module/Api/Module.php
Expand Up @@ -11,13 +11,6 @@ public function getConfig()
return include __DIR__ . '/config/module.config.php';
}

public function getAutoloaderConfig()
{
return array('Zend\Loader\StandardAutoloader' => array(
'namespaces' => array('Api' => __DIR__),
));
}

public function onBootstrap($e)
{
$app = $e->getTarget();
Expand Down
11 changes: 0 additions & 11 deletions module/Application/Module.php
Expand Up @@ -25,17 +25,6 @@ public function getConfig()
return include __DIR__ . '/config/module.config.php';
}

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

public function getControllerConfig()
{
return array('factories' => array(
Expand Down
9 changes: 0 additions & 9 deletions module/Archives/Module.php
Expand Up @@ -3,15 +3,6 @@

class Module
{
public function getAutoloaderConfig()
{
return array('Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
'Archives' => __DIR__ . '/src/Archives',
),
));
}

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
13 changes: 1 addition & 12 deletions module/Changelog/Module.php
Expand Up @@ -11,17 +11,6 @@

class Module implements ConsoleUsageProviderInterface
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
)
)
);
}

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down Expand Up @@ -65,7 +54,7 @@ public function getServiceConfig()

$client = $services->get('Changelog\XmlRpc\Client');
$auth = $client->login(
$jiraCredentials['username'],
$jiraCredentials['username'],
$jiraCredentials['password']
);
return $auth;
Expand Down
11 changes: 0 additions & 11 deletions module/Downloads/Module.php
Expand Up @@ -6,17 +6,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
7 changes: 0 additions & 7 deletions module/Issues/Module.php
Expand Up @@ -4,13 +4,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
11 changes: 0 additions & 11 deletions module/Manual/Module.php
Expand Up @@ -4,17 +4,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
11 changes: 0 additions & 11 deletions module/PageController/Module.php
Expand Up @@ -4,17 +4,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
15 changes: 3 additions & 12 deletions module/Search/Module.php
Expand Up @@ -7,15 +7,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down Expand Up @@ -46,12 +37,12 @@ public function getServiceConfig()
));
}

$queryOptions = isset($config['query_options']) && is_array($config['query_options'])
? $config['query_options']
$queryOptions = isset($config['query_options']) && is_array($config['query_options'])
? $config['query_options']
: array();

$httpClientService = isset($config['http_client_service']) && is_string($config['http_client_service'])
? $config['http_client_service']
? $config['http_client_service']
: false;
if ($httpClientService && $services->has($httpClientService)) {
$httpClient = $services->get($httpClientService);
Expand Down
9 changes: 0 additions & 9 deletions module/Security/Module.php
Expand Up @@ -4,15 +4,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
11 changes: 0 additions & 11 deletions module/Sitemap/Module.php
Expand Up @@ -4,17 +4,6 @@

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
11 changes: 0 additions & 11 deletions module/ZfSiteBlog/Module.php
Expand Up @@ -19,17 +19,6 @@ class Module
protected static $layout;
protected $config;

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

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Expand Up @@ -14,7 +14,7 @@
include 'rewrites.php';

// Setup autoloading
include 'init_autoloader.php';
include 'vendor/autoload.php';

// Run the application!
Zend\Mvc\Application::init(include 'config/application.config.php')->run();