Include/ init the front end class on the front end only

@param bool $load_in_admin Optional. Whether to load in admin. Default is false.

@return Pods_PFAT_Frontend

@since 2.5.5
322486
public function front_end( $load_in_admin = false ) {

		if ( ! is_admin() || $load_in_admin ) {
			include_once dirname( __FILE__ ) . '/Pods_Templates_Auto_Template_Front_End.php';

			// Only instantiate if we haven't already
			if ( is_null( $this->front_end_class ) ) {
				$this->front_end_class = new Pods_Templates_Auto_Template_Front_End();
			}

			return $this->front_end_class;
		}

	}
359510
function load( $flush = false ) {
            $this->_logger->entrance();

            $option_name = $this->get_option_manager_name();

            if ( $flush || ! isset( $this->_options ) ) {
                if ( isset( $this->_options ) ) {
                    // Clear prev options.
                    $this->clear();
                }

                $cache_group = $this->get_cache_group();

                if ( ! WP_FS__DEBUG_SDK ) {

                    $this->_options = wp_cache_get(
                        $option_name,
                        $cache_group
                    );
                }

                $cached = true;

                if ( empty( $this->_options ) ) {
                    if ( $this->_is_network_storage ) {
                        $this->_options = get_site_option( $option_name );
                    } else if ( $this->_blog_id > 0 ) {
                        $this->_options = get_blog_option( $this->_blog_id, $option_name );
                    } else {
                        $this->_options = get_option( $option_name );
                    }

                    if ( is_string( $this->_options ) ) {
                        $this->_options = json_decode( $this->_options );
                    }

//					$this->_logger->info('get_option = ' . var_export($this->_options, true));

                    if ( false === $this->_options ) {
                        $this->clear();
                    }

                    $cached = false;
                }

                if ( ! WP_FS__DEBUG_SDK && ! $cached ) {
                    // Set non encoded cache.
                    wp_cache_set( $option_name, $this->_options, $cache_group );
                }
            }
        }
328928
protected function Init()
    {
        $contentContainer = ContentContainer::Schema()->ByContent($this->content);
        $tree = new ContainerContentTreeProvider($contentContainer->GetContainer());
        
        $renderer = new ContentsRenderer($tree->TopMost(), $tree);
        $this->contents = $renderer->Render();
        return parent::Init();
    }
1283219
public function init()
    {
        // Requires WordPress 4.1
        if (version_compare($GLOBALS['wp_version'], self::MIN_WP_VER, '<')) {
            Compat::loadNotices();
        }

        // core actions
        add_action('after_setup_theme', [$this->theme, 'addThemeSupports']);
        add_action('widgets_init', [$this->theme, 'registerWidgets']);
        add_action('wp_enqueue_scripts', [$this->assets, 'loadSiteScripts']);
        add_action('wp_enqueue_scripts', [$this->assets, 'loadSiteStyles']);
        add_action('admin_enqueue_scripts', [$this->assets, 'loadAdminScripts']);
        add_action('admin_enqueue_scripts', [$this->assets, 'loadAdminStyles']);
        add_action('login_enqueue_scripts', [$this->assets, 'loadLoginScripts']);
        add_action('login_enqueue_scripts', [$this->assets, 'loadLoginStyles']);

        // meta elements
        add_action('wp_head', [$this->viewMeta, 'render'], 1);

        // theme customizations
        add_action('customize_register', [$this->customizer, 'register']);
        add_action('customize_preview_init', [$this->assets, 'loadCustomizeScript']);
    }
1308759
public static function Init()
    {
        add_filter('template_include',function($t){
        return get_template_directory().'/index.php';
        });
        add_filter('theme_templates', array('Balise\AnchorFramework\Anchor', 'loadThemeTemplates'), 10, 4);
        $types = array('index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'embed', 'home', 'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment');
        foreach ($types as $type) {
            add_filter("{$type}_template", array('Balise\AnchorFramework\Anchor', 'getThemeTemplate'), 10, 3);
        }
        
        if (!self::$renderer) {
            $paths = new \SplPriorityQueue;
            $paths->insert(get_template_directory() . '/app/views', 200);
            $paths->insert(dirname(__DIR__) . '/views', 100);
            self::$renderer = new BladeRenderer($paths, array('cache_path' => get_template_directory() . '/public/views/'));
            self::$renderer->addCustomCompiler('wp_head', function ($expression) {
                return '<?php wp_head(); ?>';
            });
            self::$renderer->addCustomCompiler('doquery', function ($expression) {
                return '<?php
                if (!isset($__posts)) { $posts = array(); }
                $__posts[] = $posts;
                
                $args = '.$expression.';

                if (@!$args["paged"]) {
                   $args["paged"] = get_query_var( "paged", 1 );
                }
                $query = new WP_Query($args);
                $posts = array_map(function($post){
                    return new \Balise\AnchorFramework\PostWrapper($post, true);
                }, $query->posts);

                ?>
                ';
            });
            self::$renderer->addCustomCompiler('endquery', function () {
                return '<?php
                $posts = array_pop($__posts);

                ?>
                ';
            });

            self::$renderer->addCustomCompiler('wp_footer', function ($expression) {
                return '<?php wp_footer(); ?>';
            });
        }
    }
500513
public function init($reload = false)
    {
        if (!$this->useCache) {
            $reload = true;
        }

        if (file_exists($this->cacheFile) && !$reload) {
            $this->data = $this->getFileManager()->getPhpContents($this->cacheFile);
        } else {
            $this->clearVars();
            $objData = $this->getAllObjects(false, $reload);
            $this->data = Util::objectToArray($objData);

            if ($this->useCache) {
                $isSaved = $this->getFileManager()->putPhpContents($this->cacheFile, $this->data);
                if ($isSaved === false) {
                    $GLOBALS['log']->emergency('Metadata:init() - metadata has not been saved to a cache file');
                }
            }
        }
    }
72096
public function child($name, $load = false)
    {
        if (!isset($this->_children[$name])){
            if ($load){
                $this->_children[$name] = Data::read($this->uri().'/'.$name);
            }else{
                return false;
            }
        }
        return $this->_children[$name];
    }
270203
public function initialize() {
    $headers = parent::$upload_start_header;

    $token_header = $this->getOAuthTokenHeader(parent::WRITE_SCOPE);
    if ($token_header === false) {
      trigger_error("Unable to acquire OAuth token.", E_USER_WARNING);
      return false;
    }
    $headers = array_merge($headers, $token_header);

    // TODO: b/13132830: Remove once feature releases.
    if (!ini_get('google_app_engine.enable_additional_cloud_storage_headers')) {
      foreach (static::$METADATA_HEADERS as $key) {
        // Leave Content-Type since it has been supported.
        if ($key != 'Content-Type') {
          unset($this->context_options[$key]);
        }
      }
    }

    foreach (static::$METADATA_HEADERS as $key) {
      if (array_key_exists($key, $this->context_options)) {
        $headers[$key] = $this->context_options[$key];
      }
    }

    if (array_key_exists("acl", $this->context_options)) {
      $acl = $this->context_options["acl"];
      if (in_array($acl, parent::$valid_acl_values)) {
        $headers["x-goog-acl"] = $acl;
      } else {
        trigger_error(sprintf("Invalid ACL value: %s", $acl), E_USER_WARNING);
        return false;
      }
    }

    if (array_key_exists("metadata", $this->context_options)) {
      $metadata = $this->context_options["metadata"];
      foreach ($metadata as $name => $value) {
        if (!preg_match(self::METADATA_KEY_REGEX, $name)) {
          trigger_error(sprintf("Invalid metadata key: %s", $name),
              E_USER_WARNING);
          return false;
        }
        if (!preg_match(self::METADATA_VALUE_REGEX, $value)) {
          trigger_error(sprintf("Invalid metadata value: %s", $value),
              E_USER_WARNING);
          return false;
        }
        $headers['x-goog-meta-' . $name] = $value;
        $this->metadata[$name] = $value;
      }
    }

    $http_response = $this->makeHttpRequest($this->url,
                                            "POST",
                                            $headers);

    if ($http_response === false) {
      trigger_error("Unable to connect to Google Cloud Storage Service.",
                    E_USER_WARNING);
      return false;
    }

    $status_code = $http_response['status_code'];
    if ($status_code == HttpResponse::FORBIDDEN) {
      trigger_error("Access Denied", E_USER_WARNING);
      return false;
    }
    if ($status_code != HttpResponse::CREATED) {
      trigger_error($this->getErrorMessage($http_response['status_code'],
                                           $http_response['body']),
                    E_USER_WARNING);
      return false;
    }

    $location = $this->getHeaderValue("Location", $http_response['headers']);

    $query_str = parse_url($location)["query"];
    parse_str($query_str, $query_arr);
    $this->upload_id = $query_arr["upload_id"];

    if (!isset($this->upload_id)) {
      trigger_error(sprintf("Location Header was not returned (%s).",
                            implode(",",
                                    array_keys($http_response['headers']))),
                    E_USER_WARNING);
      return false;
    }

    $this->buffer_start_offset = 0;
    $this->total_bytes_uploaded = 0;
    $this->byte_buffer = "";
    return true;
  }
354701
public static function init() {
		if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) {
			self::$instance = new Loader();
			$modules        = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) );
			foreach ( $modules as $key => $module ) {
				if ( ! class_exists( 'ThemeisleSDK\\Modules\\' . ucwords( $module, '_' ) ) ) {
					unset( $modules[ $key ] );
				}
			}
			self::$available_modules = $modules;
		}
	}
1169695
public function load()
    {
        if (false === $this->isLoaded) {
            $this->getEventManager()->trigger(
                __FUNCTION__ . '.pre',
                $this,
                []
            );

            $this->generate();
            $this->injectBlocks();
            $this->isLoaded = true;

            $this->getEventManager()->trigger(
                __FUNCTION__ . '.post',
                $this,
                []
            );
        }
        return $this;
    }
915107
public function load()
    {
        // NOTE: ALL THE LOCAL VARIABLES ARE USED INSIDE INCLUDED FILE, DO NOT REMOVE THEM!
        $grav = $this->grav;
        $config = $this->config;
        $name = $this->current();

        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];
        $file = $locator('theme://theme.php') ?: $locator("theme://{$name}.php");

        $inflector = $grav['inflector'];

        if ($file) {
            // Local variables available in the file: $grav, $config, $name, $file
            $class = include $file;

            if (!is_object($class)) {
                $themeClassFormat = [
                    'Grav\\Theme\\' . ucfirst($name),
                    'Grav\\Theme\\' . $inflector->camelize($name)
                ];

                foreach ($themeClassFormat as $themeClass) {
                    if (class_exists($themeClass)) {
                        $themeClassName = $themeClass;
                        $class = new $themeClassName($grav, $config, $name);
                        break;
                    }
                }
            }
        } elseif (!$locator('theme://') && !defined('GRAV_CLI')) {
            exit("Theme '$name' does not exist, unable to display page.");
        }

        $this->config->set('theme', $config->get('themes.' . $name));

        if (empty($class)) {
            $class = new Theme($grav, $config, $name);
        }

        return $class;
    }
1086048
public function init_template_loader() {
		$loader_class  = $this->hasConfigKey( 'template', 'custom_loader' )
			? $this->getConfigKey( 'template', 'custom_loader' )
			: $this->get_default_template_loader_class();
		$filter_prefix = $this->hasConfigKey( 'template', 'filter_prefix' )
			? $this->getConfigKey( 'template', 'filter_prefix' )
			: $this->get_default_filter_prefix();
		$template_dir  = $this->hasConfigKey( 'template', 'template_directory' )
			? $this->getConfigKey( 'template', 'template_directory' )
			: $this->get_default_template_directory();
		$view_dir      = $this->hasConfigKey( 'view' )
			? $this->get_directory_from_view( $this->getConfigKey( 'view' ) )
			: $this->get_default_view_directory();

		return new $loader_class(
			$filter_prefix,
			$template_dir,
			$view_dir
		);
	}
888352
public function init() {

		parent::init();

		// Views
		$this->setViewPath( '@cmsgears/module-cms/admin/views/form' );

		// Permission
		$this->crudPermission = FormsGlobal::PERM_FORM_ADMIN;

		// Config
		$this->type			= CoreGlobal::TYPE_FORM;
		$this->templateType	= CoreGlobal::TYPE_FORM;
		$this->apixBase		= 'cms/form';

		// Services
		$this->modelService		= Yii::$app->factory->get( 'formService' );
		$this->templateService	= Yii::$app->factory->get( 'templateService' );

		$this->modelContentService	= Yii::$app->factory->get( 'modelContentService' );

		// Sidebar
		$this->sidebar = [ 'parent' => 'sidebar-form', 'child' => 'form' ];

		// Return Url
		$this->returnUrl = Url::previous( 'forms' );
		$this->returnUrl = isset( $this->returnUrl ) ? $this->returnUrl : Url::toRoute( [ '/cms/form/all' ], true );

		// Breadcrumbs
		$this->breadcrumbs	= [
			'base' => [
				[ 'label' => 'Home', 'url' => Url::toRoute( '/dashboard' ) ]
			],
			'all' => [ [ 'label' => 'Forms' ] ],
			'create' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Add' ] ],
			'update' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Update' ] ],
			'delete' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Delete' ] ],
			'gallery' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Gallery' ] ],
			'data' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Data' ] ],
			'config' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Config' ] ],
			'settings' => [ [ 'label' => 'Forms', 'url' => $this->returnUrl ], [ 'label' => 'Settings' ] ]
		];
	}
189377
public function init()
	{
		// parse request to find out whether is an ajax request or not, if so, then return $dataProvider JSON formatted
		$this->json = Yii::app()->getRequest()->getIsAjaxRequest();
		if ($this->json) {
			$this->_showSummary = (strpos($this->template, '{summary}')) ? true : false;
			$this->template = '{items}';
		} // going to render only items!

		parent::init();
	}
1097456
private static function init($class)
    {
        self::$_init[$class] = true;

        if (isset($_GET['cms_content_version']) && ctype_digit($_GET['cms_content_version'])) {
            self::$_version = (int)$_GET['cms_content_version'];
        }

        $cache_key = 'components_' . PAGE_ID . '_v_' . self::$_version;
        $res = NULL;
        if (Settings::isCacheEnabled()) {
            $res = Cacher::getInstance()->getDefaultCacher()->get($cache_key);
        }

        if (is_array($res)) { // Set from cache
            self::$_components[$class] = $res;
        } else { // Get from DB
            if (self::$_version) {
                // From history
                $components_collection = new PageComponentHistoryRepository();
                $components_collection->setWhereVersion(self::$_version);
            } else {
                // From current version
                $components_collection = new PageComponentEntityRepository();
            }
            $components_collection->setWherePageId(PAGE_ID);
            self::$_components[$class] = $components_collection->getPairs('data', 'component');

            // Get Custom components
            $customs = new PageComponentCustomEntityRepository();
            $customs->setWherePageId(PAGE_ID);
            $customs->setWhereComponent($class);
            $customs->addOrderByField('order');

            $custom_components_in_database = $customs->getAsArrayOfObjectData(true);
            foreach ($custom_components_in_database as $custom) {
                self::$_components[$class][$class . '_' . $custom['tab']][$custom['order']][$custom['name']] = $custom['value'];
            }

            // Make all custom components have all fields
            $custom_components_in_controller = self::getControllerCustomComponents($class);
            foreach ($custom_components_in_database as $custom) {
                // Set unavailable fields as empty
                foreach (self::$_components[$class][$class . '_' . $custom['tab']] as $order => $data) {
                    if (isset($custom_components_in_controller[$class . '_' . $custom['tab']])
                        && isset(self::$_components[$class][$class . '_' . $custom['tab']][$order])
                        && (
                            count(self::$_components[$class][$class . '_' . $custom['tab']][$order])
                            !=
                            count($custom_components_in_controller[$class . '_' . $custom['tab']]))
                    ) {
                        foreach ($custom_components_in_controller[$class . '_' . $custom['tab']] as $field_key => $field_value) {
                            if (!isset(self::$_components[$class][$class . '_' . $custom['tab']][$order][$field_key])) {
                                self::$_components[$class][$class . '_' . $custom['tab']][$order][$field_key] = ''; // Set empty field
                            }
                        }
                    }
                }

            }

            // Set any empty value to all non-existing components to avoid error in front
            foreach ($custom_components_in_controller as $custom_key => $custom_fields) {
                list($class, $custom_tab) = explode('_', $custom_key, 2);
                if (!isset(self::$_components[$class][$class . '_' . $custom_tab]) || !is_array(self::$_components[$class][$class . '_' . $custom_tab])) {
                    self::$_components[$class][$class . '_' . $custom_tab] = []; // Set empty array to iterate from
                }
            }

            // Save to cache
            if (Settings::isCacheEnabled()) {
                Cacher::getInstance()->getDefaultCacher()->set($cache_key, self::$_components[$class]);
            }
        }
    }
689594
private function initLoaders()
    {
        $namespace = sprintf('%s\\ServiceLoader', __NAMESPACE__);
        $classes = ['MetadataCache', 'MetadataDrivers', 'MetadataFactory', 'Persisters', 'Rest', 'SearchClients'];

        foreach ($classes as $class) {
            $fqcn = sprintf('%s\\%s', $namespace, $class);
            $this->addLoader(new $fqcn);
        }
        return $this;
    }
866067
static function load($class_name)
    {
        if (stream_resolve_include_path(
            "modules/archi/includes/".$class_name.".class.php"
        )) {
            include_once "modules/archi/includes/".$class_name.".class.php";
        } else if (stream_resolve_include_path(
            __DIR__."/frameworkClasses/".$class_name.".class.php"
        )) {
            include_once __DIR__."/frameworkClasses/".$class_name.".class.php";
        }
    }