Completed
Branch 1.2 (459185)
by David
04:06
created
lib/Dwoo/Template/File.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @return boolean True cache file existance and it's modification time
108 108
 	 */
109 109
 	protected function isValidCompiledFile($file) {
110
-		return parent::isValidCompiledFile($file) && (int)$this->getUid() <= filemtime($file);
110
+		return parent::isValidCompiledFile($file) && (int) $this->getUid() <= filemtime($file);
111 111
 	}
112 112
 
113 113
 	/**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			foreach ($this->includePath as $path) {
146 146
 				$path = rtrim($path, DIRECTORY_SEPARATOR);
147 147
 				if (file_exists($path.DIRECTORY_SEPARATOR.$this->file) === true) {
148
-					$this->resolvedPath = $path . DIRECTORY_SEPARATOR . $this->file;
148
+					$this->resolvedPath = $path.DIRECTORY_SEPARATOR.$this->file;
149 149
 					return $this->resolvedPath;
150 150
 				}
151 151
 			}
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
 	protected function getCompiledFilename(Dwoo_Core $dwoo)
251 251
 	{
252 252
 		// no compile id was provided, set default
253
-		if ($this->compileId===null) {
253
+		if ($this->compileId === null) {
254 254
 			$this->compileId = str_replace('../', '__', strtr($this->getResourceIdentifier(), '\\:', '/-'));
255 255
 		}
256
-		return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo_Core::RELEASE_TAG.'.php';
256
+		return $dwoo->getCompileDir().$this->compileId.'.d'.Dwoo_Core::RELEASE_TAG.'.php';
257 257
 	}
258 258
 
259 259
 	/**
Please login to merge, or discard this patch.
lib/Dwoo/Block/Plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,6 +98,6 @@
 block discarded – undo
98 98
 	 */
99 99
 	public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
100 100
 	{
101
-		return $content . Dwoo_Compiler::PHP_OPEN.$prepend.'$this->delStack();'.$append.Dwoo_Compiler::PHP_CLOSE;
101
+		return $content.Dwoo_Compiler::PHP_OPEN.$prepend.'$this->delStack();'.$append.Dwoo_Compiler::PHP_CLOSE;
102 102
 	}
103 103
 }
Please login to merge, or discard this patch.
lib/Dwoo/Loader.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public function __construct($cacheDir)
46 46
 	{
47
-		$this->corePluginDir = DWOO_DIRECTORY . 'plugins';
48
-		$this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
47
+		$this->corePluginDir = DWOO_DIRECTORY.'plugins';
48
+		$this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
49 49
 
50 50
 		// include class paths or rebuild paths if the cache file isn't there
51 51
 		$cacheFile = $this->cacheDir.'classpath.cache.d'.Dwoo_Core::RELEASE_TAG.'.php';
52 52
 		if (file_exists($cacheFile)) {
53 53
 			$classpath = file_get_contents($cacheFile);
54
-			$this->classPath = unserialize($classpath) + $this->classPath;
54
+			$this->classPath = unserialize($classpath)+$this->classPath;
55 55
 		} else {
56 56
 			$this->rebuildClassPathCache($this->corePluginDir, $cacheFile);
57 57
 		}
@@ -65,25 +65,25 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	protected function rebuildClassPathCache($path, $cacheFile)
67 67
 	{
68
-		if ($cacheFile!==false) {
68
+		if ($cacheFile !== false) {
69 69
 			$tmp = $this->classPath;
70 70
 			$this->classPath = array();
71 71
 		}
72 72
 
73 73
 		// iterates over all files/folders
74
-		$list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*');
74
+		$list = glob(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*');
75 75
 		if (is_array($list)) {
76 76
 			foreach ($list as $f) {
77 77
 				if (is_dir($f)) {
78 78
 					$this->rebuildClassPathCache($f, false);
79 79
 				} else {
80
-					$this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f;
80
+					$this->classPath[str_replace(array('function.', 'block.', 'modifier.', 'outputfilter.', 'filter.', 'prefilter.', 'postfilter.', 'pre.', 'post.', 'output.', 'shared.', 'helper.'), '', basename($f, '.php'))] = $f;
81 81
 				}
82 82
 			}
83 83
 		}
84 84
 
85 85
 		// save in file if it's the first call (not recursed)
86
-		if ($cacheFile!==false) {
86
+		if ($cacheFile !== false) {
87 87
 			if (!file_put_contents($cacheFile, serialize($this->classPath))) {
88 88
 				throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');
89 89
 			}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 			!(include $this->classPath[$class]))
110 110
 		{
111 111
 			if ($forceRehash) {
112
-				$this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath.cache.d'.Dwoo_Core::RELEASE_TAG.'.php');
112
+				$this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.Dwoo_Core::RELEASE_TAG.'.php');
113 113
 				foreach ($this->paths as $path=>$file) {
114 114
 					$this->rebuildClassPathCache($path, $file);
115 115
 				}
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 		if (!$pluginDir) {
143 143
 			throw new Dwoo_Exception('Plugin directory does not exist or can not be read : '.$pluginDirectory);
144 144
 		}
145
-		$cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo_Core::RELEASE_TAG.'.php';
145
+		$cacheFile = $this->cacheDir.'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo_Core::RELEASE_TAG.'.php';
146 146
 		$this->paths[$pluginDir] = $cacheFile;
147 147
 		if (file_exists($cacheFile)) {
148 148
 			$classpath = file_get_contents($cacheFile);
149
-			$this->classPath = unserialize($classpath) + $this->classPath;
149
+			$this->classPath = unserialize($classpath)+$this->classPath;
150 150
 		} else {
151 151
 			$this->rebuildClassPathCache($pluginDir, $cacheFile);
152 152
 		}
Please login to merge, or discard this patch.
lib/Dwoo/Plugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		$out = '';
73 73
 		foreach ($params as $attr=>$val) {
74 74
 			$out .= ' '.$attr.'=';
75
-			if (trim($val, '"\'')=='' || $val=='null') {
75
+			if (trim($val, '"\'') == '' || $val == 'null') {
76 76
 				$out .= str_replace($delim, '\\'.$delim, '""');
77 77
 			} elseif (substr($val, 0, 1) === $delim && substr($val, -1) === $delim) {
78 78
 				$out .= str_replace($delim, '\\'.$delim, '"'.substr($val, 1, -1).'"');
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 					$escapedVal = '.'.$val.'.';
89 89
 				}
90 90
 
91
-				$out .= str_replace($delim, '\\'.$delim, '"') .
92
-					$delim . $escapedVal . $delim .
91
+				$out .= str_replace($delim, '\\'.$delim, '"').
92
+					$delim.$escapedVal.$delim.
93 93
 					str_replace($delim, '\\'.$delim, '"');
94 94
 			}
95 95
 		}
Please login to merge, or discard this patch.
lib/Dwoo/Security/Policy.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,8 +45,7 @@
 block discarded – undo
45 45
 	 *
46 46
 	 * @var array
47 47
 	 */
48
-	protected $allowedPhpFunctions = array
49
-	(
48
+	protected $allowedPhpFunctions = array(
50 49
 		'str_repeat' => true,
51 50
 		'number_format' => true,
52 51
 		'htmlentities' => true,
Please login to merge, or discard this patch.
lib/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php 2 patches
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -20,153 +20,153 @@
 block discarded – undo
20 20
  * @uses the dwoo package from http://dwoo.org
21 21
  */
22 22
 class Dwootemplate extends Dwoo_Core {
23
-    protected $dwoo_data = array();
24
-
25
-    /**
26
-     * Constructor for the DwooTemplate engine
27
-     *
28
-     */
29
-    public function __construct() {
30
-        // Call parents constructor
31
-        parent::__construct();
32
-
33
-        // Set the config settings
34
-        $this->initialize();
35
-
36
-        // Assign some defaults to dwoo
37
-        $CI                         = get_instance();
38
-        $this->dwoo_data            = new Dwoo_Data();
39
-        $this->dwoo_data->js_files  = array();
40
-        $this->dwoo_data->css_files = array();
41
-        $this->dwoo_data->CI        = $CI;
42
-        $this->dwoo_data->site_url  = $CI->config->site_url(); // so we can get the full path to CI easily
43
-        $this->dwoo_data->uniqid    = uniqid();
44
-        $this->dwoo_data->timestamp = mktime();
45
-
46
-        log_message('debug', "Dwoo Template Class Initialized");
47
-    }
48
-
49
-
50
-    /**
51
-     * Assign data to dwoo data object
52
-     *
53
-     * @param string $key
54
-     * @param mixed $value
55
-     */
56
-    public function assign($key, $value) {
57
-        $this->dwoo_data->$key = $value;
58
-    }
59
-
60
-
61
-    /**
62
-     * Add Javascript files to template
63
-     *
64
-     * @param string $js
65
-     */
66
-    public function add_js($js) {
67
-        $current   = $this->dwoo_data->js_files;
68
-        $current[] = $js;
69
-        $this->dwoo_data->js_files = $current;
70
-    }
71
-
72
-
73
-    /**
74
-     * Add Css stylesheets to template
75
-     *
76
-     * @param string $css
77
-     */
78
-    public function add_css($css) {
79
-        $current   = $this->dwoo_data->css_files;
80
-        $current[] = $css;
81
-        $this->dwoo_data->css_files = $current;
82
-    }
83
-
84
-
85
-    /**
86
-     * Display or return the compiled template
87
-     * Since we assign the results to the standard CI output module
88
-     * you can also use the helper from CI in your templates!!
89
-     *
90
-     * @param string $sTemplate
91
-     * @param boolean $return
92
-     * @return mixed
93
-     */
94
-    public function display($sTemplate, $return = FALSE) {
95
-        // Start benchmark
96
-        $CI = get_instance();
97
-        $CI->benchmark->mark('dwoo_parse_start');
98
-
99
-        // Check if file exists
100
-        if ( !file_exists($this->template_dir . $sTemplate ) ) {
101
-            $message = sprintf('Template file \'%s\' not found.', $sTemplate);
102
-            show_error($message);
103
-            log_message('error', $message);
104
-        }
105
-
106
-        // Create new template
107
-        $tpl = new Dwoo_Template_File($this->template_dir . $sTemplate);
108
-
109
-        // render the template
110
-        $template = $this->get($tpl, $this->dwoo_data);
111
-
112
-        // Finish benchmark
113
-        $CI->benchmark->mark('dwoo_parse_end');
114
-
115
-        // Return results or not ?
116
-        if ($return == FALSE) {
117
-            $CI->output->final_output = $template;
118
-        } else {
119
-            return $template;
120
-        }
121
-    }
122
-
123
-
124
-    /**
125
-     * Toggle Codeigniter profiler on/off
126
-     *
127
-     */
128
-    public function enable_profiler($toggle = TRUE) {
129
-        $CI = get_instance();
130
-        $CI->output->enable_profiler($toggle);
131
-    }
132
-
133
-
134
-    /**
135
-     * Set http header
136
-     *
137
-     * @example $this->output->set_header("HTTP/1.1 200 OK");
138
-     * @example $this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
139
-     * @param string $header
140
-     */
141
-    public function set_header($header) {
142
-        $CI = get_instance();
143
-        $CI->output->set_header($header);
144
-    }
145
-
146
-
147
-    /**
148
-     * Set status header
149
-     *
150
-     * @example $this->output->set_status_header('401');
151
-     * @example // Sets the header as: Unauthorized
152
-     * @param string $header
153
-     */
154
-    public function set_status_header($header) {
155
-        $CI = get_instance();
156
-        $CI->output->set_status_header($header);
157
-    }
158
-
159
-
160
-    /**
161
-     * Assign the dwootemplate config items to the instance
162
-     *
163
-     */
164
-    private function initialize() {
165
-        $CI = get_instance();
166
-        $CI->config->load('dwootemplate', TRUE);
167
-        $config = $CI->config->item('dwootemplate');
168
-        foreach ($config as $key => $val) {
169
-                $this->$key = $val;
170
-        }
171
-    }
23
+	protected $dwoo_data = array();
24
+
25
+	/**
26
+	 * Constructor for the DwooTemplate engine
27
+	 *
28
+	 */
29
+	public function __construct() {
30
+		// Call parents constructor
31
+		parent::__construct();
32
+
33
+		// Set the config settings
34
+		$this->initialize();
35
+
36
+		// Assign some defaults to dwoo
37
+		$CI                         = get_instance();
38
+		$this->dwoo_data            = new Dwoo_Data();
39
+		$this->dwoo_data->js_files  = array();
40
+		$this->dwoo_data->css_files = array();
41
+		$this->dwoo_data->CI        = $CI;
42
+		$this->dwoo_data->site_url  = $CI->config->site_url(); // so we can get the full path to CI easily
43
+		$this->dwoo_data->uniqid    = uniqid();
44
+		$this->dwoo_data->timestamp = mktime();
45
+
46
+		log_message('debug', "Dwoo Template Class Initialized");
47
+	}
48
+
49
+
50
+	/**
51
+	 * Assign data to dwoo data object
52
+	 *
53
+	 * @param string $key
54
+	 * @param mixed $value
55
+	 */
56
+	public function assign($key, $value) {
57
+		$this->dwoo_data->$key = $value;
58
+	}
59
+
60
+
61
+	/**
62
+	 * Add Javascript files to template
63
+	 *
64
+	 * @param string $js
65
+	 */
66
+	public function add_js($js) {
67
+		$current   = $this->dwoo_data->js_files;
68
+		$current[] = $js;
69
+		$this->dwoo_data->js_files = $current;
70
+	}
71
+
72
+
73
+	/**
74
+	 * Add Css stylesheets to template
75
+	 *
76
+	 * @param string $css
77
+	 */
78
+	public function add_css($css) {
79
+		$current   = $this->dwoo_data->css_files;
80
+		$current[] = $css;
81
+		$this->dwoo_data->css_files = $current;
82
+	}
83
+
84
+
85
+	/**
86
+	 * Display or return the compiled template
87
+	 * Since we assign the results to the standard CI output module
88
+	 * you can also use the helper from CI in your templates!!
89
+	 *
90
+	 * @param string $sTemplate
91
+	 * @param boolean $return
92
+	 * @return mixed
93
+	 */
94
+	public function display($sTemplate, $return = FALSE) {
95
+		// Start benchmark
96
+		$CI = get_instance();
97
+		$CI->benchmark->mark('dwoo_parse_start');
98
+
99
+		// Check if file exists
100
+		if ( !file_exists($this->template_dir . $sTemplate ) ) {
101
+			$message = sprintf('Template file \'%s\' not found.', $sTemplate);
102
+			show_error($message);
103
+			log_message('error', $message);
104
+		}
105
+
106
+		// Create new template
107
+		$tpl = new Dwoo_Template_File($this->template_dir . $sTemplate);
108
+
109
+		// render the template
110
+		$template = $this->get($tpl, $this->dwoo_data);
111
+
112
+		// Finish benchmark
113
+		$CI->benchmark->mark('dwoo_parse_end');
114
+
115
+		// Return results or not ?
116
+		if ($return == FALSE) {
117
+			$CI->output->final_output = $template;
118
+		} else {
119
+			return $template;
120
+		}
121
+	}
122
+
123
+
124
+	/**
125
+	 * Toggle Codeigniter profiler on/off
126
+	 *
127
+	 */
128
+	public function enable_profiler($toggle = TRUE) {
129
+		$CI = get_instance();
130
+		$CI->output->enable_profiler($toggle);
131
+	}
132
+
133
+
134
+	/**
135
+	 * Set http header
136
+	 *
137
+	 * @example $this->output->set_header("HTTP/1.1 200 OK");
138
+	 * @example $this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
139
+	 * @param string $header
140
+	 */
141
+	public function set_header($header) {
142
+		$CI = get_instance();
143
+		$CI->output->set_header($header);
144
+	}
145
+
146
+
147
+	/**
148
+	 * Set status header
149
+	 *
150
+	 * @example $this->output->set_status_header('401');
151
+	 * @example // Sets the header as: Unauthorized
152
+	 * @param string $header
153
+	 */
154
+	public function set_status_header($header) {
155
+		$CI = get_instance();
156
+		$CI->output->set_status_header($header);
157
+	}
158
+
159
+
160
+	/**
161
+	 * Assign the dwootemplate config items to the instance
162
+	 *
163
+	 */
164
+	private function initialize() {
165
+		$CI = get_instance();
166
+		$CI->config->load('dwootemplate', TRUE);
167
+		$config = $CI->config->item('dwootemplate');
168
+		foreach ($config as $key => $val) {
169
+				$this->$key = $val;
170
+		}
171
+	}
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,14 +97,14 @@
 block discarded – undo
97 97
         $CI->benchmark->mark('dwoo_parse_start');
98 98
 
99 99
         // Check if file exists
100
-        if ( !file_exists($this->template_dir . $sTemplate ) ) {
100
+        if (!file_exists($this->template_dir.$sTemplate)) {
101 101
             $message = sprintf('Template file \'%s\' not found.', $sTemplate);
102 102
             show_error($message);
103 103
             log_message('error', $message);
104 104
         }
105 105
 
106 106
         // Create new template
107
-        $tpl = new Dwoo_Template_File($this->template_dir . $sTemplate);
107
+        $tpl = new Dwoo_Template_File($this->template_dir.$sTemplate);
108 108
 
109 109
         // render the template
110 110
         $template = $this->get($tpl, $this->dwoo_data);
Please login to merge, or discard this patch.
lib/Dwoo/Adapters/CodeIgniter/config/dwootemplate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
2 2
 
3 3
 // The name of the directory where templates are located.
4
-$config['template_dir'] = dirname(FCPATH) . '/../application/views/';
4
+$config['template_dir'] = dirname(FCPATH).'/../application/views/';
5 5
 
6 6
 // The directory where compiled templates are located
7
-$config['compileDir']   = dirname(FCPATH) . '/../compile/';
7
+$config['compileDir']   = dirname(FCPATH).'/../compile/';
8 8
 
9 9
 //This tells Dwoo whether or not to cache the output of the templates to the $cache_dir.
10 10
 $config['caching']      = 0;
11
-$config['cacheDir']     = dirname(FCPATH) . '/../cache/';
11
+$config['cacheDir']     = dirname(FCPATH).'/../cache/';
12 12
 $config['cacheTime']    = 0;
Please login to merge, or discard this patch.
lib/Dwoo/Adapters/CodeIgniter/controllers/dwoowelcome.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 
3 3
 class Dwoowelcome extends Controller {
4 4
 
5
-    function __construct()
6
-    {
7
-        parent::Controller();
8
-    }
5
+	function __construct()
6
+	{
7
+		parent::Controller();
8
+	}
9 9
 
10
-    function index()
11
-    {
12
-    	$this->load->library('Dwootemplate');
13
-    	$this->dwootemplate->assign('itshowlate', date('H:i:s'));
14
-    	$this->dwootemplate->display('dwoowelcome.tpl');
15
-    }
10
+	function index()
11
+	{
12
+		$this->load->library('Dwootemplate');
13
+		$this->dwootemplate->assign('itshowlate', date('H:i:s'));
14
+		$this->dwootemplate->display('dwoowelcome.tpl');
15
+	}
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Dwoo/Adapters/ZendFramework/Dwoo.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 			return $this->getPluginProxy()->view->$name;
32 32
 		}
33 33
 		$trace = debug_backtrace();
34
-		trigger_error('Undefined property via __get(): ' . $name .
35
-					  ' in ' . $trace[0]['file'] .
36
-					  ' on line ' . $trace[0]['line'], E_USER_NOTICE);
34
+		trigger_error('Undefined property via __get(): '.$name.
35
+					  ' in '.$trace[0]['file'].
36
+					  ' on line '.$trace[0]['line'], E_USER_NOTICE);
37 37
 		return null;
38 38
 	}
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.