public static function PublishEngine($siteId) { $site = Site::GetBySiteId($siteId); // publish common JS (libs) Publish::PublishCommonJS($site); // publish common css (libs) Publish::PublishCommonCSS($site); // publish plugins Publish::PublishPlugins($site); // publish locales Publish::PublishLocales($site); // setup htaccess Publish::SetupHtaccess($site); // update version Site::EditVersion($site['SiteId'], VERSION); }
public static function PublishSite($siteUniqId, $root = '../') { // publish sitemap Publish::PublishSiteMap($siteUniqId, $root); // publish all CSS Publish::PublishAllCSS($siteUniqId, $root); // publish all pages Publish::PublishAllPages($siteUniqId, $root); // publish rss for page types Publish::PublishRssForPageTypes($siteUniqId, $root); // publish menu Publish::PublishMenu($siteUniqId, $root); // publish common js Publish::PublishCommonJS($siteUniqId, $root); // publish common css Publish::PublishCommonCSS($siteUniqId, $root); // publish controller Publish::PublishCommon($siteUniqId, $root); // publish plugins Publish::PublishPlugins($siteUniqId, $root); }
public static function PublishCommonJS($siteId) { $site = Site::GetBySiteId($siteId); $src = APP_LOCATION . '/site/js'; $dest = SITES_LOCATION . '/' . $site['FriendlyId'] . '/js'; // create dir if it doesn't exist if (!file_exists($dest)) { mkdir($dest, 0755, true); } // copies a directory Utilities::CopyDirectory($src, $dest); if ($site['UrlMode'] == 'static') { // get static version of respond.site.js $src_file = APP_LOCATION . '/site/js/static/respond.site.js'; $dest_file = SITES_LOCATION . '/' . $site['FriendlyId'] . '/js/respond.site.js'; $content = file_get_contents($src_file); // get language $language = $site['Language']; // set language $content = str_replace('{{language}}', $language, $content); // update site file file_put_contents($dest_file, $content); // inject controllers Publish::InjectControllers($site); } else { // inject states Publish::InjectStates($site); } // publish plugins Publish::PublishPlugins($site); // combine JS Publish::CombineJS($site); }