throw new \RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir));
}
$tmpFile = tempnam($dir, basename($key));
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) {
@chmod($key, 0666 & ~umask());
if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
// Compile cached file into bytecode cache
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
@opcache_invalidate($key, true);
} elseif (\function_exists('apc_compile_file')) {
apc_compile_file($key);
}
}
return;
}
throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key));
}
public function getTimestamp($key)
{
if (!file_exists($key)) {
return 0;
}
return (int) @filemtime($key);
}
}
class_alias('Twig\Cache\FilesystemCache', 'Twig_Cache_Filesystem');
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
$source = null;
if (!class_exists($cls, false)) {
$loader = $this->getLoader();
if (!$loader instanceof SourceContextLoaderInterface) {
$source = new Source($loader->getSource($name), $name);
} else {
$source = $loader->getSourceContext($name);
}
$content = $this->compileSource($source);
if ($this->bcWriteCacheFile) {
$this->writeCacheFile($key, $content);
} else {
$this->cache->write($key, $content);
$this->cache->load($key);
}
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
}
if (!class_exists($cls, false)) {
throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
if (!$this->runtimeInitialized) {
$this->initRuntime();
/**
* Loads a template internal representation.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The template name
* @param int $index The index if it is an embedded template
*
* @return \Twig_TemplateInterface A template instance representing the given template name
*
* @throws LoaderError When the template cannot be found
* @throws RuntimeError When a previously generated cache is corrupted
* @throws SyntaxError When an error occurred during compilation
*
* @internal
*/
public function loadTemplate($name, $index = null)
{
return $this->loadClass($this->getTemplateClass($name), $name, $index);
}
/**
* @internal
*/
public function loadClass($cls, $name, $index = null)
{
$mainCls = $cls;
if (null !== $index) {
$cls .= '___'.$index;
}
if (isset($this->loadedTemplates[$cls])) {
return $this->loadedTemplates[$cls];
}
if (!class_exists($cls, false)) {
if ($this->bcGetCacheFilename) {
$key = $this->getCacheFilename($name);
} else {
*
* @param string|TemplateWrapper|\Twig\Template $name The template name
*
* @throws LoaderError When the template cannot be found
* @throws RuntimeError When a previously generated cache is corrupted
* @throws SyntaxError When an error occurred during compilation
*
* @return TemplateWrapper
*/
public function load($name)
{
if ($name instanceof TemplateWrapper) {
return $name;
}
if ($name instanceof Template) {
return new TemplateWrapper($this, $name);
}
return new TemplateWrapper($this, $this->loadTemplate($name));
}
/**
* Loads a template internal representation.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The template name
* @param int $index The index if it is an embedded template
*
* @return \Twig_TemplateInterface A template instance representing the given template name
*
* @throws LoaderError When the template cannot be found
* @throws RuntimeError When a previously generated cache is corrupted
* @throws SyntaxError When an error occurred during compilation
*
* @internal
*/
public function loadTemplate($name, $index = null)
}
$key = null;
$output = false;
if ( false !== $expires ) {
ksort($data);
$key = md5($file.json_encode($data));
$output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
}
if ( false === $output || null === $output ) {
$twig = $this->get_twig();
if ( strlen($file) ) {
$loader = $this->get_loader();
$result = $loader->getCacheKey($file);
do_action('timber_loader_render_file', $result);
}
$data = apply_filters('timber_loader_render_data', $data);
$data = apply_filters('timber/loader/render_data', $data, $file);
$template = $twig->load($file);
$output = $template->render($data);
}
if ( false !== $output && false !== $expires && null !== $key ) {
$this->delete_cache();
$this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
}
$output = apply_filters('timber_output', $output);
return apply_filters('timber/output', $output, $data, $file);
}
protected function delete_cache() {
Cleaner::delete_transients();
}
/**
* Get first existing template.
*
* @param array|string $templates Name(s) of the Twig template(s) to choose from.
* @return string|bool Name of chosen template, otherwise false.
if ( $via_render ) {
$file = apply_filters('timber_render_file', $file);
} else {
$file = apply_filters('timber_compile_file', $file);
}
$output = false;
if ($file !== false) {
if ( is_null($data) ) {
$data = array();
}
if ( $via_render ) {
$data = apply_filters('timber_render_data', $data);
} else {
$data = apply_filters('timber_compile_data', $data);
}
$output = $loader->render($file, $data, $expires, $cache_mode);
} else {
if ( is_array($filenames) ) {
$filenames = implode(", ", $filenames);
}
Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
}
do_action('timber_compile_done');
return $output;
}
/**
* Compile a string.
*
* @api
* @example
* ```php
* $data = array(
* 'username' => 'Jane Doe',
* );
$twig = $dummy_loader->get_twig();
$template = $twig->createTemplate($string);
return $template->render($data);
}
/**
* Fetch function.
*
* @api
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* array, the first value is used for non-logged in visitors, the second for users.
* Default false.
* @param string $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
* @return bool|string The returned output.
*/
public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
$output = self::compile($filenames, $data, $expires, $cache_mode, true);
$output = apply_filters('timber_compile_result', $output);
return $output;
}
/**
* Render function.
*
* Passes data to a Twig file and echoes the output.
*
* @api
* @example
* ```php
* $context = Timber::context();
*
* Timber::render( 'index.twig', $context );
* ```
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* Passes data to a Twig file and echoes the output.
*
* @api
* @example
* ```php
* $context = Timber::context();
*
* Timber::render( 'index.twig', $context );
* ```
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* array, the first value is used for non-logged in visitors, the second for users.
* Default false.
* @param string $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
* @return bool|string The echoed output.
*/
public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
$output = self::fetch($filenames, $data, $expires, $cache_mode);
echo $output;
return $output;
}
/**
* Render a string with Twig variables.
*
* @api
* @example
* ```php
* $data = array(
* 'username' => 'Jane Doe',
* );
*
* Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
* ```
* @param string $string A string with Twig variables.
* @param array $data An array of data to use in Twig template.
* @return bool|string
*/
use Timber\Timber;
/*
* The Template for displaying all single posts
*/
$gantry = Gantry\Framework\Gantry::instance();
$theme = $gantry['theme'];
// We need to render contents of <head> before plugin content gets added.
$context = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
$post = Timber::query_post();
$context['post'] = $post;
$context['wp_title'] .= ' - ' . $post->title();
Timber::render(['single-' . $post->ID . '.html.twig', 'single-' . $post->post_type . '.html.twig', 'single.html.twig'], $context);
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $template );
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define( 'WP_USE_THEMES', true ); /** Loads the WordPress Environment and Template */ require __DIR__ . '/wp-blog-header.php';
| Key | Value |
| TCM_PostShown | WP_Post Object ( [ID] => 1995 [post_author] => 4 [post_date] => 2020-12-14 16:47:56 [post_date_gmt] => 2020-12-14 21:47:56 [post_content] => The Oxford Dictionary defines a halfway house as, “a center for helping former drug addicts, prisoners, psychiatric patients, or others to adjust to life in general society.” Merriam-Webster defines a halfway house as, “a residence for individuals after release from institutionalization (as for mental illness, drug addiction, or criminal activity) that is designed to facilitate their readjustment to private life.” Wikipedia defines a halfway house as, “an institute for people with criminal backgrounds or abusive drug use tendencies to learn the necessary skills to reintegrate into society and better support and care for themselves.” When an individual who is in addiction recovery refers to a halfway house, he or she is referring to a transitional living environment that mandates and promotes sobriety while helping residents make the eventual transition back into fully independent living. <h2>Defenition of Sober Living</h2> Early recovery is a vulnerable time - in order to prevent relapse after completing inpatient treatment, it is a good idea for individuals to transfer directly into a sober living house. These houses are designed to promote a high level of accountability while providing a safe and supportive place for recovering addicts and alcoholics to continue on in their personal journeys of healing. At Riverbend Residence, we offer four gender-specific halfway houses in Sparta, New Jersey that cater to men and women of all ages. Our definition of a halfway house is somewhat traditional - we believe that sober living is a crucial phase of every long-term recovery journey and that men and women should be provided with a safe place to live as they navigate early recovery. <img class="alignleft size-full wp-image-1996" src="https://riverbendresidence.com/wp-content/uploads/2020/12/Definition-of-a-Halfway-House.jpg" alt="Definition of a Halfway House " width="600" height="400" /> <h2>The History of Halfway Houses</h2> Were halfway houses always defined the same way? No - in fact, the term “halfway house” was once used to define a shady living environment for recently-released convicts - often convicts with violent pasts. From the mid-18th century to the first half of the 19th century, it was widely believed that crimes were best punished using the “deterrence theory.” This theory allowed certain, non-violent criminals to reside outside of prisons and suggested that the crime should fit the punishment - and that jail was not always an appropriate punishment. By the year 1845, facilities were popping up throughout the United States that served as resources for convicted felons, allowing them to live outside of the prison system with a higher level of personal freedom if they were considered “reformed,” promised to abide by a strict set of rules and guidelines. These halfway house residents were encouraged to pursue vocational opportunities, ultimately integrating themselves back into society. In the 1930s, these residences were referred to as “halfway out of prison” programs. They focused more on rehabilitation, offering residents a range of resources geared towards helping them successfully reintegrate into society at large. In the 1950s, halfway houses began to offer shelter to criminals and to men and women who had recently completed a long-term, intensive program of alcohol and/or drug addiction treatment. The 1960s and 70s became known as the “golden era” of the halfway house movement. There was a major shift, and halfway houses were now primarily sober homes for recovering addicts and alcoholics. <h2>Riverbend Residence - Gender-Specific Sober Living</h2> <a href="https://riverbendresidence.com/">Riverbend Residence</a> offers four beautifully appointed halfway houses to men and women in Sparta, New Jersey, and all surrounding areas. We maintain a strictly enforced set of rules and guidelines, geared towards helping our residents maintain a high level of accountability while navigating early sobriety and slowly making the transition back to fully independent, sober living. If you have recently completed a higher level of clinical care and you are looking to take the next appropriate step, sober living is likely an ideal choice. For more information on our New Jersey halfway houses or to take a tour of our facilities, give us a call today. We are currently offering virtual tours in light of the recent coronavirus epidemic - give us a call at <a href="tel:844-505-3447">(844) 505-3447</a> for more detailed information. [post_title] => Definition of a Halfway House [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => open [post_password] => [post_name] => definition-of-halfway-house [to_ping] => [pinged] => [post_modified] => 2020-12-14 16:47:56 [post_modified_gmt] => 2020-12-14 21:47:56 [post_content_filtered] => [post_parent] => 0 [guid] => https://riverbendresidence.com/?p=1995 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw [status] => publish [id] => 1995 [slug] => definition-of-halfway-house [custom] => Array ( [_edit_lock] => 1620512816:3 [_edit_last] => 3 [_thumbnail_id] => 1996 [_wp_page_template] => default [_yoast_wpseo_focuskw] => Definition of a Halfway House [_yoast_wpseo_metadesc] => A halfway house environment promotes sobriety while helping residents make the eventual transition back into fully independent sober living. [_yoast_wpseo_linkdex] => 63 [_yoast_wpseo_content_score] => 30 [_yoast_wpseo_primary_category] => 10 [_yoast_wpseo_title] => Definition of a Halfway House | Riverbend Residence ) ) |
| TCM_SnippetsWrittenIds | Array ( ) |
| TCM_SnippetsWrittenMd5 | Array ( ) |
| TCM_Cache_Query_2_ | Array ( [0] => Array ( [id] => post [text] => Post (post) [name] => Post (post) ) [1] => Array ( [id] => page [text] => Page (page) [name] => Page (page) ) ) |
| Key | Value |
| SERVER_SOFTWARE | nginx |
| REQUEST_URI | /definition-of-halfway-house/ |
| USER | fpm200067 |
| HOME | /home/fpm200067 |
| WPENGINE_ACCOUNT | riverbendresid |
| WPENGINE_PHPSESSIONS | on |
| WPENGINE_DB_SESSIONS | off |
| HTTP_WPE_READONLY | on |
| HTTP_CDN_LOOP | cloudflare; loops=1 |
| PHP_ADMIN_VALUE | newrelic.appname=riverbendresid; newrelic.browser_monitoring.auto_instrument=off; newrelic.enabled=off; newrelic.license=; sendmail_path=/bin/sendmail-wrapper.sh 5b7ea12d5efa8de29e9e6505a5de420da8ba2ef3 /usr/sbin/sendmail -t -i; syslog.ident=phperr-riverbendresid; |
| REDIRECT_STATUS | 200 |
| SCRIPT_NAME | /index.php |
| CONTENT_TYPE | |
| IS_WPE | 1 |
| HTTPS | on |
| HTTP_RAWHOST | riverbendresidence.com |
| REMOTE_ADDR | 216.73.216.26 |
| PATH_INFO | |
| CONTENT_LENGTH | 0 |
| SERVER_PORT | 80 |
| GATEWAY_INTERFACE | CGI/1.1 |
| PHP_VALUE | upload_max_filesize=50M; post_max_size=100M; |
| HTTP_X_FORWARDED_HOST | riverbendresidence.com |
| HTTP_CF_RAY | 9d68a1e00c85cc36-CMH |
| HTTP_X_FORWARDED_PROTO | https |
| HTTP_X_WPE_SSL | 1 |
| SERVER_PROTOCOL | HTTP/1.1 |
| REMOTE_PORT | |
| HTTP_X_WPE_INSTALL_NAME | riverbendresid |
| HTTP_X_WPE_REQUEST_ID | 88f060a7e677ed32ad730c9aa5dbce9e |
| HTTP_HOST | riverbendresidence.com |
| HTTP_REFERER | https://riverbendresidence.com/definition-of-halfway-house |
| DOCUMENT_URI | /index.php |
| HTTP_X_WPENGINE_PHP_VERSION | 7.4 |
| HTTP_ACCEPT | */* |
| HTTP_X_REAL_IP_REMOTE | 104.23.197.125 |
| PATH_TRANSLATED | /nas/content/live/riverbendresid/index.php |
| REQUEST_SCHEME | http |
| HTTP_CF_IPCOUNTRY | US |
| SYSLOG_IDENT | phperr-riverbendresid |
| HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_X_UA_ORIGINAL | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_X_IS_BOT | 1 |
| HTTP_X_CACHE_GROUP | normal |
| REQUEST_METHOD | GET |
| QUERY_STRING | |
| SERVER_ADDR | 127.0.0.1 |
| HTTP_ACCEPT_ENCODING | gzip |
| HTTP_VIA | 1.1 pod-404710 (Varnish/trunk) |
| HTTP_X_WORDPRESS_TYPE | DEFAULT |
| SERVER_NAME | riverbendresidence.com |
| DOCUMENT_ROOT | /nas/content/live/riverbendresid |
| SCRIPT_FILENAME | /nas/content/live/riverbendresid/index.php |
| HTTP_X_WPE_LOCAL_SSL | 1 |
| HTTP_CF_VISITOR | {\"scheme\":\"https\"} |
| HTTP_X_WPE_EDGE | AN |
| HTTP_CF_CONNECTING_IP | 216.73.216.26, 216.73.216.26, 216.73.216.26 |
| FCGI_ROLE | RESPONDER |
| PHP_SELF | /index.php |
| REQUEST_TIME_FLOAT | 1772540815.5 |
| REQUEST_TIME | 1772540815 |
| Key | Value |
| USER | fpm200067 |
| HOME | /home/fpm200067 |
| WPENGINE_ACCOUNT | riverbendresid |
| WPENGINE_PHPSESSIONS | on |
| WPENGINE_DB_SESSIONS | off |
| HTTP_WPE_READONLY | on |
| HTTP_CDN_LOOP | cloudflare; loops=1 |
| PHP_ADMIN_VALUE | newrelic.appname=riverbendresid; newrelic.browser_monitoring.auto_instrument=off; newrelic.enabled=off; newrelic.license=; sendmail_path=/bin/sendmail-wrapper.sh 5b7ea12d5efa8de29e9e6505a5de420da8ba2ef3 /usr/sbin/sendmail -t -i; syslog.ident=phperr-riverbendresid; |
| REDIRECT_STATUS | 200 |
| SCRIPT_NAME | /index.php |
| CONTENT_TYPE | |
| IS_WPE | 1 |
| HTTPS | on |
| HTTP_RAWHOST | riverbendresidence.com |
| REMOTE_ADDR | 216.73.216.26 |
| PATH_INFO | |
| CONTENT_LENGTH | 0 |
| SERVER_PORT | 80 |
| GATEWAY_INTERFACE | CGI/1.1 |
| PHP_VALUE | upload_max_filesize=50M; post_max_size=100M; |
| HTTP_X_FORWARDED_HOST | riverbendresidence.com |
| HTTP_CF_RAY | 9d68a1e00c85cc36-CMH |
| HTTP_X_FORWARDED_PROTO | https |
| HTTP_X_WPE_SSL | 1 |
| SERVER_PROTOCOL | HTTP/1.1 |
| REMOTE_PORT | |
| HTTP_X_WPE_INSTALL_NAME | riverbendresid |
| HTTP_X_WPE_REQUEST_ID | 88f060a7e677ed32ad730c9aa5dbce9e |
| HTTP_HOST | riverbendresidence.com |
| HTTP_REFERER | https://riverbendresidence.com/definition-of-halfway-house |
| DOCUMENT_URI | /index.php |
| HTTP_X_WPENGINE_PHP_VERSION | 7.4 |
| HTTP_ACCEPT | */* |
| HTTP_X_REAL_IP_REMOTE | 104.23.197.125 |
| REQUEST_URI | /definition-of-halfway-house/ |
| PATH_TRANSLATED | /nas/content/live/riverbendresid/index.php |
| REQUEST_SCHEME | http |
| HTTP_CF_IPCOUNTRY | US |
| SYSLOG_IDENT | phperr-riverbendresid |
| HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_X_UA_ORIGINAL | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_X_IS_BOT | 1 |
| HTTP_X_CACHE_GROUP | normal |
| REQUEST_METHOD | GET |
| QUERY_STRING | |
| SERVER_ADDR | 127.0.0.1 |
| SERVER_SOFTWARE | nginx |
| HTTP_ACCEPT_ENCODING | gzip |
| HTTP_VIA | 1.1 pod-404710 (Varnish/trunk) |
| HTTP_X_WORDPRESS_TYPE | DEFAULT |
| SERVER_NAME | riverbendresidence.com |
| DOCUMENT_ROOT | /nas/content/live/riverbendresid |
| SCRIPT_FILENAME | /nas/content/live/riverbendresid/index.php |
| HTTP_X_WPE_LOCAL_SSL | 1 |
| HTTP_CF_VISITOR | {"scheme":"https"} |
| HTTP_X_WPE_EDGE | AN |
| HTTP_CF_CONNECTING_IP | 216.73.216.26, 216.73.216.26, 216.73.216.26 |
| FCGI_ROLE | RESPONDER |
| PHP_SELF | /index.php |
| REQUEST_TIME_FLOAT | 1772540815.5 |
| REQUEST_TIME | 1772540815 |