This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $query = \Drupal::entityQuery('cub'); | |
| $result = $query->execute(); | |
| $entidades = function ($result){ | |
| $list = []; | |
| foreach($result as $cub) { | |
| $list[] = $cub; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ curl -I http://d7.local/node/3 | |
| HTTP/1.1 200 OK | |
| Date: Mon, 06 Feb 2017 12:09:49 GMT | |
| Server: Apache/2.4.10 (Debian) | |
| X-Content-Type-Options: nosniff | |
| X-Drupal-Cache: HIT | |
| Etag: "1486381624-0" | |
| Content-Language: es | |
| X-Frame-Options: SAMEORIGIN | |
| Link: </node/3>; rel="shortlink",</node/3>; rel="canonical" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Help menu | |
| print_help() { | |
| cat <<-HELP | |
| This script is used to fix permissions of a Drupal installation | |
| you need to provide the following arguments: | |
| 1) Path to your Drupal installation. | |
| 2) Username of the user that you want to give files/directories ownership. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Remove keys with empty values. | |
| * @param array $array | |
| * | |
| * @return array | |
| */ | |
| function clean_empty_values(array $array) { | |
| return array_filter($array, function ($item) { | |
| return empty($item) ? FALSE : TRUE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: oskar | |
| * Date: 3/10/17 | |
| * Time: 10:00 | |
| */ | |
| $time_start = microtime(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| <?php | |
| namespace SwitchClass; | |
| $time_start = microtime(true); | |
| echo memory_get_usage(), "\n"; | |
| /** | |
| * Created by PhpStorm. | |
| * User: oskar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04 | |
| Switch PHP version: | |
| From php5.6 to php7.0: | |
| Apache: | |
| sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart | |
| CLI: | |
| sudo update-alternatives --set php /usr/bin/php7.0 | |
| From php7.0 to php5.6: | |
| Apache: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $query = \Drupal::entityQuery('cub'); | |
| $result = $query->execute(); | |
| $entidades = array_values($result); | |
| // object $entidad con todas los registros guardasdos de cub | |
| $entidad = entity_load_multiple('cub', $entidades); | |
| ?> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This file is included very early. See autoload.files in composer.json and | |
| * https://getcomposer.org/doc/04-schema.md#files | |
| */ | |
| use Dotenv\Dotenv; | |
| use Dotenv\Exception\InvalidPathException; |