Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
seebi committed Jan 31, 2014
2 parents a0bcb68 + 54c83d1 commit 5435e6e
Show file tree
Hide file tree
Showing 206 changed files with 2,463 additions and 26,489 deletions.
25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ZENDVERSION=1.11.5
ZEND2VERSION=2.2.2

default:
@echo "Typical targets your could want to reach:"
Expand Down Expand Up @@ -150,12 +151,23 @@ branch-check:

# libraries

ZENDFILEBASE="ZendFramework-${ZENDVERSION}-minimal"
ZENDURL="https://packages.zendframework.com/releases/ZendFramework-${ZENDVERSION}/${ZENDFILEBASE}.tar.gz"
zend:
rm -rf libraries/Zend
curl -L -# -O https://packages.zendframework.com/releases/ZendFramework-${ZENDVERSION}/ZendFramework-${ZENDVERSION}-minimal.tar.gz || wget https://packages.zendframework.com/releases/ZendFramework-${ZENDVERSION}/ZendFramework-${ZENDVERSION}-minimal.tar.gz
tar xzf ZendFramework-${ZENDVERSION}-minimal.tar.gz
mv ZendFramework-${ZENDVERSION}-minimal/library/Zend libraries
rm -rf ZendFramework-${ZENDVERSION}-minimal.tar.gz ZendFramework-${ZENDVERSION}-minimal
curl -L -# -O ${ZENDURL} || wget ${ZENDURL}
tar xzf ${ZENDFILEBASE}.tar.gz
mv ${ZENDFILEBASE}/library/Zend libraries
rm -rf ${ZENDFILEBASE}.tar.gz ${ZENDFILEBASE}

ZEND2FILEBASE="ZendFramework-minimal-${ZEND2VERSION}"
ZEND2URL="https://packages.zendframework.com/releases/ZendFramework-${ZEND2VERSION}/${ZEND2FILEBASE}.tgz"
zend2:
rm -rf libraries/Zend
curl -L -# -O ${ZEND2URL} || wget ${ZEND2URL}
tar xzf ${ZEND2FILEBASE}.tgz
mv ${ZEND2FILEBASE}/library/Zend libraries
rm -rf ${ZEND2FILEBASE}.tgz ${ZEND2FILEBASE}

rdfauthor:
rm -rf libraries/RDFauthor
Expand Down Expand Up @@ -302,3 +314,8 @@ ifndef MPATH
@echo "Example: MPATH=path/to/the/submodule/"
@exit 1
endif

# other stuff

list-events:
@grep -R "new Erfurt_Event" * 2> /dev/null | sed "s/.*new Erfurt_Event('//;s/');.*//" | sort -u
22 changes: 22 additions & 0 deletions application/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public function _initExtensionManager()
// require Erfurt
$this->bootstrap('Erfurt');

// apply session configuration settings
if (isset($config->session)) {
$this->applySessionConfig($config->session);
}

// require Session
$this->bootstrap('Session');

Expand Down Expand Up @@ -215,6 +220,23 @@ public function _initConfig()
return $config;
}

/**
* apply session config
*
* @param Zend_Config $sessionConfig Session configuration settings
*/
protected function applySessionConfig($sessionConfig)
{
$cookieParams = array(
'lifetime' => isset($sessionConfig->lifetime) ? $sessionConfig->lifetime : 0,
'path' => isset($sessionConfig->path) ? $sessionConfig->path : '/',
'domain' => isset($sessionConfig->domain) ? $sessionConfig->domain : '',
'secure' => isset($sessionConfig->secure) ? (bool) $sessionConfig->secure : false,
'httpOnly' => isset($sessionConfig->httpOnly) ? (bool) $sessionConfig->httpOnly : false
);
call_user_func_array('session_set_cookie_params', $cookieParams);
}

/**
* Initializes the modified Zend_Conroller_Dispatcher to allow for
* pluggable controllers
Expand Down
38 changes: 38 additions & 0 deletions application/classes/OntoWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,44 @@ public function getCache()
}
}

/**
* Returns the system worker frontend object
*
* todo: indicate a missing backend somehow
* todo: be robust against missing pecl stuff
*
* @since 0.9.11
* @return Erfurt_Worker_Frontend
*/
public function getWorkerFrontend()
{
if (null === $this->_workerFrontend) {
$bootstrap = $this->getBootstrap();
$workerFrontend = Erfurt_Worker_Frontend::getInstance();
$workerFrontend->setBackend('gearman');
$workerFrontend->setServers($bootstrap->config->worker->servers);
$this->_workerFrontend = $workerFrontend;
}
return $this->_workerFrontend;
}

/**
* uses the system worker backend to call an async job
*
* todo: log a warning message if worker backend is not available
*
* @param string $jobId The jobs identifier string
* @param mixed $workload The jobs workload (array, object)
*
* @since 0.9.11
* @return null
*/
public function callJob($jobId, $workload = array())
{
$client = $this->getWorkerFrontend();
$client->call($jobId, $workload);
}

/**
* Singleton instance
*
Expand Down
9 changes: 6 additions & 3 deletions application/classes/OntoWiki/Controller/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,12 @@ public function postDispatch()
if ($this->_request->has('redirect-uri')) {
$redirectUri = urldecode($this->_request->getParam('redirect-uri'));
$front = Zend_Controller_Front::getInstance();
$options = array(
'prependBase' => (false === strpos($redirectUri, $front->getBaseUrl()))
);
if ('' !== $front->getBaseUrl()) {
$prependBase = (false === strpos($redirectUri, $front->getBaseUrl()));
} else {
$prependBase = true;
}
$options = array('prependBase' => $prependBase);

$this->_redirect($redirectUri, $options);
}
Expand Down
48 changes: 24 additions & 24 deletions application/classes/OntoWiki/Extension/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,18 +529,18 @@ private function _getModifiedConfigsSince($time)
*/
public function getCachePath()
{
throw new BadMethodCallException(
'Method OntoWiki_Extension_Manager::getCachePath is deprecated. Please use Ontowiki cache'
);
throw new BadMethodCallException(
'Method OntoWiki_Extension_Manager::getCachePath is deprecated. Please use Ontowiki cache'
);
}

/**
* invalidate the cache
*/
public function clearCache()
{
$cache = OntoWiki::getInstance()->getCache();
$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
$cache = OntoWiki::getInstance()->getCache();
$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
}

/**
Expand All @@ -549,25 +549,25 @@ public function clearCache()
*/
private function _scanExtensionPath()
{
$cache = OntoWiki::getInstance()->getCache();
if( !( $config = $cache->load( 'ow_extensionConfig' ) ) ){
$config = array();
$dir = new DirectoryIterator( $this->_extensionPath );
foreach( $dir as $file ){
if( !$file->isDot() && $file->isDir() ){
if( !in_array( $file->getFileName(), $this->reservedNames ) ){
$extensionName = $file->getFileName();
$currentExtensionPath = $file->getPathname() . DIRECTORY_SEPARATOR;
// parse all extensions on the filesystem
if( is_readable( $currentExtensionPath . self::EXTENSION_DEFAULT_DOAP_FILE ) ){
$config[$extensionName] = $this->_loadConfigs( $extensionName );
}
}
}
}
$cache->save( array_reverse( $config ) );
}
$cache = OntoWiki::getInstance()->getCache();
if (!($config = $cache->load('ow_extensionConfig'))) {
$config = array();
$dir = new DirectoryIterator($this->_extensionPath);
foreach ($dir as $file) {
if (!$file->isDot() && $file->isDir()) {
if (!in_array($file->getFileName(), $this->reservedNames)) {
$extensionName = $file->getFileName();
$currentExtensionPath = $file->getPathname() . DIRECTORY_SEPARATOR;
// parse all extensions on the filesystem
if (is_readable($currentExtensionPath . self::EXTENSION_DEFAULT_DOAP_FILE)) {
$config[$extensionName] = $this->_loadConfigs($extensionName);
}
}
}
}
$cache->save(array_reverse($config));
}

$view = OntoWiki::getInstance()->view;
//register the discovered extensions within ontowiki
foreach ($config as $extensionName => $extensionConfig) {
Expand Down
Loading

0 comments on commit 5435e6e

Please sign in to comment.