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

Revert changing config variables ($srfg to $wgSrfg) #848

Open
wants to merge 7 commits into
base: master
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
16 changes: 8 additions & 8 deletions formats/array/SRF_Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ protected function initializeCfgValue( $dfltVal, $dfltCacheKey ) {
if ( $cache === null ) {
// cache can't be initialized, propably function-reference in userconfig
// but format is not used in inline context, use fallback in this case:
global $wgSrfgArraySepTextualFallbacks;
$cache = $wgSrfgArraySepTextualFallbacks[$dfltCacheKey];
global $srfgArraySepTextualFallbacks;
$cache = $srfgArraySepTextualFallbacks[$dfltCacheKey];
}
}
return $cache;
Expand Down Expand Up @@ -439,32 +439,32 @@ public function getParamDefinitions( array $definitions ) {
];

// separators (default values are defined in the following globals:)
global $wgSrfgArraySep, $wgSrfgArrayPropSep, $wgSrfgArrayManySep, $wgSrfgArrayRecordSep, $wgSrfgArrayHeaderSep;
global $srfgArraySep, $srfgArrayPropSep, $srfgArrayManySep, $srfgArrayRecordSep, $srfgArrayHeaderSep;

$params['sep'] = [
'message' => 'smw-paramdesc-sep',
'default' => $this->initializeCfgValue( $wgSrfgArraySep, 'sep' ),
'default' => $this->initializeCfgValue( $srfgArraySep, 'sep' ),
];

$params['propsep'] = [
'message' => 'srf_paramdesc_propsep',
'default' => $this->initializeCfgValue( $wgSrfgArrayPropSep, 'propsep' ),
'default' => $this->initializeCfgValue( $srfgArrayPropSep, 'propsep' ),
];

$params['manysep'] = [
'message' => 'srf_paramdesc_manysep',
'default' => $this->initializeCfgValue( $wgSrfgArrayManySep, 'manysep' ),
'default' => $this->initializeCfgValue( $srfgArrayManySep, 'manysep' ),
];

$params['recordsep'] = [
'message' => 'srf_paramdesc_recordsep',
'default' => $this->initializeCfgValue( $wgSrfgArrayRecordSep, 'recordsep' ),
'default' => $this->initializeCfgValue( $srfgArrayRecordSep, 'recordsep' ),
'aliases' => [ 'narysep', 'rcrdsep', 'recsep' ],
];

$params['headersep'] = [
'message' => 'srf_paramdesc_headersep',
'default' => $this->initializeCfgValue( $wgSrfgArrayHeaderSep, 'headersep' ),
'default' => $this->initializeCfgValue( $srfgArrayHeaderSep, 'headersep' ),
'aliases' => [ 'narysep', 'rcrdsep', 'recsep' ],
];

Expand Down
20 changes: 10 additions & 10 deletions formats/calendar/SRF_Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ public function formatDateStr( $object ) {
}

public function displayCalendar( $events ) {
global $wgSrfgFirstDayOfWeek;
global $wgSrfgScriptPath;
global $srfgFirstDayOfWeek;
global $srfgScriptPath;

$context = RequestContext::getMain();
$request = $context->getRequest();
Expand All @@ -332,7 +332,7 @@ public function displayCalendar( $events ) {
'rel' => 'stylesheet',
'type' => 'text/css',
'media' => 'screen, print',
'href' => $wgSrfgScriptPath
'href' => $srfgScriptPath
. '/formats/calendar/resources/ext.srf.calendar.css'
]
);
Expand Down Expand Up @@ -385,16 +385,16 @@ public function displayCalendar( $events ) {
6 => wfMessage( 'friday' )->text(),
7 => wfMessage( 'saturday' )->text()
];
if ( empty( $wgSrfgFirstDayOfWeek ) ) {
if ( empty( $srfgFirstDayOfWeek ) ) {
$firstDayOfWeek = 1;
$lastDayOfWeek = 7;
} else {
$firstDayOfWeek =
array_search( $wgSrfgFirstDayOfWeek, $weekDayNames );
array_search( $srfgFirstDayOfWeek, $weekDayNames );
if ( $firstDayOfWeek === false ) {
// Bad value for $wgSrfgFirstDayOfWeek!
print 'Warning: Bad value for $wgSrfgFirstDayOfWeek "' .
'(' . $wgSrfgFirstDayOfWeek . '")';
// Bad value for $srfgFirstDayOfWeek!
print 'Warning: Bad value for $srfgFirstDayOfWeek "' .
'(' . $srfgFirstDayOfWeek . '")';
$firstDayOfWeek = 1;
}
if ( $firstDayOfWeek == 1 ) {
Expand Down Expand Up @@ -516,10 +516,10 @@ public function displayCalendar( $events ) {
<table class="navigation_table">
<tr><td class="month_name">$curMonth $curYear</td>
<td class="nav_links"><a href="$prevMonthUrl" title="$prevMonthText">
<img src="{$wgSrfgScriptPath}/formats/calendar/resources/images/left-arrow.png" border="0" />
<img src="{$srfgScriptPath}/formats/calendar/resources/images/left-arrow.png" border="0" />
</a>&#160;<a href="$todayUrl">$todayText</a>&#160;
<a href="$nextMonthUrl" title="$nextMonthText">
<img src="{$wgSrfgScriptPath}/formats/calendar/resources/images/right-arrow.png" border="0" />
<img src="{$srfgScriptPath}/formats/calendar/resources/images/right-arrow.png" border="0" />
</a></td><td class="nav_form"><form>
<input type="hidden" name="title" value="$pageName">
<select name="month">
Expand Down
38 changes: 19 additions & 19 deletions formats/graphviz/SRF_Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

// global variable defining picture path

$wgSrfgPicturePath = "formats/graphviz/images/";
$srfgPicturePath = "formats/graphviz/images/";

class SRFProcess extends SMWResultPrinter {

Expand Down Expand Up @@ -957,7 +957,7 @@ public function setAtomic( $atomic ) {
}

public function getGraphVizCode() {
global $wgIP, $wgSrfgPicturePath, $wgSrfgIP;
global $wgIP, $srfgPicturePath, $srfgIP;
//
// show node status
//
Expand All @@ -966,10 +966,10 @@ public function getGraphVizCode() {

if ( file_exists( $wgIP . "/images/p000.png" ) ) {
$PicturePath = $wgIP . "/images/";
} elseif ( file_exists( $wgSrfgIP . "/formats/graphviz/images/p000.png" ) ) {
$PicturePath = $wgSrfgIP . "/formats/graphviz/images/";
} elseif ( file_exists( $srfgIP . "/formats/graphviz/images/p000.png" ) ) {
$PicturePath = $srfgIP . "/formats/graphviz/images/";
} else {
$PicturePath = $wgIP . $wgSrfgPicturePath;
$PicturePath = $wgIP . $srfgPicturePath;
}
// $color = 'grey' . $this->getStatus();
// $color = 'grey' . rand(1, 100);
Expand Down Expand Up @@ -1003,10 +1003,10 @@ public function getGraphVizCode() {

if ( file_exists( $wgIP . "/images/discuss_icon.png" ) ) {
$PicturePath = $wgIP . "/images/";
} elseif ( file_exists( $wgSrfgIP . "/formats/graphviz/images/discuss_icon.png" ) ) {
$PicturePath = $wgSrfgIP . "/formats/graphviz/images/";
} elseif ( file_exists( $srfgIP . "/formats/graphviz/images/discuss_icon.png" ) ) {
$PicturePath = $srfgIP . "/formats/graphviz/images/";
} else {
$PicturePath = $wgIP . $wgSrfgPicturePath;
$PicturePath = $wgIP . $srfgPicturePath;
}
$discussionTitle = Title::newFromText( 'Talk:' . $this->getId() . '' );
if ( $discussionTitle->isKnown() ) {
Expand All @@ -1030,10 +1030,10 @@ public function getGraphVizCode() {
if ( $this->getProcess()->getShowCompound() ) {
if ( file_exists( $wgIP . "/images/subprocess.png" ) ) {
$PicturePath = $wgIP . "/images/";
} elseif ( file_exists( $wgSrfgIP . "/formats/graphviz/images/subprocess.png" ) ) {
$PicturePath = $wgSrfgIP . "/formats/graphviz/images/";
} elseif ( file_exists( $srfgIP . "/formats/graphviz/images/subprocess.png" ) ) {
$PicturePath = $srfgIP . "/formats/graphviz/images/";
} else {
$PicturePath = $wgIP . $wgSrfgPicturePath;
$PicturePath = $wgIP . $srfgPicturePath;
}
if ( !$this->isAtomic() ) {
$compound = '<TR><TD ALIGN="LEFT" BORDER="0" WIDTH="20px" HREF="[[' . $this->getId(
Expand Down Expand Up @@ -1267,11 +1267,11 @@ public function getGraphVizCode() {
class SplitExclusiveOrEdge extends SplitEdge {

public function getGraphVizCode() {
global $wgSrfgShapeStyle;
global $srfgShapeStyle;
$p = $this->getPred();
$p = $p[0];
if ( $wgSrfgShapeStyle == '' ) {
$wgSrfgShapeStyle = "box";
if ( $srfgShapeStyle == '' ) {
$srfgShapeStyle = "box";
}
$res =
'subgraph "clus_' . $this->getId() . '" {
Expand All @@ -1280,7 +1280,7 @@ public function getGraphVizCode() {
// add OR-Shape
$orx = 'or' . rand( 1, 99999 );
$res .=
'"' . $orx . '"[shape=' . $wgSrfgShapeStyle . ',label="+",style=filled,color=gold];
'"' . $orx . '"[shape=' . $srfgShapeStyle . ',label="+",style=filled,color=gold];
"' . $p->getId() . '":port1:s -> "' . $orx . '";
';

Expand All @@ -1306,9 +1306,9 @@ public function getGraphVizCode() {
class SplitParallelEdge extends SplitEdge {

public function getGraphVizCode() {
global $wgSrfgShapeStyle;
if ( $wgSrfgShapeStyle == '' ) {
$wgSrfgShapeStyle = "box";
global $srfgShapeStyle;
if ( $srfgShapeStyle == '' ) {
$srfgShapeStyle = "box";
}
$p = $this->getPred();
$p = $p[0];
Expand All @@ -1320,7 +1320,7 @@ public function getGraphVizCode() {
// add AND-Shape
$and = 'and' . rand( 1, 99999 );
$res .=
'"' . $and . '"[shape=' . $wgSrfgShapeStyle . ',label="||",style=filled,color=palegreen];
'"' . $and . '"[shape=' . $srfgShapeStyle . ',label="||",style=filled,color=palegreen];
"' . $p->getId() . '":port1:s -> "' . $and . '";
';

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/Integration/ResourcesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class ResourcesTest extends \PHPUnit\Framework\TestCase {
* @return array
*/
private function getSRFResourceModules() {
global $wgSrfgIP;
return include $wgSrfgIP . '/' . 'Resources.php';
global $srfgIP;
return include $srfgIP . '/' . 'Resources.php';
}

public function moduleDataProvider() {
Expand Down
Loading