| 1 | <?php |
||
| 13 | class m12_banner_dir extends \phpbb\db\migration\migration |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * {@inheritDoc} |
||
| 17 | */ |
||
| 18 | public function effectively_installed() |
||
| 19 | { |
||
| 20 | return file_exists($this->phpbb_root_path . 'images/phpbb_ads'); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * {@inheritDoc} |
||
| 25 | */ |
||
| 26 | static public function depends_on() |
||
| 27 | { |
||
| 28 | return array( |
||
| 29 | '\phpbb\ads\migrations\v10x\m1_initial_schema', |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Execute create_banner_dir() method |
||
| 35 | * |
||
| 36 | * @return array Array of data update instructions |
||
| 37 | */ |
||
| 38 | public function update_data() |
||
| 39 | { |
||
| 40 | return array('custom', array( |
||
| 41 | array(&$this, 'create_banner_dir') |
||
| 42 | )), |
||
|
|
|||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Create images/phpbb_ads directory |
||
| 47 | * |
||
| 48 | * @return void |
||
| 49 | */ |
||
| 50 | public function create_banner_dir() |
||
| 51 | { |
||
| 52 | mkdir($this->phpbb_root_path . 'images/phpbb_ads', 0777, true); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |