Find MAMP's installed PHP version(s) you want to use the PHP CLI for:
$ ls -l /Applications/MAMP/bin/php/
- First, open your local user's
.bash_profilein edit mode, in order to add aliases for accessing the PHP CLI locally
$ pico ~/.bash_profile
| source_index=source_index | |
| target_index=target_index | |
| elastic_search_server=elasticsearch:9200 | |
| # Make sure the source index is actually open | |
| curl -X POST "${elastic_search_server}/${source_index}/_open" | |
| # Put the source index in read-only mode | |
| curl -X PUT "${elastic_search_server}/${source_index}/_settings" \ |
Find MAMP's installed PHP version(s) you want to use the PHP CLI for:
$ ls -l /Applications/MAMP/bin/php/
.bash_profile in edit mode, in order to add aliases for accessing the PHP CLI locally$ pico ~/.bash_profile
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| <?php | |
| // thx drupal8.ovh | |
| //// 1) How to get the current language in Drupal 8 | |
| //To get the lanuage code: | |
| $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); | |
| //To get the language name: | |
| $language = \Drupal::languageManager()->getCurrentLanguage()->getName(); |
| <?php | |
| /** | |
| * Notes: the project this was taken from attempted to limit a user to one coupon per order. | |
| * Some of the logic was taken directly from commerce_coupon 2.x. | |
| */ | |
| /** | |
| * Implements hook_init() | |
| */ |
| <?php | |
| // Make sure we are not on the user login route. | |
| if (\Drupal::routeMatch()->getRouteName() == 'user.login') { | |
| return; | |
| } | |
| // Check if the current user is logged in. | |
| if (\Drupal::currentUser()->isAnonymous()) { | |
| return; | |
| } |
| <?php | |
| // /src/Form/CollectPhone.php | |
| namespace Drupal\helloworld\Form; | |
| use Drupal\Core\Form\FormBase; | |
| use Drupal\Core\Form\FormStateInterface; // work witd data | |
| /** |
| <?php | |
| namespace Drupal\helloworld\Controller; | |
| use Drupal\Core\Controller\ControllerBase; | |
| class HelloWorldController extends ControllerBase { | |
| public function helloWorld() { | |
| <div class="contact_form news-form"> | |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-sm-12 text-center"> | |
| <h2> <span class="icons-a"><img src="<?php print drupal_get_path('theme', 'bartik');?>/img/news-letter-icon.png" alt="icon"></span> | |
| <?php print t("Newsletter");?></h2> | |
| <p><?php print $heading;?> </p> | |
| </div> | |
| </div> | |
| <div class="row contact_field"> |
| 1) In DB run request: | |
| UPDATE `pathauto_state` SET `pathauto`=1 WHERE `entity_type` = 'node' | |
| 2) Checked /admin/config/search/path/settings Create new alias, delete old | |
| 3) admin/config/search/path/update_bulk or /admin/content BULK update alias |