本文整理汇总了PHP中jApp::popCurrentModule方法的典型用法代码示例。如果您正苦于以下问题:PHP jApp::popCurrentModule方法的具体用法?PHP jApp::popCurrentModule怎么用?PHP jApp::popCurrentModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jApp
的用法示例。
在下文中一共展示了jApp::popCurrentModule方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compile
/**
* Launch the compilation of a template
*
* Store the result (a php content) into a cache file given by the selector.
* @param jSelectorTpl $selector the template selector
* @return boolean true if ok
*/
public function compile($selector)
{
$this->_sourceFile = $selector->getPath();
$this->outputType = $selector->outputType;
$this->trusted = $selector->trusted;
$md5 = md5($selector->module . '_' . $selector->resource . '_' . $this->outputType . ($this->trusted ? '_t' : ''));
jApp::pushCurrentModule($selector->module);
if (!file_exists($this->_sourceFile)) {
$this->doError0('errors.tpl.not.found');
}
$header = "if (jApp::config()->compilation['checkCacheFiletime'] &&\n";
$header .= "filemtime('" . $this->_sourceFile . '\') > ' . filemtime($this->_sourceFile) . "){ return false;\n} else {\n";
$footer = "return true;}\n";
$this->compileString(file_get_contents($this->_sourceFile), $selector->getCompiledFilePath(), $selector->userModifiers, $selector->userFunctions, $md5, $header, $footer);
jApp::popCurrentModule();
return true;
}
示例2: single
function single()
{
$rep = $this->_prepareResponse();
$module = $this->param('mod');
$testname = $this->param('test');
$category = $this->category ? ' ' . $this->category : '';
if (isset($this->testsList[$module])) {
$reporter = jClasses::create($this->responseType);
jClasses::inc('junittests~junittestcase');
jClasses::inc('junittests~junittestcasedb');
$reporter->setResponse($rep);
foreach ($this->testsList[$module] as $test) {
if ($test[1] == $testname) {
$group = new TestSuite('"' . $module . '" module , ' . $test[2]);
$group->addFile(jApp::config()->_modulesPathList[$module] . 'tests/' . $test[0]);
jApp::pushCurrentModule($module);
$result = $group->run($reporter);
if (!$result) {
$rep->setExitCode(jResponseCmdline::EXIT_CODE_ERROR);
}
jApp::popCurrentModule();
break;
}
}
} else {
$this->output("\n" . 'no' . $category . ' tests for "' . $module . '" module.' . "\n");
}
return $this->_finishResponse($rep);
}
示例3: tearDown
protected function tearDown()
{
jApp::popCurrentModule();
}
示例4: parseRecord
protected function parseRecord($xml, $tools)
{
//add the record properties
if (isset($xml->record)) {
if (isset($xml->record[0]['extends'])) {
jApp::pushCurrentModule($this->selector->module);
$this->_userRecord = new jSelectorDaoRecord((string) $xml->record[0]['extends']);
jApp::popCurrentModule();
}
if (isset($xml->record[0]->property)) {
// don't append directly new properties into _properties,
// so we can see the differences between imported properties
// and readed properties
$properties = array();
foreach ($xml->record[0]->property as $prop) {
$p = new jDaoProperty($prop->attributes(), $this, $tools);
if (isset($properties[$p->name])) {
throw new jDaoXmlException($this->selector, 'property.already.defined', $p->name);
}
if (!in_array($p->name, $this->_tables[$p->table]['fields'])) {
// if this property does not redefined an imported property
$this->_tables[$p->table]['fields'][] = $p->name;
}
$properties[$p->name] = $p;
}
$this->_properties = array_merge($this->_properties, $properties);
}
}
// in the case when there is no defined property and no imported dao
if (count($this->_properties) == 0) {
throw new jDaoXmlException($this->selector, 'properties.missing');
}
// check that properties are attached to a known table. It can be
// wrong if the datasource has been redefined with other table names
$countprop = 0;
foreach ($this->_properties as $p) {
if (!isset($this->_tables[$p->table])) {
throw new jDaoXmlException($this->selector, 'property.imported.unknown.table', $p->name);
}
if ($p->ofPrimaryTable && !$p->isPK) {
$countprop++;
}
}
$this->hasOnlyPrimaryKeys = $countprop == 0;
}
示例5: single
function single()
{
$conf = jApp::config();
if (!isset($conf->enableTests) || !$conf->enableTests) {
// security
$rep = $this->getResponse('html', true);
$rep->title = 'Error';
$rep->setHttpStatus('404', 'Not found');
$rep->addContent('<p>404 Not Found</p>');
return $rep;
}
$rep = $this->_prepareResponse();
$module = $this->param('mod');
$testname = $this->param('test');
if (isset($this->testsList[$module])) {
$reporter = jClasses::create("junittests~jhtmlrespreporter");
jClasses::inc('junittests~junittestcase');
jClasses::inc('junittests~junittestcasedb');
$reporter->setResponse($rep);
foreach ($this->testsList[$module] as $test) {
if ($test[1] == $testname) {
$group = new TestSuite('"' . $module . '" module , ' . $test[2]);
$group->addFile($conf->_modulesPathList[$module] . 'tests/' . $test[0]);
jApp::pushCurrentModule($module);
$group->run($reporter);
jApp::popCurrentModule();
break;
}
}
} else {
$rep->body->assign('MAIN', '<p>no tests for "' . $module . '" module.</p>');
}
return $this->_finishResponse($rep);
}
示例6: process
/**
* main method : launch the execution of the action.
*
* This method should be called in a entry point.
*
* @param jRequest $request the request object. It is required if a descendant of jCoordinator did not called setRequest before
*/
public function process($request = null)
{
try {
if ($request) {
$this->setRequest($request);
}
jSession::start();
$ctrl = $this->getController($this->action);
} catch (jException $e) {
$config = jApp::config();
if ($config->urlengine['notfoundAct'] == '') {
throw $e;
}
if (!jSession::isStarted()) {
jSession::start();
}
try {
$this->action = new jSelectorAct($config->urlengine['notfoundAct']);
$ctrl = $this->getController($this->action);
} catch (jException $e2) {
throw $e;
}
}
jApp::pushCurrentModule($this->moduleName);
if (count($this->plugins)) {
$pluginparams = array();
if (isset($ctrl->pluginParams['*'])) {
$pluginparams = $ctrl->pluginParams['*'];
}
if (isset($ctrl->pluginParams[$this->action->method])) {
$pluginparams = array_merge($pluginparams, $ctrl->pluginParams[$this->action->method]);
}
foreach ($this->plugins as $name => $obj) {
$result = $this->plugins[$name]->beforeAction($pluginparams);
if ($result) {
$this->action = $result;
jApp::popCurrentModule();
jApp::pushCurrentModule($result->module);
$this->moduleName = $result->module;
$this->actionName = $result->resource;
$ctrl = $this->getController($this->action);
break;
}
}
}
$this->response = $ctrl->{$this->action->method}();
if ($this->response == null) {
throw new jException('jelix~errors.response.missing', $this->action->toString());
}
foreach ($this->plugins as $name => $obj) {
$this->plugins[$name]->beforeOutput();
}
$this->response->output();
foreach ($this->plugins as $name => $obj) {
$this->plugins[$name]->afterProcess();
}
jApp::popCurrentModule();
jSession::end();
}
示例7: _callZone
/**
* instancy a zone object, and call one of its methods
* @param string $name zone selector
* @param string $method method name
* @param array $params arguments for the method
* @return mixed the result returned by the method
*/
private static function _callZone($name, $method, &$params)
{
$sel = new jSelectorZone($name);
jApp::pushCurrentModule($sel->module);
$fileName = $sel->getPath();
require_once $fileName;
$className = $sel->resource . 'Zone';
$zone = new $className($params);
$toReturn = $zone->{$method}();
jApp::popCurrentModule();
return $toReturn;
}