Browse Source

Use nsPrefix and use it consistantly

nsITobin 4 months ago
parent
commit
7c55268e97
4 changed files with 209 additions and 208 deletions
  1. 201 201
      base/src/utils.php
  2. 1 1
      components/site/src/main.php
  3. 2 1
      index.php
  4. 5 5
      modules/nsGenerateContent.php

File diff suppressed because it is too large
+ 201 - 201
base/src/utils.php


+ 1 - 1
components/site/src/main.php

@@ -11,7 +11,7 @@ gSetConfig('console.ui.siteName', 'SeaMonkey Add-ons');
 gImportModules('generateContent');
 
 // Try and load static content based on the url
-gMtzRuntime::$sModule['generateContent']->LoadStaticContent();
+nsRuntime::$sModule['generateContent']->LoadStaticContent();
 
 // ====================================================================================================================
 

+ 2 - 1
index.php

@@ -9,6 +9,7 @@
 // With the addition of gPath() from the utils will normalize all paths making cross-platform possible without much
 // trouble.
 define('kRootPath', empty($_SERVER['DOCUMENT_ROOT']) ? __DIR__ : $_SERVER['DOCUMENT_ROOT']);
+
 const kDebugDomain = 'addons.thereisonlyxul.org';
 const kAppVendor = 'Binary Outcast';
 const kAppName = 'Neptune Add-ons and Package Infrastructure';
@@ -16,7 +17,7 @@ const kAppVersion = '1.0.0a1';
 
 // Load fundamental utils
 require_once(kRootPath . '/base/src/utils.php');
-print('hi');
+
 // ====================================================================================================================
 
 ?>

+ 5 - 5
modules/mtzGenerateContent.php → modules/nsGenerateContent.php

@@ -1,5 +1,5 @@
 <?php
-class mtzGenerateContent {
+class nsGenerateContent {
   
   // Resource path normally same as component
   private $resPath;
@@ -80,9 +80,9 @@ class mtzGenerateContent {
       'SOFTWARE_NAME' => kEmptyString,
       'SOFTWARE_VERSION' => kEmptyString,
       'SOFTWARE_DEBUG' => kEmptyString,
-      'CONTENT_PATH' => gMtzUtils::StripStr($this->contentPath, kRootPath) . kSlash . gGetConfig('network.requestPath'),
+      'CONTENT_PATH' => nsUtils::StripStr($this->contentPath, kRootPath) . kSlash . gGetConfig('network.requestPath'),
       'BASE_SKIN_PATH' => kDefaultSkinPath,
-      'COMPONENT_SKIN_PATH' => gMtzUtils::StripStr($this->skinPath, kRootPath),
+      'COMPONENT_SKIN_PATH' => nsUtils::StripStr($this->skinPath, kRootPath),
       'SITE_NAME' => gGetConfig('console.ui.siteName', kAppName),
       'SITE_MENU' => kEmptyString,
       'SITE_SECTION' => gGetConfig('app.path.0', kEmptyString),
@@ -100,7 +100,7 @@ class mtzGenerateContent {
       'CACHE_EPOCH' => time(),
     );
 
-    $this->finalOutput = gMtzUtils::SubstEx($this->template, $substs, kLeftBrace . kDollar);
+    $this->finalOutput = nsUtils::SubstEx($this->template, $substs, kLeftBrace . kDollar);
 
     gSetConfig('console.output.responseBody', $this->finalOutput);
     gOutput(true, 'html');
@@ -111,7 +111,7 @@ class mtzGenerateContent {
   ********************************************************************************************************************/
   private function _ParseYaml($aContent) {
     return ['data'    => gEnsureValue(@yaml_parse($aContent)),
-            'content' => preg_replace(gMtzUtils::REGEX_PATTERNS['yaml'], kEmptyString, $aContent)];
+            'content' => preg_replace(nsUtils::REGEX_PATTERNS['yaml'], kEmptyString, $aContent)];
   }
 
   /********************************************************************************************************************

Some files were not shown because too many files changed in this diff