// Display the Header require HEADER_PATH; // Display the Page echo ' <h1>Installation: Classes</h1> <h3>Step #1 - Install Core Classes</h3> <p>The core plugins are the plugins that are provided by default in the engine. The core functionality of the system depends on many of these plugins. This step will automatically install them.</p>'; // Loop through each class and install it $configPaths = File_Scan::scanRecursive(SYS_PATH . "/core-classes", "*.config.php"); foreach ($configPaths as $configPath) { // Extract the name of this class $class = str_replace(".config.php", "", basename($configPath)); // Load the Class's Config Class if (!($classConfig = Classes_Meta::getConfig($class, SYS_PATH . "/core-classes"))) { echo '<h4 style="color:red;">' . $class . '</h4> <p><span style="color:red;">The class\'s config class was inaccessible.</span></p>'; } // Install the Class $installed = Classes_Meta::install($class); switch ($installed) { case Classes_Meta::DEPENDENCIES_MISSING: $details = '<span style="color:red; font-weight:700;">This installation requires dependencies that were not installed properly.</span>'; break; case Classes_Meta::INSTALL_FAILED: $details = '<span style="color:red; font-weight:700;">Installation failed. Core functionality may be broken.</span>'; break; case Classes_Meta::INSTALL_SUCCEEDED: $details = '<span style="color:green; font-weight:700;">Installation was completed successfully.</span>'; break;
// Display the Page echo ' <h1>Installation: Classes</h1> <h3>Step #1 - Install Application Classes</h3> <p>These plugins will ONLY be used within the `' . SITE_HANDLE . '` application you are setting up - NOT through the entire system. By default, they must be saved in your application in the /classes directory.</p> <p>Note: Application plugins will overwrite the functionality of core and plugin classes if you use the same plugin name.</p>'; // Loop through each class and install it $configPaths = File_Scan::scanRecursive(APP_PATH . "/classes", "*.config.php"); foreach ($configPaths as $configPath) { // Extract the name of this class $class = str_replace(".config.php", "", basename($configPath)); // Load the Class's Config Class if (!($classConfig = Classes_Meta::getConfig($class, APP_PATH . "/classes"))) { echo '<h4 style="color:red;">' . $class . '</h4> <p><span style="color:red;">The plugin\'s config class was inaccessible.</span></p>'; continue; } // Bypass installation plugins if ($class == "Install") { $installed = Install::setup() ? 1 : -1; } else { // Install Standard Class Types (not installation) $installed = Classes_Meta::install($class); } switch ($installed) { case Classes_Meta::DEPENDENCIES_MISSING: $details = '<span style="color:red; font-weight:700;">This installation requires dependencies that were not installed properly.</span>'; break;
<tr> <td style="max-width:100px; overflow:hidden;"><a href="/admin/Class/Class Details/' . $class . '">' . $class . '</a></td> <td>' . $classConfig->description . '</td> </tr>'; } } echo ' </table>'; // Scan through the plugins directory $classs = Dir::getFolders(CORE_PLUGIN_PATH); echo ' <h3 style="margin-top:22px;">Core Classes</h3> <table class="mod-table">'; foreach ($classs as $class) { // Reject class names that aren't valid if (!ctype_alnum($class)) { continue; } if ($classConfig = Classes_Meta::getConfig($class)) { echo ' <tr> <td style="max-width:100px; overflow:hidden;"><a href="/admin/Class/Class Details/' . $class . '">' . $class . '</a></td> <td>' . $classConfig->description . '</td> </tr>'; } } echo ' </table>'; } // Display the Footer require SYS_PATH . "/controller/includes/admin_footer.php";
public static function delete($class, $dir = "") { // Get the plugin configurations, so that we can identify the file's directory if (!($classConfig = Classes_Meta::getConfig($class, $dir))) { return false; } // Make sure the file exists if (!File::exists($classConfig->data['path'] . '/hhvm/' . $classConfig->pluginName . '.php')) { return false; } // Delete the file return File::delete($classConfig->data['path'] . '/hhvm/' . $classConfig->pluginName . '.php'); }