<?php $code = "<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> * (c) 2004-2006 Sean Kerr <sean@code-box.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfAction executes all the logic for the current request. * * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @author Sean Kerr <sean@code-box.org> * * @method sfWebController getController() * @method sfWebResponse getResponse() */ abstract class sfAction extends sfComponent { protected \$security = []; /** * Initializes this action. * * @param sfContext \$context the current application context * @param string \$moduleName the module name * @param string \$actionName the action name */ public function initialize(\$context, \$moduleName, \$actionName) { parent::initialize(\$context, \$moduleName, \$actionName); // include security configuration if (\$file = \$context->getConfigCache()->checkConfig('modules/'.\$this->getModuleName().'/config/security.yml', true)) { require \$file; } } }"; $replaceRegex = '/^(?:<pre><code(?: [^>]+)?>|<code><span(?: [^>]+)?>\s*)(.*?)(?:<\/code><\/pre>|\s*<\/span>\s*<\/code>)$/s'; $splitRegex = '/(\r\n|\n|\r|<br \/>)/'; $content = preg_replace($replaceRegex, '$1', highlight_string($code, true)); $content = preg_split($splitRegex, $content); echo sprintf("Expected 41 lines, got %s lines\n\n", count($content)); $line = 37; $lines = []; for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; ++$i) { $lines[] = '<li'.($i == $line ? ' class="selected"' : '').'>'.$content[$i - 1].'</li>'; } echo '<ol start="'.max($line - 3, 1).'">'.implode("\n", $lines).'</ol>';
You have javascript disabled. You will not be able to edit any code.