Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPCI should not require PHP's short_open_tag setting to be enabled. #11

Closed
MarkMaldaba opened this issue May 14, 2013 · 4 comments
Closed
Assignees
Milestone

Comments

@MarkMaldaba
Copy link
Contributor

PHPCI indicates a minimum requirement of PHP 5.3, and on PHP < 5.4 short tags of the form used in the .phtml files (i.e. ) are only available if short_open_tag is enabled in php.ini.

Whilst it is probably more often enabled than not, it is also frequently disabled for various reasons, primarily (but not necessarily exclusively) regarding XML compatibility.

In order to support PHP 5.3 properly, the code should not require this setting to be enabled. For example, I have just spent 30 minutes trying to figure out why I was getting a blank login screen, only to eventually trace it to this issue.

I attempted to resolve this issue in PHPCI, and committed an initial pull request that did the necessary replacement of "<?=" with "<?php echo" across the code-base (see #10). However, I realised that this would also need fixing for the .phtml files in the b8framework's Form module in order to remove the dependency completely.

I agree that it makes the code less neat, but I think that is the lesser of two evils if this is going to be a serious contender in the CI arena.

@ghost ghost assigned dancryer May 14, 2013
@dancryer
Copy link
Owner

Fixed in master, you'll need to run a composer update to pull the updated b8framework too.

@MarkMaldaba
Copy link
Contributor Author

Hi there,

I've done a composer update, and am now on block8/b8framework dev-master, commit d6649972547c3a4085dea44bbd6405025972187e. However this still has a number of instances of the <?= tag. Am I on the wrong revision, or have you missed some?

Here's the output of grep "<?=" -r . in the vendor/block8 folder.

./b8framework/b8/Form/View/Button.phtml:<input class="btn <?= $css; ?>" type="<?= $type; ?>" value="<?= $value; ?>">
./b8framework/b8/Form/View/Checkbox.phtml:<div class="control-group <?= $ccss ?> <?= (isset($error) ? 'error' : ''); ?>">
./b8framework/b8/Form/View/Checkbox.phtml:              <label class="checkbox <?= $css; ?>" for="<?= $id ?>">
./b8framework/b8/Form/View/Checkbox.phtml:                      <input type="checkbox" id="<?= $id; ?>" name="<?= $name; ?>" value="<?= $checkedValue; ?>" <?= ($checked ? 'checked' : ''); ?> <?= $required ? 'required' : '' ?>>
./b8framework/b8/Form/View/Checkbox.phtml:                      <?= $label; ?>
./b8framework/b8/Form/View/Checkbox.phtml:                      <span class="help-block"><?= $error; ?></span>
./b8framework/b8/Form/View/CheckboxGroup.phtml:<div class="control-group <?= $css; ?>">
./b8framework/b8/Form/View/CheckboxGroup.phtml:         <label class="control-label"><?= $label; ?></label>
./b8framework/b8/Form/View/CheckboxGroup.phtml:                 <?= $field; ?>
./b8framework/b8/Form/View/ControlGroup.phtml:<div class="control-group <?= $css; ?>">
./b8framework/b8/Form/View/ControlGroup.phtml:          <?= $field; ?>
./b8framework/b8/Form/View/Csrf.phtml:<input type="hidden" id="<?= $id; ?>" name="<?= $name; ?>" value="<?= $csrf; ?>">
./b8framework/b8/Form/View/FieldSet.phtml:<fieldset class="row <?= $css; ?>">
./b8framework/b8/Form/View/FieldSet.phtml:      <legend><?= $label; ?></legend>
./b8framework/b8/Form/View/FieldSet.phtml:              <?= $field; ?>
./b8framework/b8/Form/View/Form.phtml:<form id="<?= $id; ?>" class="<?= $css; ?>" action="<?= $action; ?>" method="<?= $method; ?>">
./b8framework/b8/Form/View/Form.phtml:  <?= $field; ?>
./b8framework/b8/Form/View/Hidden.phtml:<input type="hidden" id="<?= $id; ?>" name="<?= $name; ?>" value="<?= $value; ?>">
./b8framework/b8/Form/View/Radio.phtml:<div id="<?= $id; ?>" class="control-group <?= $ccss; ?>">
./b8framework/b8/Form/View/Radio.phtml:         <label class="control-label"><?= $label; ?></label>
./b8framework/b8/Form/View/Radio.phtml: <label class="radio" for="radio-<?= $id; ?>-<?= $val; ?>">
./b8framework/b8/Form/View/Radio.phtml:         <input type="radio" id="radio-<?= $id; ?>-<?= $val; ?>" class="<?= $css; ?>" name="<?= $name; ?>" value="<?= $val; ?>" <?= ($value == $val) ? ' checked="checked"' : ''; ?> <?= $required ? 'required' : '' ?>>
./b8framework/b8/Form/View/Radio.phtml:         <?= $lbl; ?>
./b8framework/b8/Form/View/Radio.phtml:                 <span class="help-block"><?= $error; ?></span>
./b8framework/b8/Form/View/Select.phtml:<div class="control-group <?= $ccss; ?>">
./b8framework/b8/Form/View/Select.phtml:                <label class="control-label" for="<?= $id ?>"><?= $label; ?></label>
./b8framework/b8/Form/View/Select.phtml:        <select id="<?= $id; ?>" class="<?= $css; ?>" name="<?= $name; ?>">
./b8framework/b8/Form/View/Select.phtml:                <option value="<?= $val; ?>" <?= ($value == $val) ? ' selected="selected"' : ''; ?>><?= $lbl; ?></option>
./b8framework/b8/Form/View/Select.phtml:                        <span class="help-block"><?= $error; ?></span>
./b8framework/b8/Form/View/Text.phtml:<div class="control-group <?= $ccss; ?> <?= (isset($error) ? 'error' : ''); ?>">
./b8framework/b8/Form/View/Text.phtml:  <label class="control-label" for="<?= $id ?>"><?= $label; ?></label>
./b8framework/b8/Form/View/Text.phtml:          <input id="<?= $id; ?>" type="<?= $type; ?>" class="<?= $css; ?>" name="<?= $name; ?>" <?= isset($value) ? ' value="' . $value . '"' : '' ?> <?= isset($pattern) ? ' pattern="' . $pattern . '"' : '' ?> <?= $required ? ' required' : '' ?>>
./b8framework/b8/Form/View/Text.phtml:          <span class="help-block"><?= $error; ?></span>
./b8framework/b8/Form/View/TextArea.phtml:<div class="control-group <?= $ccss; ?> <?= (isset($error) ? 'error' : ''); ?>">
./b8framework/b8/Form/View/TextArea.phtml:              <label class="control-label" for="<?= $id ?>"><?= $label; ?></label>
./b8framework/b8/Form/View/TextArea.phtml:              <textarea rows="<?= $rows; ?>" id="<?= $id; ?>" class="<?= $css; ?>" name="<?= $name; ?>" <?= $required? ' required' : '' ?>><?= isset($value) ? $value : '' ?></textarea>
./b8framework/b8/Form/View/TextArea.phtml:                      <span class="help-block"><?= $error; ?></span>

@dancryer
Copy link
Owner

I may have pushed the wrong changeset to the b8framework repo last night. Try do another Composer update in a couple of minutes (let Packagist pick it up) and you should be all set.

@MarkMaldaba
Copy link
Contributor Author

Great - that's done the trick. Thanks Dan.

prezire pushed a commit to prezire/PHPCI that referenced this issue Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants