View Single Post
  #5  
Old 2nd June 2013, 12:35
buffus buffus is offline
Junior Member
 
Join Date: Nov 2011
Posts: 18
Thanks: 8
Thanked 1 Time in 1 Post
Default

Thank you. I have this code and symlink in plugins-enabled is created.

But not working (It doesn't create the directory test.). What is wrong please?

PHP Code:
<?php

class customapache2_plugin
{
    public 
$plugin_name 'customapache2_plugin';
    public 
$class_name 'customapache2_plugin';

    
/**
    This function is called when the plugin is loaded
    */
    
function onLoad() {
        global 
$app;

        
//    Register for the events
        
$app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'add_dir_test');
    }


    function 
add_dir_test($event_name,$data) {
        global 
$app;

        
//    Create folder test
        
if(!is_dir($data['new']['document_root'].'/test')) $app->system->mkdirpath($data['new']['document_root'].'/test');
    }
}
Reply With Quote