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
<?php | |
// Creating tables in Single site installations | |
function on_activate() { | |
create_table(); | |
} | |
function create_table() { | |
global $wpdb; | |
$table_name = $wpdb->prefix . 'table_name'; |
//For Primary Blog | |
UPDATE `wp_options` SET `option_value`='http://www.test.com' WHERE `option_name`='siteurl'; | |
UPDATE `wp_options` SET `option_value`='http://www.test.com' WHERE `option_name`='home'; | |
//For Secondary Blog | |
UPDATE `wp_2_options` SET `option_value`='http://www.test.com/blog_2' WHERE `option_name`='siteurl'; | |
UPDATE `wp_2_options` SET `option_value`='http://www.test.com/blog_2' WHERE `option_name`='home'; | |
//Repeat the above codes for all the remaining blogs | |
<?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' ); |
//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 { |
<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> |
<?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 | |
* |
//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 | |
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 |
Here is a sample command: | |
/usr/local/bin/ea-php72 /home/atunp/public_html/bin/console app:test |