This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)
Given the code
syntax: | |
COMPOSER_MEMORY_LIMIT=-1 php-path composer-path update | |
example: | |
1) COMPOSER_MEMORY_LIMIT=-1 ea-php72 /opt/cpanel/composer/bin/composer update | |
2) COMPOSER_MEMORY_LIMIT=-1 /opt/cpanel/ea-php72/root/usr/bin/php /opt/cpanel/composer/bin/composer update |
git clone repo-url tmp && mv tmp/.git . && rm -rf tmp && git reset --hard | |
Explaination: | |
1) Do git clone in a tmp directory from current directory | |
2) move .git from tmp to the parent directory of tmp directory | |
3) reset git from the current directory |
//Controller | |
public function indexAction(Request $request) { | |
$products = new DataObject\Product\Listing(); | |
$paginator = new \Zend\Paginator\Paginator($products); | |
$paginator->setCurrentPageNumber($request->get('page')); | |
$paginator->setItemCountPerPage(20); | |
return $this->renderTemplate('Controller/index.html.twig', [ | |
'paginator' => $paginator | |
<?php | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
<VirtualHost *:80> | |
ServerName pim553bundle.local | |
DocumentRoot /var/www/html/pimcore/web | |
<Directory /var/www/html/pimcore/web/> | |
Options FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> | |
</VirtualHost> |
use Pimcore\Db; | |
$sql = "SELECT * from table_name where`id` = ?"; | |
$stmt = Db::get()->prepare($sql); | |
$stmt->bindParam(1, 101, \PDO::PARAM_INT); | |
$stmt->execute(); | |
$result = $stmt->fetchAll(); |
//In service file: /var/www/html/pimcore/src/AppBundle/Resources/config/services.yml | |
AppBundle\EventListener\TestListener: | |
tags: | |
- { name: kernel.event_listener, event: kernel.request } | |
//In listner file: /var/www/html/pf/src/AppBundle/EventListener/UserListener.php | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
class TestListener { |
<?php | |
/* | |
Plugin Name: WordPress - WP_List_Table - Custom | |
*/ | |
add_action( 'admin_menu','register_my_custom_menu_page'); | |
function register_my_custom_menu_page(){ | |
global $new_menu_page; | |
// creating admin menu |
<?php | |
/** | |
* Plugin Name: EDD Heartbeat API test plugin | |
* Description: Demonstrates how to use the Heartbeat API to update the payments count on the dashboard | |
*/ | |
// Load the heartbeat JS | |
function edd_heartbeat_enqueue( $hook_suffix ) { | |
// Make sure the JS part of the Heartbeat API is loaded. | |
wp_enqueue_script( 'heartbeat' ); |