@@ -16,7 +16,6 @@ |
||
| 16 | 16 | namespace Agavi\Config; |
| 17 | 17 | |
| 18 | 18 | use Agavi\Config\Util\Dom\XmlConfigDomElement; |
| 19 | -use Agavi\Config\Util\Dom\XmlConfigDomNode; |
|
| 20 | 19 | use Agavi\Core\Context; |
| 21 | 20 | use Agavi\Config\XmlConfigHandler; |
| 22 | 21 | use Agavi\Config\Util\Dom\XmlConfigDomDocument; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $pattern = Toolkit::expandDirectives($route->getAttribute('pattern')); |
| 112 | 112 | $opts = array(); |
| 113 | 113 | if ($route->hasAttribute('imply')) { |
| 114 | - $opts['imply'] = Toolkit::literalize($route->getAttribute('imply')); |
|
| 114 | + $opts['imply'] = Toolkit::literalize($route->getAttribute('imply')); |
|
| 115 | 115 | } |
| 116 | 116 | if ($route->hasAttribute('cut')) { |
| 117 | 117 | $opts['cut'] = Toolkit::literalize($route->getAttribute('cut')); |
@@ -123,14 +123,14 @@ discard block |
||
| 123 | 123 | $opts['name'] = Toolkit::expandDirectives($route->getAttribute('name')); |
| 124 | 124 | } |
| 125 | 125 | if ($route->hasAttribute('source')) { |
| 126 | - $opts['source'] = Toolkit::expandDirectives($route->getAttribute('source')); |
|
| 126 | + $opts['source'] = Toolkit::expandDirectives($route->getAttribute('source')); |
|
| 127 | 127 | } |
| 128 | 128 | if ($route->hasAttribute('constraint')) { |
| 129 | - $opts['constraint'] = array_map('trim', explode(' ', trim(Toolkit::expandDirectives($route->getAttribute('constraint'))))); |
|
| 129 | + $opts['constraint'] = array_map('trim', explode(' ', trim(Toolkit::expandDirectives($route->getAttribute('constraint'))))); |
|
| 130 | 130 | } |
| 131 | 131 | // values which will be set when the route matched |
| 132 | 132 | if ($route->hasAttribute('controller')) { |
| 133 | - $opts['controller'] = Toolkit::expandDirectives($route->getAttribute('controller')); |
|
| 133 | + $opts['controller'] = Toolkit::expandDirectives($route->getAttribute('controller')); |
|
| 134 | 134 | } |
| 135 | 135 | if ($route->hasAttribute('locale')) { |
| 136 | 136 | $opts['locale'] = Toolkit::expandDirectives($route->getAttribute('locale')); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $opts['module'] = Toolkit::expandDirectives($route->getAttribute('module')); |
| 143 | 143 | } |
| 144 | 144 | if ($route->hasAttribute('output_type')) { |
| 145 | - $opts['output_type'] = Toolkit::expandDirectives($route->getAttribute('output_type')); |
|
| 145 | + $opts['output_type'] = Toolkit::expandDirectives($route->getAttribute('output_type')); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if ($route->has('ignores')) { |
@@ -452,6 +452,7 @@ discard block |
||
| 452 | 452 | * description for an example. |
| 453 | 453 | * @param float $month Whether the time is local wall time, local standard time, |
| 454 | 454 | * or UTC time. Default is local wall time. |
| 455 | + * @param double $mode |
|
| 455 | 456 | * |
| 456 | 457 | * @author Dominik del Bondio <[email protected]> |
| 457 | 458 | * @author The ICU Project |
@@ -861,7 +862,7 @@ discard block |
||
| 861 | 862 | * @param int $day The day-in-month of the given date. |
| 862 | 863 | * @param int $dayOfWeek The day-of-week of the given date. |
| 863 | 864 | * @param int $millis The millis in day in <em>standard</em> local time. |
| 864 | - * @param int $monthLengthThe length of the given month in days. |
|
| 865 | + * @param integer $monthLength length of the given month in days. |
|
| 865 | 866 | * @param int $prevMonthLength Length of the previous month in days. |
| 866 | 867 | * |
| 867 | 868 | * @return int The offset to add *to* GMT to get local time. |
@@ -1119,6 +1120,17 @@ discard block |
||
| 1119 | 1120 | * millis are compared directly against the ruleMillis, so any |
| 1120 | 1121 | * standard-daylight adjustments must be handled by the caller. |
| 1121 | 1122 | * |
| 1123 | + * @param integer $month |
|
| 1124 | + * @param integer $prevMonthLen |
|
| 1125 | + * @param integer $dayOfMonth |
|
| 1126 | + * @param integer $dayOfWeek |
|
| 1127 | + * @param integer $millis |
|
| 1128 | + * @param integer $millisDelta |
|
| 1129 | + * @param integer $ruleMode |
|
| 1130 | + * @param integer $ruleMonth |
|
| 1131 | + * @param integer $ruleDayOfWeek |
|
| 1132 | + * @param integer $ruleDay |
|
| 1133 | + * @param integer $ruleMillis |
|
| 1122 | 1134 | * @return int 1 if the date is after the rule date, -1 if the date is |
| 1123 | 1135 | * before the rule date, or 0 if the date is equal to the rule |
| 1124 | 1136 | * date. |
@@ -1421,16 +1421,16 @@ |
||
| 1421 | 1421 | } |
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | - private $startMonth, $startDay, $startDayOfWeek; // the month, day, DOW, and time DST starts |
|
| 1424 | + private $startMonth, $startDay, $startDayOfWeek; // the month, day, DOW, and time DST starts |
|
| 1425 | 1425 | private $startTime; |
| 1426 | 1426 | private $startTimeMode, $endTimeMode; // Mode for startTime, endTime; see TimeMode |
| 1427 | 1427 | private $endMonth, $endDay, $endDayOfWeek; // the month, day, DOW, and time DST ends |
| 1428 | 1428 | private $endTime; |
| 1429 | - private $startYear; // the year these DST rules took effect |
|
| 1430 | - private $rawOffset; // the TimeZone's raw GMT offset |
|
| 1429 | + private $startYear; // the year these DST rules took effect |
|
| 1430 | + private $rawOffset; // the TimeZone's raw GMT offset |
|
| 1431 | 1431 | private $useDaylight; // flag indicating whether this TimeZone uses DST |
| 1432 | 1432 | private static $STATICMONTHLENGTH = array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
| 1433 | - private $startMode, $endMode; // flags indicating what kind of rules the DST rules are |
|
| 1433 | + private $startMode, $endMode; // flags indicating what kind of rules the DST rules are |
|
| 1434 | 1434 | |
| 1435 | 1435 | /** |
| 1436 | 1436 | * A positive value indicating the amount of time saved during DST in ms. |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use Agavi\Core\Context; |
| 17 | 17 | use Agavi\Dispatcher\ExecutionContainer; |
| 18 | 18 | use Agavi\Exception\AgaviException; |
| 19 | -use Agavi\Exception\FilterException; |
|
| 20 | 19 | use Agavi\Exception\ParseException; |
| 21 | 20 | use Agavi\Logging\LoggerInterface; |
| 22 | 21 | use Agavi\Request\RequestDataHolder; |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | if (is_array($value)) { |
| 534 | 534 | $value = array_map('strval', $value); |
| 535 | 535 | } else { |
| 536 | - $value = (string) $value; |
|
| 536 | + $value = (string)$value; |
|
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | |
@@ -1049,15 +1049,15 @@ discard block |
||
| 1049 | 1049 | |
| 1050 | 1050 | // and "clean up" some of the params just in case the user messed up |
| 1051 | 1051 | |
| 1052 | - $errorClassMap = (array) $this->getParameter('error_class_map'); |
|
| 1052 | + $errorClassMap = (array)$this->getParameter('error_class_map'); |
|
| 1053 | 1053 | // append a match-all expression to the map, which assigns the default error class |
| 1054 | 1054 | $errorClassMap['self::${htmlnsPrefix}*'] = $this->getParameter('error_class'); |
| 1055 | 1055 | $this->setParameter('error_class_map', $errorClassMap); |
| 1056 | 1056 | |
| 1057 | - $this->setParameter('methods', (array) $this->getParameter('methods')); |
|
| 1057 | + $this->setParameter('methods', (array)$this->getParameter('methods')); |
|
| 1058 | 1058 | |
| 1059 | 1059 | if ($ot = $this->getParameter('output_types')) { |
| 1060 | - $this->setParameter('output_types', (array) $ot); |
|
| 1060 | + $this->setParameter('output_types', (array)$ot); |
|
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | $savexmlOptions = 0; |
@@ -1070,7 +1070,7 @@ discard block |
||
| 1070 | 1070 | } |
| 1071 | 1071 | $this->setParameter('savexml_options', $savexmlOptions); |
| 1072 | 1072 | |
| 1073 | - $ignoreParseErrors =& $this->getParameter('ignore_parse_errors'); |
|
| 1073 | + $ignoreParseErrors = & $this->getParameter('ignore_parse_errors'); |
|
| 1074 | 1074 | if (is_string($ignoreParseErrors) && defined($ignoreParseErrors)) { |
| 1075 | 1075 | $ignoreParseErrors = constant($ignoreParseErrors); |
| 1076 | 1076 | } |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | $ignoreParseErrors = LIBXML_ERR_NONE; |
| 1082 | 1082 | } |
| 1083 | 1083 | |
| 1084 | - $logParseErrors =& $this->getParameter('log_parse_errors'); |
|
| 1084 | + $logParseErrors = & $this->getParameter('log_parse_errors'); |
|
| 1085 | 1085 | if (is_string($logParseErrors) && defined($logParseErrors)) { |
| 1086 | 1086 | $logParseErrors = constant($logParseErrors); |
| 1087 | 1087 | } |
@@ -22,7 +22,6 @@ |
||
| 22 | 22 | **/ |
| 23 | 23 | namespace Agavi\Build\Console\Command; |
| 24 | 24 | |
| 25 | -use Symfony\Component\Console\Helper\Helper; |
|
| 26 | 25 | use Symfony\Component\Console\Input\InputInterface; |
| 27 | 26 | use Symfony\Component\Console\Input\InputOption; |
| 28 | 27 | use Symfony\Component\Console\Output\Output; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if (is_array($tmp)) { |
| 87 | 87 | array_walk( |
| 88 | 88 | $tmp, |
| 89 | - function (&$v) { |
|
| 89 | + function(&$v) { |
|
| 90 | 90 | $v = ucfirst($v); |
| 91 | 91 | } |
| 92 | 92 | ); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | // Copy config.php |
| 148 | 148 | $fc->copy($templates . '/app/config.php.tmpl', $projectLocation . '/app/config.php', |
| 149 | - function ($data, $params) { |
|
| 149 | + function($data, $params) { |
|
| 150 | 150 | return $this->projectTokenReplacer($data, $params); |
| 151 | 151 | }, $defaultParams); |
| 152 | 152 | |
@@ -158,19 +158,19 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | // Base controller |
| 160 | 160 | $fc->copy($templates . '/app/lib/controller/BaseController.class.php.tmpl', $projectLocation . '/app/lib/controller/' . $projectPrefix . 'BaseController.class.php', |
| 161 | - function ($data, $params) { |
|
| 161 | + function($data, $params) { |
|
| 162 | 162 | return $this->projectTokenReplacer($data, $params); |
| 163 | 163 | }, $defaultParams); |
| 164 | 164 | |
| 165 | 165 | // Base model |
| 166 | 166 | $fc->copy($templates . '/app/lib/model/BaseModel.class.php.tmpl', $projectLocation . '/app/lib/model/' . $projectPrefix . 'BaseModel.class.php', |
| 167 | - function ($data, $params) { |
|
| 167 | + function($data, $params) { |
|
| 168 | 168 | return $this->projectTokenReplacer($data, $params); |
| 169 | 169 | }, $defaultParams); |
| 170 | 170 | |
| 171 | 171 | // Base view |
| 172 | 172 | $fc->copy($templates . '/app/lib/view/BaseView.class.php.tmpl', $projectLocation . '/app/lib/view/' . $projectPrefix . 'BaseView.class.php', |
| 173 | - function ($data, $params) { |
|
| 173 | + function($data, $params) { |
|
| 174 | 174 | return $this->projectTokenReplacer($data, $params); |
| 175 | 175 | }, $defaultParams); |
| 176 | 176 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | @mkdir($projectLocation . '/app/config', 0755, true); |
| 179 | 179 | foreach (glob($this->getSourceDir() . '/build/templates/app/config/*.xml.tmpl') as $file) { |
| 180 | 180 | $fc->copy($file, $projectLocation . '/app/config/' . basename($file, '.tmpl'), |
| 181 | - function ($data, $params) { |
|
| 181 | + function($data, $params) { |
|
| 182 | 182 | return $this->projectTokenReplacer($data, $params); |
| 183 | 183 | }, $defaultParams); |
| 184 | 184 | } |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Command-line script for Agavi2 |
| 17 | - |
|
| 18 | 17 | * @author Markus Lervik <[email protected]> |
| 19 | 18 | * @copyright Authors |
| 20 | 19 | * @copyright The Agavi Project |
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | |
| 31 | 31 | // Autoloader for our console application. We don't want |
| 32 | 32 | // to pollute Composer's autoloader |
| 33 | -spl_autoload_register(function ($class) { |
|
| 34 | - if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php')) { |
|
| 35 | - include (__DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'); |
|
| 33 | +spl_autoload_register(function($class) { |
|
| 34 | + if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php')) { |
|
| 35 | + include (__DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'); |
|
| 36 | 36 | } |
| 37 | 37 | }); |
| 38 | 38 | |
@@ -28,7 +28,6 @@ |
||
| 28 | 28 | use Symfony\Component\Console\Exception\InvalidArgumentException; |
| 29 | 29 | use Symfony\Component\Console\Input\ArrayInput; |
| 30 | 30 | use Symfony\Component\Console\Input\InputInterface; |
| 31 | -use Symfony\Component\Console\Input\InputOption; |
|
| 32 | 31 | use Symfony\Component\Console\Output\Output; |
| 33 | 32 | use Symfony\Component\Console\Output\OutputInterface; |
| 34 | 33 | use Symfony\Component\Console\Question\Question; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $fc = new FileCopyHelper(); |
| 128 | 128 | $fc->copy($this->getSourceDir() . '/build/templates/defaults/app/modules/views/WelcomeSuccessView.class.php.tmpl', |
| 129 | 129 | $projectLocation . '/app/modules/Welcome/views/IndexSuccessView.class.php', |
| 130 | - function ($data, $params) { |
|
| 130 | + function($data, $params) { |
|
| 131 | 131 | return str_replace([ |
| 132 | 132 | '%%PROJECT_PREFIX%%', |
| 133 | 133 | '%%MODULE_NAME%%', |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | copy($this->getSourceDir() . '/build/templates/defaults/app/modules/templates/WelcomeSuccess.php.tmpl', |
| 155 | 155 | $projectLocation . '/app/modules/Welcome/templates/IndexSuccess.php'); |
| 156 | 156 | |
| 157 | - mkdir($settings['project']['pub']. '/welcome', 0755, true); |
|
| 158 | - copy($this->getSourceDir() . '/build/templates/defaults/pub/welcome/bg.png', $settings['project']['pub']. '/welcome/bg.png'); |
|
| 159 | - copy($this->getSourceDir() . '/build/templates/defaults/pub/welcome/plant.png', $settings['project']['pub']. '/welcome/plant.png'); |
|
| 157 | + mkdir($settings['project']['pub'] . '/welcome', 0755, true); |
|
| 158 | + copy($this->getSourceDir() . '/build/templates/defaults/pub/welcome/bg.png', $settings['project']['pub'] . '/welcome/bg.png'); |
|
| 159 | + copy($this->getSourceDir() . '/build/templates/defaults/pub/welcome/plant.png', $settings['project']['pub'] . '/welcome/plant.png'); |
|
| 160 | 160 | |
| 161 | 161 | // Add the Default-module |
| 162 | 162 | $dcCommand = $this->getApplication()->find('agavi:module'); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | // Copy the default settings |
| 174 | 174 | foreach (glob($this->getSourceDir() . '/build/templates/defaults/app/config/*.xml.tmpl') as $file) { |
| 175 | - $fc->copy($file, $projectLocation . '/app/config/' . basename($file, '.tmpl'), function ($data, $params) { |
|
| 175 | + $fc->copy($file, $projectLocation . '/app/config/' . basename($file, '.tmpl'), function($data, $params) { |
|
| 176 | 176 | return str_replace([ |
| 177 | 177 | '%%AGAVI_SOURCE_LOCATION%%', |
| 178 | 178 | '%%PROJECT_LOCATION%%', |
@@ -408,6 +408,10 @@ |
||
| 408 | 408 | return $code; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | + /** |
|
| 412 | + * @param string $file |
|
| 413 | + * @param string $xpath |
|
| 414 | + */ |
|
| 411 | 415 | private function writeSettings($file, $xpath, $value, OutputInterface $output) |
| 412 | 416 | { |
| 413 | 417 | $document = new \DOMDocument(); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $fc->copy($this->getSourceDir() . '/build/templates/app/modules/controllers/Controller.class.php.tmpl', |
| 171 | 171 | $controllerFile, |
| 172 | - function ($data, $params) { |
|
| 172 | + function($data, $params) { |
|
| 173 | 173 | return str_replace([ |
| 174 | 174 | '%%PROJECT_PREFIX%%', |
| 175 | 175 | '%%MODULE_NAME%%', |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $fc->copy($this->getSourceDir() . '/build/templates/app/modules/validate/controller.xml.tmpl', |
| 208 | 208 | $validatorFile, |
| 209 | - function ($data, $params) { |
|
| 209 | + function($data, $params) { |
|
| 210 | 210 | return str_replace([ |
| 211 | 211 | '%%MODULE_NAME%%', |
| 212 | 212 | ], [ |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $fc->copy($this->getSourceDir() . '/build/templates/app/modules/cache/controller.xml.tmpl', |
| 228 | 228 | $cacheFile, |
| 229 | - function ($data, $params) { |
|
| 229 | + function($data, $params) { |
|
| 230 | 230 | return str_replace([ |
| 231 | 231 | '%%MODULE_NAME%%', |
| 232 | 232 | ], [ |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | $fc->copy($srcview, $viewFile, |
| 308 | - function ($data, $params) { |
|
| 308 | + function($data, $params) { |
|
| 309 | 309 | return str_replace([ |
| 310 | 310 | '%%PROJECT_PREFIX%%', |
| 311 | 311 | '%%MODULE_NAME%%', |
@@ -23,8 +23,6 @@ |
||
| 23 | 23 | namespace Agavi\Build\Console\Command; |
| 24 | 24 | |
| 25 | 25 | use Symfony\Component\Console\Exception\InvalidArgumentException; |
| 26 | -use Symfony\Component\Console\Helper\Helper; |
|
| 27 | -use Symfony\Component\Console\Input\ArrayInput; |
|
| 28 | 26 | use Symfony\Component\Console\Input\InputInterface; |
| 29 | 27 | use Symfony\Component\Console\Input\InputOption; |
| 30 | 28 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | /** |
| 94 | 94 | * Copy the files and replace the tokens in the template files |
| 95 | 95 | */ |
| 96 | - $fc->copy($this->getSourceDir() . '/build/templates/pub/index.php.tmpl', $dir . '/index.php', function ($data, $params) { |
|
| 96 | + $fc->copy($this->getSourceDir() . '/build/templates/pub/index.php.tmpl', $dir . '/index.php', function($data, $params) { |
|
| 97 | 97 | return str_replace([ |
| 98 | 98 | '%%AGAVI_SOURCE_LOCATION%%', |
| 99 | 99 | '%%PUBLIC_ENVIRONMENT%%', |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | [$environment] |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | - $fc->copy($this->getSourceDir() . '/build/templates/pub/dot.htaccess.tmpl', $dir . '/.htaccess', function ($data, $params) { |
|
| 111 | + $fc->copy($this->getSourceDir() . '/build/templates/pub/dot.htaccess.tmpl', $dir . '/.htaccess', function($data, $params) { |
|
| 112 | 112 | return str_replace([ |
| 113 | 113 | '%%AGAVI_SOURCE_LOCATION%%', |
| 114 | 114 | '%%PUBLIC_ENVIRONMENT%%', |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | namespace Agavi\Config; |
| 17 | 17 | |
| 18 | -use Agavi\Config\Util\Dom\XmlConfigDomElement; |
|
| 19 | 18 | use Agavi\Util\Inflector; |
| 20 | 19 | |
| 21 | 20 | /** |