Trouble installing a custom package
Permalink
Hello everyone,
I am having some issues getting my package to install correctly. I have attached a screenshot of my directory structure... Currently I can see the package under "Awaiting Installation" but when I click install the page just refreshes and nothing is actually installed. So here is my code:
Block "duas_new_event":
Controller.php
db.xml
Package controller.php
Any help would be appreciated, thank you!
I am having some issues getting my package to install correctly. I have attached a screenshot of my directory structure... Currently I can see the package under "Awaiting Installation" but when I click install the page just refreshes and nothing is actually installed. So here is my code:
Block "duas_new_event":
Controller.php
<?php defined('C5_EXECUTE') or die("Access Denied."); class DuasNewEventBlockController extends BlockController { protected $btTable = "btDuasEvents"; protected $btInterfaceWidth = "350"; protected $btInterfaceHeight = "350"; public function getBlockTypeDescription() { return t("This is a block custom designed"); } public function getBlockTypeName() { return t("DUAS - New Event"); } } ?>
db.xml
<?xml version="1.0"?> <schema version="0.3"> <table name="btDuasEvents"> <field name="bID" type="I"> <key></key> <unsigned></unsigned> </field> <field name="event_id" type="I"> <autoincrement></autoincrement> <unsigned></unsigned> </field> <field name="event_name" type="C" size="45"></field> <field name="event_type" type="C" size="45"></field> <field name="event_date" type="T"></field> <field name="bro_id" type="I"></field>
Viewing 15 lines of 17 lines. View entire code block.
Package controller.php
<?php class DuAttendanceSystemPackage extends Package { protected $pkgHandle = 'DuAttendanceSystemPackage'; protected $appVersionRequired = '5.6'; protected $pkgVersion = '0.3'; public function getPackageDescription() { return t("This is a package custom designed"); } public function getPackageName() { return t("DU Attendance System"); } public function install() { $pkg = parent::install(); BlockType::installBlockTypeFromPackage('duas_new_event'); }
Viewing 15 lines of 17 lines. View entire code block.
Any help would be appreciated, thank you!
Thanks for the help! I passed in my package but that didn't seem to fix the issue. Any other suggestions?
I fixed the issue, I had the package handel ($pkgHandle) to the name of the parent package directory. Thank you for y'alls help!
So instead of:
I'd normally put: