Completed
Push — master ( 016764...50d24f )
by judicael
04:08
created
bundles/lib/Typescript.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
  */
31 31
 class Typescript
32 32
 {
33
-    /**
34
-     * @var string
35
-     */
36
-    const TYPESCRIPT_WINDOWS = TYPESCRIPT_WINDOWS;
33
+	/**
34
+	 * @var string
35
+	 */
36
+	const TYPESCRIPT_WINDOWS = TYPESCRIPT_WINDOWS;
37 37
     
38 38
 	/**
39 39
 	 * translate the content
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public static function toJs(string $sFile) : string
46 46
 	{
47
-	    $aFile = pathinfo($sFile);
48
-	    $sFolder = uniqid();
47
+		$aFile = pathinfo($sFile);
48
+		$sFolder = uniqid();
49 49
 	    
50
-	    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
50
+		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
51 51
 	        
52
-	        $sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/';
53
-            $sContent = shell_exec($sCmd);
54
-	    }
55
-	    else {
52
+			$sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/';
53
+			$sContent = shell_exec($sCmd);
54
+		}
55
+		else {
56 56
 	       
57
-	        $sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/';
58
-            $sContent = shell_exec($sCmd);
59
-	    }
57
+			$sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/';
58
+			$sContent = shell_exec($sCmd);
59
+		}
60 60
 	    
61
-        header("content-type:text/javascript");
62
-        return file_get_contents(__DIR__.'../../'.CACHE_DIR.$sFolder.'/'.$aFile['filename'].'.js');
61
+		header("content-type:text/javascript");
62
+		return file_get_contents(__DIR__.'../../'.CACHE_DIR.$sFolder.'/'.$aFile['filename'].'.js');
63 63
 	}
64 64
 }
Please login to merge, or discard this patch.
bundles/src/plugins/common/Controller.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,20 +46,20 @@
 block discarded – undo
46 46
 		
47 47
 		$this->installDb = function()
48 48
 		{
49
-		    $oDb = Config::get('Db');
50
-		    $oTables = json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.preg_replace('/^.*\\\\([a-zA-Z0-9]+)$/', '$1', get_called_class()).DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Db.conf'));
49
+			$oDb = Config::get('Db');
50
+			$oTables = json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.preg_replace('/^.*\\\\([a-zA-Z0-9]+)$/', '$1', get_called_class()).DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Db.conf'));
51 51
 		    
52
-		    $oDb->configuration->tables = $oTables;
52
+			$oDb->configuration->tables = $oTables;
53 53
 		    
54
-    	    $aOptions = [
55
-	           "p" => CREATE_PORTAL,
56
-	           "c" => true,
57
-	           "e" => true,
58
-	           "b" => json_encode($oDb)
59
-    	    ];
54
+			$aOptions = [
55
+			   "p" => CREATE_PORTAL,
56
+			   "c" => true,
57
+			   "e" => true,
58
+			   "b" => json_encode($oDb)
59
+			];
60 60
     	    
61
-    	    $oEntity = new Entity;
62
-    	    $oEntity->runScaffolding($aOptions);
61
+			$oEntity = new Entity;
62
+			$oEntity->runScaffolding($aOptions);
63 63
 		};
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
bundles/src/Batch/app/Controller/Entity.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,20 +50,20 @@
 block discarded – undo
50 50
 	 */
51 51
 	public function runScaffolding(array $aOptions = array())
52 52
 	{
53
-	    if (!isset($aOptions['p'])) { $aOptions['p'] = 'Batch'; }
53
+		if (!isset($aOptions['p'])) { $aOptions['p'] = 'Batch'; }
54 54
 	    
55
-	    if (!isset($aOptions['b'])) { $aOptions['b'] = json_encode(Config::get('Db', $aOptions['p'])); }
55
+		if (!isset($aOptions['b'])) { $aOptions['b'] = json_encode(Config::get('Db', $aOptions['p'])); }
56 56
 	    
57
-	    $aOptions['g'] = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$aOptions['p'].DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Entity'.DIRECTORY_SEPARATOR;
57
+		$aOptions['g'] = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$aOptions['p'].DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Entity'.DIRECTORY_SEPARATOR;
58 58
 	    
59
-	    $aOptions['h'] = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$aOptions['p'].DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Model'.DIRECTORY_SEPARATOR;
59
+		$aOptions['h'] = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$aOptions['p'].DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Model'.DIRECTORY_SEPARATOR;
60 60
 	    
61 61
 	    
62
-	    if (!defined('ENTITY_NAMESPACE')) { define('ENTITY_NAMESPACE', '\Venus\src\\'.$aOptions['p'].'\Entity'); }
62
+		if (!defined('ENTITY_NAMESPACE')) { define('ENTITY_NAMESPACE', '\Venus\src\\'.$aOptions['p'].'\Entity'); }
63 63
 	    
64
-	    if (!defined('MODEL_NAMESPACE')) { define('MODEL_NAMESPACE', '\Venus\src\\'.$aOptions['p'].'\Model'); }
64
+		if (!defined('MODEL_NAMESPACE')) { define('MODEL_NAMESPACE', '\Venus\src\\'.$aOptions['p'].'\Model'); }
65 65
 	    
66
-	    $oBatch = new BatchEntity;
67
-	    $oBatch->runScaffolding($aOptions);
66
+		$oBatch = new BatchEntity;
67
+		$oBatch->runScaffolding($aOptions);
68 68
 	}
69 69
 }
Please login to merge, or discard this patch.
bundles/src/Batch/app/Controller/Plugin.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function install(array $aOptions = array())
49 49
 	{
50
-	    $sFile = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Plugins.conf');
51
-	    $aPlugins = json_decode($sFile);
50
+		$sFile = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Plugins.conf');
51
+		$aPlugins = json_decode($sFile);
52 52
 	    
53
-	    if (isset($aOptions['p'])) {
53
+		if (isset($aOptions['p'])) {
54 54
 	        
55
-	        define('CREATE_PORTAL', $aOptions['p']);
56
-	    }
55
+			define('CREATE_PORTAL', $aOptions['p']);
56
+		}
57 57
 	    
58
-	    foreach ($aPlugins->list as $sPluginName) {
58
+		foreach ($aPlugins->list as $sPluginName) {
59 59
 	        
60
-	        $sClassName = 'Venus\src\plugins\\'.$sPluginName.'\Controller\\'.$sPluginName;
61
-	        $oPlugin = new $sClassName;
62
-	        $oPlugin->install($aOptions['p']);
63
-	    }
60
+			$sClassName = 'Venus\src\plugins\\'.$sPluginName.'\Controller\\'.$sPluginName;
61
+			$oPlugin = new $sClassName;
62
+			$oPlugin->install($aOptions['p']);
63
+		}
64 64
 	}
65 65
 
66 66
 	/**
@@ -73,23 +73,23 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function create(array $aOptions = array())
75 75
 	{
76
-	    $sDefaultFolder = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$aOptions['n'];
77
-	    mkdir($sDefaultFolder, 0777, true);
78
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'conf', 0777, true);
79
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'Controller', 0777, true);
80
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'data', 0777, true);
81
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'i18n', 0777, true);
82
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'meta', 0777, true);
83
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public', 0777, true);
84
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'css', 0777, true);
85
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'img', 0777, true);
86
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'js', 0777, true);
87
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'View', 0777, true);
76
+		$sDefaultFolder = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$aOptions['n'];
77
+		mkdir($sDefaultFolder, 0777, true);
78
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'conf', 0777, true);
79
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'Controller', 0777, true);
80
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'data', 0777, true);
81
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'i18n', 0777, true);
82
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'meta', 0777, true);
83
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public', 0777, true);
84
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'css', 0777, true);
85
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'img', 0777, true);
86
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'js', 0777, true);
87
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'View', 0777, true);
88 88
 	    
89
-	    file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Db.conf', '{}');
90
-	    file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Plugin.conf', '{}');
89
+		file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Db.conf', '{}');
90
+		file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Plugin.conf', '{}');
91 91
 	    
92
-	    $sContent = "<?php
92
+		$sContent = "<?php
93 93
 
94 94
 /**
95 95
  * Controller of the plugin ".$aOptions['n']."
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
     }
158 158
 }";
159 159
 	    
160
-	    file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'Controller'.DIRECTORY_SEPARATOR.$aOptions['n'].'.php', $sContent);
161
-	    mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.'en_US'.DIRECTORY_SEPARATOR.'LC_MESSAGES', 0777, true);
162
-	    file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'meta'.DIRECTORY_SEPARATOR.'LICENSE.md', '');
163
-	    file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'meta'.DIRECTORY_SEPARATOR.'README.md', '');
160
+		file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'Controller'.DIRECTORY_SEPARATOR.$aOptions['n'].'.php', $sContent);
161
+		mkdir($sDefaultFolder.DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.'en_US'.DIRECTORY_SEPARATOR.'LC_MESSAGES', 0777, true);
162
+		file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'meta'.DIRECTORY_SEPARATOR.'LICENSE.md', '');
163
+		file_put_contents($sDefaultFolder.DIRECTORY_SEPARATOR.'meta'.DIRECTORY_SEPARATOR.'README.md', '');
164 164
 	}
165 165
 }
Please login to merge, or discard this patch.
bundles/conf/AutoLoad.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -17,45 +17,45 @@  discard block
 block discarded – undo
17 17
 spl_autoload_register(function (string $sClassName)
18 18
 {
19 19
 
20
-    $sClassName = ltrim($sClassName, '\\');
21
-    $sFileName  = '';
22
-    $sNamespace = '';
23
-    $iLastNsPos = strrpos($sClassName, '\\');
20
+	$sClassName = ltrim($sClassName, '\\');
21
+	$sFileName  = '';
22
+	$sNamespace = '';
23
+	$iLastNsPos = strrpos($sClassName, '\\');
24 24
 
25
-    if ($iLastNsPos) {
25
+	if ($iLastNsPos) {
26 26
 
27
-        $sNamespace = substr($sClassName, 0, $iLastNsPos);
28
-        $sClassName = substr($sClassName, $iLastNsPos + 1);
27
+		$sNamespace = substr($sClassName, 0, $iLastNsPos);
28
+		$sClassName = substr($sClassName, $iLastNsPos + 1);
29 29
 		$sFileName  = str_replace('\\', DIRECTORY_SEPARATOR, $sNamespace).DIRECTORY_SEPARATOR;
30
-    }
30
+	}
31 31
 
32
-    $sFileName = str_replace('/', '\\', $sFileName);
32
+	$sFileName = str_replace('/', '\\', $sFileName);
33 33
     
34
-    $sFileName .= $sClassName.'.php';
34
+	$sFileName .= $sClassName.'.php';
35 35
 
36
-    if (defined('PORTAL')) {
36
+	if (defined('PORTAL')) {
37 37
 
38
-        $sFileClassName = str_replace(PORTAL, PORTAL.DIRECTORY_SEPARATOR.'app', str_replace(['\\', '/'], DIRECTORY_SEPARATOR, str_replace('conf', DIRECTORY_SEPARATOR, __DIR__).str_replace('Venus\\', '', $sFileName)));
39
-        $sFileClassName = preg_replace('/(tests\\\\[^\\\\]+\\\\)/', '$1app\\', $sFileClassName);
40
-        $sFileClassName = preg_replace('/(src\\\\[^\\\\]+\\\\)/', '$1app\\', $sFileClassName);
41
-        $sFileClassName = str_replace('\\\\', '\\', $sFileClassName);
42
-        $sFileClassName = preg_replace('#bundles//tests/([^/]+)#', 'bundles/tests/$1/app', $sFileClassName);
43
-        $sFileClassName = preg_replace('#bundles//src/([^/]+)#', 'bundles/src/$1/app', $sFileClassName);
44
-        $sFileClassName = str_replace('app\\app', 'app', $sFileClassName);
45
-        $sFileClassName = str_replace('app/app', 'app', $sFileClassName);
38
+		$sFileClassName = str_replace(PORTAL, PORTAL.DIRECTORY_SEPARATOR.'app', str_replace(['\\', '/'], DIRECTORY_SEPARATOR, str_replace('conf', DIRECTORY_SEPARATOR, __DIR__).str_replace('Venus\\', '', $sFileName)));
39
+		$sFileClassName = preg_replace('/(tests\\\\[^\\\\]+\\\\)/', '$1app\\', $sFileClassName);
40
+		$sFileClassName = preg_replace('/(src\\\\[^\\\\]+\\\\)/', '$1app\\', $sFileClassName);
41
+		$sFileClassName = str_replace('\\\\', '\\', $sFileClassName);
42
+		$sFileClassName = preg_replace('#bundles//tests/([^/]+)#', 'bundles/tests/$1/app', $sFileClassName);
43
+		$sFileClassName = preg_replace('#bundles//src/([^/]+)#', 'bundles/src/$1/app', $sFileClassName);
44
+		$sFileClassName = str_replace('app\\app', 'app', $sFileClassName);
45
+		$sFileClassName = str_replace('app/app', 'app', $sFileClassName);
46 46
 
47
-        if (strstr($sFileName, 'Venus\\') && file_exists($sFileClassName)) {
47
+		if (strstr($sFileName, 'Venus\\') && file_exists($sFileClassName)) {
48 48
 
49
-        	require $sFileClassName;
50
-        }
51
-    }
52
-    else {
49
+			require $sFileClassName;
50
+		}
51
+	}
52
+	else {
53 53
 
54
-        if (strstr($sFileName, 'Venus\\') && file_exists(preg_replace('#^(src/[a-zA-Z0-9_]+/)#', '$1app/', str_replace(['\\', '/'], '/', str_replace('conf', '', __DIR__).str_replace('Venus\\', '', $sFileName))))) {
54
+		if (strstr($sFileName, 'Venus\\') && file_exists(preg_replace('#^(src/[a-zA-Z0-9_]+/)#', '$1app/', str_replace(['\\', '/'], '/', str_replace('conf', '', __DIR__).str_replace('Venus\\', '', $sFileName))))) {
55 55
 
56
-            require preg_replace('#^(src/[a-zA-Z0-9_]+/)#', '$1app/', str_replace(['\\', '/'], '/', str_replace('conf', '', __DIR__).str_replace('Venus\\', '', $sFileName)));
57
-        }
58
-    }
56
+			require preg_replace('#^(src/[a-zA-Z0-9_]+/)#', '$1app/', str_replace(['\\', '/'], '/', str_replace('conf', '', __DIR__).str_replace('Venus\\', '', $sFileName)));
57
+		}
58
+	}
59 59
 });
60 60
 
61 61
 /**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 if (file_exists(preg_replace('#bundles[/\\\\]conf#', '', __DIR__).'vendor/autoload.php')) {
66 66
 
67
-    include preg_replace('#bundles[/\\\\]conf#', '', __DIR__).'vendor/autoload.php';
67
+	include preg_replace('#bundles[/\\\\]conf#', '', __DIR__).'vendor/autoload.php';
68 68
 }
69 69
 
70 70
 /**
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 
76 76
 if (isset($oConfig) && isset($oConfig->autoload)) {
77 77
     
78
-    $oAutoloadConf = $oConfig->autoload;
78
+	$oAutoloadConf = $oConfig->autoload;
79 79
     
80
-    foreach ($oAutoloadConf as $sFile) {
80
+	foreach ($oAutoloadConf as $sFile) {
81 81
     
82
-        require __DIR__.'/../'.$sFile;
83
-    }
82
+		require __DIR__.'/../'.$sFile;
83
+	}
84 84
 }
Please login to merge, or discard this patch.
bundles/core/Controller.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 abstract class Controller extends Mother 
44 44
 {
45 45
 	
46
-    /**
47
-     * Cache to know if a model was initialize or not because we must initialize it just one time by script
48
-     * 
49
-     * @access private
50
-     * @var    array
51
-     */
52
-    private static $_aInitialize = array();
46
+	/**
47
+	 * Cache to know if a model was initialize or not because we must initialize it just one time by script
48
+	 * 
49
+	 * @access private
50
+	 * @var    array
51
+	 */
52
+	private static $_aInitialize = array();
53 53
     
54 54
 	/**
55 55
 	 * Constructor
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 		 */
96 96
 		if (method_exists(get_called_class(), 'initialize')) {
97 97
 		    
98
-		    if (!isset(self::$_aInitialize[get_called_class()])) { 
98
+			if (!isset(self::$_aInitialize[get_called_class()])) { 
99 99
 		        
100
-		        static::initialize();
101
-		        self::$_aInitialize[get_called_class()] = true;
102
-		    }
100
+				static::initialize();
101
+				self::$_aInitialize[get_called_class()] = true;
102
+			}
103 103
 		}
104 104
 		
105 105
 		/**
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	public function __get($mKey)
171 171
 	{
172
-	    if (isset($this->di) && property_exists($this, 'di')) {
172
+		if (isset($this->di) && property_exists($this, 'di')) {
173 173
 
174
-    	    $mDi = $this->di->get($mKey);
174
+			$mDi = $this->di->get($mKey);
175 175
 
176
-    		if (isset($mDi) && $mDi !== false) { return $mDi; }
177
-	    }
176
+			if (isset($mDi) && $mDi !== false) { return $mDi; }
177
+		}
178 178
 		
179 179
 		return parent::__get($mKey);
180 180
 	}
Please login to merge, or discard this patch.
bundles/core/Config.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -50,17 +50,17 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public static function get(string $sName, string $sPortal = null, bool $bNoDoRedirect = false)
52 52
 	{
53
-	    if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; }
54
-	    else { $sNameCache = $sName; }
53
+		if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; }
54
+		else { $sNameCache = $sName; }
55 55
 	    
56 56
 		if ($sPortal === null || !is_string($sPortal)) {
57 57
 		    
58
-		    if (defined('PORTAL')) {
58
+			if (defined('PORTAL')) {
59 59
 
60 60
 				$sPortal = PORTAL;
61 61
 				$aDirectories = array($sPortal);
62 62
 			}
63
-		    else {
63
+			else {
64 64
 
65 65
 				$sPortal = '';
66 66
 				$aDirectories = scandir(str_replace('core', 'src', __DIR__));
@@ -73,84 +73,84 @@  discard block
 block discarded – undo
73 73
 
74 74
 			foreach ($aDirectories as $sPortal) {
75 75
 			
76
-			    if ($sPortal != '..' && $sPortal != '.') {
76
+				if ($sPortal != '..' && $sPortal != '.') {
77 77
 
78
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
78
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
79 79
         
80
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
81
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
82
-        			}
80
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
81
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
82
+					}
83 83
 
84
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
84
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
85 85
         				
86
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
87
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
88
-        			}
86
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
87
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
88
+					}
89 89
 
90
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) {
90
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) {
91 91
         
92
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
93
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
94
-        			}
92
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
93
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
94
+					}
95 95
 
96
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) {
96
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) {
97 97
         
98
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
99
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
100
-        			}
98
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
99
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
100
+					}
101 101
 
102
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) {
102
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) {
103 103
         
104
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
105
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
106
-        			}
104
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
105
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
106
+					}
107 107
 
108
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) {
108
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) {
109 109
         
110
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
111
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
112
-        			}
110
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
111
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
112
+					}
113 113
 
114
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) {
114
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) {
115 115
         
116
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
117
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
118
-        			}
116
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
117
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
118
+					}
119 119
 
120
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) {
120
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) {
121 121
         
122
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
123
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
124
-        			}
122
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
123
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
124
+					}
125 125
 
126
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) {
126
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) {
127 127
         
128
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
129
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
130
-        			}
128
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
129
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
130
+					}
131 131
 
132
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) {
132
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) {
133 133
         
134
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
135
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
136
-        			}
134
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
135
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
136
+					}
137 137
 
138
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
138
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
139 139
         
140
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
141
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
142
-        			}
140
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
141
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
142
+					}
143 143
 
144
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf')) {
144
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf')) {
145 145
         
146
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
147
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
148
-        			}
146
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
147
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
148
+					}
149 149
         
150
-        			$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
151
-        			$base = self::_mergeAndGetConf($sJsonFile, $base);
152
-			    }
153
-		    }
150
+					$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
151
+					$base = self::_mergeAndGetConf($sJsonFile, $base);
152
+				}
153
+			}
154 154
 
155 155
 			if ($base === '') {
156 156
 				
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public static function getBundleLocationName(string $sName): string
185 185
 	{
186
-	    $oConfig = self::get($sName, null, true);
186
+		$oConfig = self::get($sName, null, true);
187 187
 
188
-	    if (isset($oConfig->redirect)) { return $oConfig->redirect; }
189
-	    else { return PORTAL; }
188
+		if (isset($oConfig->redirect)) { return $oConfig->redirect; }
189
+		else { return PORTAL; }
190 190
 	}
191 191
 
192 192
 	/**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			echo "The Json ".$sFileToMerge." has an error! Please verify!\n";
212 212
 			$oDebug = Debug::getInstance();
213 213
 			$oDebug->error("The Json ".$sFileToMerge." has an error! Please verify!\n");
214
-            new \Exception("The Json ".$sFileToMerge." has an error! Please verify!\n");
214
+			new \Exception("The Json ".$sFileToMerge." has an error! Please verify!\n");
215 215
 		}
216 216
 	}
217 217
 
Please login to merge, or discard this patch.
bundles/core/Router.php 1 patch
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function __construct() 
84 84
 	{
85
-	    $oLogger = Debug::getInstance();
86
-	    $this->setLogger($oLogger);
85
+		$oLogger = Debug::getInstance();
86
+		$this->setLogger($oLogger);
87 87
 	}
88 88
 
89 89
 	/**
@@ -100,123 +100,123 @@  discard block
 block discarded – undo
100 100
 
101 101
 		if (Request::isHttpRequest()) {
102 102
         
103
-		    // Search if a Less file exists
104
-		    if (defined('LESS_ACTIVE') && LESS_ACTIVE === true) {
103
+			// Search if a Less file exists
104
+			if (defined('LESS_ACTIVE') && LESS_ACTIVE === true) {
105 105
 		        
106
-		        if (strstr($_SERVER['REQUEST_URI'], '.css')
107
-                    && file_exists(preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
106
+				if (strstr($_SERVER['REQUEST_URI'], '.css')
107
+					&& file_exists(preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
108 108
 		        
109
-		            Less::toCss($_SERVER['REQUEST_URI']);
110
-		            exit;
111
-		        }
112
-		    }
109
+					Less::toCss($_SERVER['REQUEST_URI']);
110
+					exit;
111
+				}
112
+			}
113 113
 		    
114
-		    // Search if a typescript file exists
115
-		    if (defined('TYPESCRIPT_ACTIVE') && TYPESCRIPT_ACTIVE === true) {
114
+			// Search if a typescript file exists
115
+			if (defined('TYPESCRIPT_ACTIVE') && TYPESCRIPT_ACTIVE === true) {
116 116
 		    
117
-		        if (strstr($_SERVER['REQUEST_URI'], '.js')
118
-		        && file_exists(preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
117
+				if (strstr($_SERVER['REQUEST_URI'], '.js')
118
+				&& file_exists(preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
119 119
 		    
120
-		            Typescript::toJs($_SERVER['REQUEST_URI']);
121
-		            exit;
122
-		        }
123
-		    }
120
+					Typescript::toJs($_SERVER['REQUEST_URI']);
121
+					exit;
122
+				}
123
+			}
124 124
 		    
125
-		    // Search public files in all plugins
126
-		    if ($_SERVER['REQUEST_URI'] !== '/') {
125
+			// Search public files in all plugins
126
+			if ($_SERVER['REQUEST_URI'] !== '/') {
127 127
 	
128
-    		    foreach (Config::get('Plugins')->list as $iKey => $sPlugin) {
128
+				foreach (Config::get('Plugins')->list as $iKey => $sPlugin) {
129 129
     		        
130
-    		        if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI'])) {
130
+					if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI'])) {
131 131
     		            
132
-    		            echo file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI']);
133
-                        exit;
134
-    		        }
135
-                    else if (strstr($_SERVER['REQUEST_URI'], '.css')
136
-		                && file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
137
-
138
-		                Less::toCss(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']));
139
-		                exit;
140
-                    }
141
-		            else if (strstr($_SERVER['REQUEST_URI'], '.js')
142
-		                && file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
143
-
144
-		                Typescript::toJs(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']));
145
-		                exit;
146
-		            }
147
-		        }
148
-	        }
132
+						echo file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI']);
133
+						exit;
134
+					}
135
+					else if (strstr($_SERVER['REQUEST_URI'], '.css')
136
+						&& file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
137
+
138
+						Less::toCss(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']));
139
+						exit;
140
+					}
141
+					else if (strstr($_SERVER['REQUEST_URI'], '.js')
142
+						&& file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
143
+
144
+						Typescript::toJs(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']));
145
+						exit;
146
+					}
147
+				}
148
+			}
149 149
 		    
150 150
 			foreach (Config::get('Route') as $sMultiHost => $oHost) {
151 151
 
152
-			    foreach (explode(',', $sMultiHost) as $sHost) {
152
+				foreach (explode(',', $sMultiHost) as $sHost) {
153 153
 
154
-    				if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST']) || (strstr($sHost, '/')
155
-    					&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
154
+					if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST']) || (strstr($sHost, '/')
155
+						&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
156 156
     
157
-    					$this->_oRoutes = $oHost;
157
+						$this->_oRoutes = $oHost;
158 158
 
159
-    					if (strstr($sHost, '/')
160
-    						&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost)) {
159
+						if (strstr($sHost, '/')
160
+							&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost)) {
161 161
 
162
-    						$this->_sBaseUri = preg_replace('#^[^/]+#', '', $sHost);
163
-    					}
162
+							$this->_sBaseUri = preg_replace('#^[^/]+#', '', $sHost);
163
+						}
164 164
     
165
-    					if (isset($oHost->location)) {
165
+						if (isset($oHost->location)) {
166 166
     
167
-    						header('Status: 301 Moved Permanently', false, 301);
168
-    	  					header('Location: '.$oHost->location);
169
-    	  					exit;
170
-    					}
171
-    					else if (preg_match('#getCss\?#', $_SERVER['REQUEST_URI'])) {
167
+							header('Status: 301 Moved Permanently', false, 301);
168
+		  					header('Location: '.$oHost->location);
169
+		  					exit;
170
+						}
171
+						else if (preg_match('#getCss\?#', $_SERVER['REQUEST_URI'])) {
172 172
     					    
173
-    					    foreach ($_GET as $sKey => $sValue) {
173
+							foreach ($_GET as $sKey => $sValue) {
174 174
 
175
-    					        if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')) {
175
+								if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')) {
176 176
     					            
177
-    					            echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')."\n";
178
-    					        }
179
-    					    }
177
+									echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')."\n";
178
+								}
179
+							}
180 180
     					    
181
-    					    exit;
182
-    					}
183
-    					else if (preg_match('#getJs\?#', $_SERVER['REQUEST_URI'])) {
181
+							exit;
182
+						}
183
+						else if (preg_match('#getJs\?#', $_SERVER['REQUEST_URI'])) {
184 184
     					    
185
-    					    foreach ($_GET as $sKey => $sValue) {
185
+							foreach ($_GET as $sKey => $sValue) {
186 186
 
187
-    					        if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')) {
187
+								if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')) {
188 188
     					            
189
-    					            echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')."\n";
190
-    					        }
191
-    					    }
189
+									echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')."\n";
190
+								}
191
+							}
192 192
     					    
193
-    					    exit;
194
-    					}
195
-    					else if (isset($oHost->routes)) {
193
+							exit;
194
+						}
195
+						else if (isset($oHost->routes)) {
196 196
     
197
-    						foreach($oHost->routes as $sKey => $oRoute) {
197
+							foreach($oHost->routes as $sKey => $oRoute) {
198 198
 
199
-    							$mReturn = $this->_route($oRoute, $_SERVER['REQUEST_URI']);
199
+								$mReturn = $this->_route($oRoute, $_SERVER['REQUEST_URI']);
200 200
 
201
-    							if ($mReturn === 403) {
201
+								if ($mReturn === 403) {
202 202
     
203
-    								$this->_getPage403();
204
-    							}
205
-    							else if ($mReturn === true) {
203
+									$this->_getPage403();
204
+								}
205
+								else if ($mReturn === true) {
206 206
     
207
-    								if (isset($oRoute->cache)) { $this->_checkCache($oRoute->cache); }
207
+									if (isset($oRoute->cache)) { $this->_checkCache($oRoute->cache); }
208 208
     
209
-    								return true;
210
-    							}							
211
-    						}
209
+									return true;
210
+								}							
211
+							}
212 212
     
213
-    						$this->_getPage404();
214
-    					}
215
-    				}
216
-			    }
213
+							$this->_getPage404();
214
+						}
215
+					}
216
+				}
217 217
 			}
218 218
 		}
219
-        else if (Request::isCliRequest()) {
219
+		else if (Request::isCliRequest()) {
220 220
 
221 221
 			if (isset($_SERVER['argv'])) { $aArguments = $_SERVER['argv']; }
222 222
 			else { $aArguments = $argv; }
@@ -224,15 +224,15 @@  discard block
 block discarded – undo
224 224
 			define('PORTAL', 'Batch');
225 225
 			set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
226 226
 
227
-            if (!isset($aArguments[1]) && strstr($aArguments[0], '/phpunit')) {
227
+			if (!isset($aArguments[1]) && strstr($aArguments[0], '/phpunit')) {
228 228
 
229
-                $sBatchName = "phpunit";
230
-                $aArguments[0] = "bin/console";
231
-                $aArguments[1] = "phpunit";
232
-            }
233
-            else {
234
-                $sBatchName = $aArguments[1];
235
-            }
229
+				$sBatchName = "phpunit";
230
+				$aArguments[0] = "bin/console";
231
+				$aArguments[1] = "phpunit";
232
+			}
233
+			else {
234
+				$sBatchName = $aArguments[1];
235
+			}
236 236
 
237 237
 			if (isset(Config::get('Route')->batch->script->{$sBatchName})) {
238 238
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 						array_shift($aArguments);
275 275
 					}
276 276
 				}
277
-      		}
277
+	  		}
278 278
 
279 279
 			if (isset($oBatch->controller) && isset($oBatch->action)) {
280 280
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 			foreach (Config::get('Route') as $sHost => $oHost) {
348 348
 
349 349
 				if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST'])
350
-				    || (strstr($sHost, '/') && strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
350
+					|| (strstr($sHost, '/') && strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
351 351
 
352 352
 					$this->_oRoutes = $oHost->routes;
353 353
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
 		if (isset($oRoute->route)) {
379 379
 
380
-		    $sRoute = str_replace("*", ".*", $oRoute->route);
380
+			$sRoute = str_replace("*", ".*", $oRoute->route);
381 381
 
382 382
 			$sFinalRoute = preg_replace_callback(
383 383
 				'|\[/{0,1}:([a-zA-Z_]+)\]|',
@@ -453,8 +453,8 @@  discard block
 block discarded – undo
453 453
 
454 454
 			if (isset($oRoute->controller)) {
455 455
 
456
-			    define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->controller));
457
-			    set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
456
+				define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->controller));
457
+				set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
458 458
 			     
459 459
 				if (isset($oRoute->content_type)) {
460 460
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 						}
509 509
 						else {
510 510
 
511
-						    $this->_oLogger->warning('Error: Parameter '.$sName.' not exists!');
511
+							$this->_oLogger->warning('Error: Parameter '.$sName.' not exists!');
512 512
 							break;
513 513
 						}
514 514
 					}
@@ -534,10 +534,10 @@  discard block
 block discarded – undo
534 534
 			}
535 535
 			else if (isset($oRoute->template) && isset($oRoute->layout) && $oRoute->layout === true) {
536 536
 
537
-			    define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
538
-			    set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
537
+				define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
538
+				set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
539 539
 			    
540
-			    $oLayout = Vendor::getVendor('Apollina\Template', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.'Layout.tpl');
540
+				$oLayout = Vendor::getVendor('Apollina\Template', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.'Layout.tpl');
541 541
 
542 542
 				if (isset($oRoute->vars)) {
543 543
 
@@ -552,8 +552,8 @@  discard block
 block discarded – undo
552 552
 			}
553 553
 			else if (isset($oRoute->template)) {
554 554
 
555
-			    define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
556
-			    set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
555
+				define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
556
+				set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
557 557
 			    
558 558
 				$oTemplate = Vendor::getVendor('Apollina\Template', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.$oRoute->template.'.tpl');
559 559
 
@@ -653,14 +653,14 @@  discard block
 block discarded – undo
653 653
 		
654 654
 		if (method_exists($oController, 'beforeExecuteRoute')) { 
655 655
 		    
656
-		    call_user_func_array(array($oController, 'beforeExecuteRoute'), array());
656
+			call_user_func_array(array($oController, 'beforeExecuteRoute'), array());
657 657
 		}
658 658
 
659 659
 		$mReturnController = call_user_func_array(array($oController, $sActionName), $aParams);
660 660
 
661 661
 		if (method_exists($oController, 'afterExecuteRoute')) { 
662 662
 		    
663
-		    call_user_func_array(array($oController, 'afterExecuteRoute'), array());
663
+			call_user_func_array(array($oController, 'afterExecuteRoute'), array());
664 664
 		}
665 665
 		
666 666
 		$mReturn = ob_get_clean();
@@ -800,6 +800,6 @@  discard block
 block discarded – undo
800 800
 	 */
801 801
 	public function setLogger(LoggerInterface $logger) {
802 802
 	    
803
-	    $this->_oLogger = $logger;
803
+		$this->_oLogger = $logger;
804 804
 	}
805 805
 }
Please login to merge, or discard this patch.
bundles/lib/Response/Yaml.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,15 +34,15 @@
 block discarded – undo
34 34
 {
35 35
 	/**
36 36
 	 * translate the content
37
-     * @see \Venus\lib\Response\ResponseInterface::translate()
37
+	 * @see \Venus\lib\Response\ResponseInterface::translate()
38 38
 	 *
39 39
 	 * @access public
40 40
 	 * @param  mixed $mContent content to translate
41 41
 	 * @return mixed
42 42
 	 */
43
-    public static function translate($mContent)
44
-    {
45
-        return yaml_emit($mContent);
46
-    }
43
+	public static function translate($mContent)
44
+	{
45
+		return yaml_emit($mContent);
46
+	}
47 47
 
48 48
 }
Please login to merge, or discard this patch.