public function testGetAppsParent() { $mvc = plug('controller'); $mvc->setApp('testApp'); $mvc->plugApp([$this->resources . 'apps1']); $this->assertEquals(realpath($this->resources) . '/', \PMVC\getAppsParent()); }
public function onMapRequest($subject) { $subject->detach($this); $c = \PMVC\plug('controller'); if ($this[\PMVC\NAME] === $c->getApp()) { return false; } if (empty($this['dimensionUrl'])) { $this['dimensionUrl'] = \PMVC\getOption('dimensionUrl'); if (empty($this['dimensionUrl'])) { return false; } } $this['dimensionQuery']['SITE'] = basename(\PMVC\getAppsParent()); $this['dimensionQuery']['APP'] = $c->getApp(); $this['dimensionQuery']['ACTION'] = $c->getAppAction(); $entry = explode('.', \PMVC\plug('url')->getRunPhp()); $this['dimensionQuery']['ENTRY'] = $entry[0]; if (isset($this['getDimension'])) { call_user_func_array($this['getDimension'], [&$this['dimensionQuery'], $c->getRequest()]); } $this->getDimension(); return true; }