Dump in the error stream all statuses of this object.
@param string $padding Default padding to insert before each line dumped.
18906
public function dumpStatus($padding)
    {
        error_log("");
        error_log($padding . "Translated: " . ($this->is_translated ? 'YES' : 'NO'));
        error_log($padding . "Translation: " . ($this->is_translation ? 'YES' : 'NO'));
        error_log($padding . "Hash: " . ($this->is_hashed ? 'YES' : 'NO'));
        error_log($padding . "Customer Child: " . ($this->is_customer_child ? 'YES' : 'NO'));
        error_log($padding . "Customer Foreign: " . ($this->is_customer_foreign ? 'YES' : 'NO'));
        error_log($padding . "Commerce Child: " . ($this->is_commerce_child ? 'YES' : 'NO'));
        error_log($padding . "Commerce Foreign: " . ($this->is_commerce_foreign ? 'YES' : 'NO'));
        error_log($padding . "Catalog Child: " . ($this->is_catalog_child ? 'YES' : 'NO'));
        error_log($padding . "Catalog Foreign: " . ($this->is_catalog_foreign ? 'YES' : 'NO'));
        error_log($padding . "Site Child: " . ($this->is_site_child ? 'YES' : 'NO'));
        error_log($padding . "Site Foreign: " . ($this->is_site_foreign ? 'YES' : 'NO'));
        error_log($padding . "Site Target Child: " . ($this->is_site_target_child ? 'YES' : 'NO'));
        error_log($padding . "Site Target Foreign: " . ($this->is_site_target_foreign ? 'YES' : 'NO'));
        error_log($padding . "Medioteca Child: " . ($this->is_medioteca_child ? 'YES' : 'NO'));
        error_log($padding . "Medioteca Foreign: " . ($this->is_medioteca_foreign ? 'YES' : 'NO'));
        error_log($padding . "Messaging Child: " . ($this->is_messaging_child ? 'YES' : 'NO'));
        error_log($padding . "Messaging Foreign: " . ($this->is_messaging_foreign ? 'YES' : 'NO'));
        error_log($padding . "Messaging Service Child: " . ($this->is_messaging_service_child ? 'YES' : 'NO'));
        error_log($padding . "Messaging Service Foreign: " . ($this->is_messaging_service_foreign ? 'YES' : 'NO'));
        error_log($padding . "Project Child: " . ($this->is_project_child ? 'YES' : 'NO'));
        error_log($padding . "Project Foreign: " . ($this->is_project_foreign ? 'YES' : 'NO'));
        error_log($padding . "Role Child: " . ($this->is_role_child ? 'YES' : 'NO'));
        error_log($padding . "Role Foreign: " . ($this->is_role_foreign ? 'YES' : 'NO'));
    }
1033497
def write_padding(self, s):
        

        lines = s.splitlines(True)
        for line in lines:
            self.stream.write(line)
            if line[-1] in '\r\n':
                self._newline()
            else:
                # this is the last line
                self.generated_col += len(line)
1063697
protected function getContent(string $padding = '') : string
    {
        $output = '';

        $nb_cluster_user = $this->nb_site->getClusterUser();
        if ($nb_cluster_user === null) {
            throw new ENabuCoreException(ENabuCoreException::ERROR_OBJECT_EXPECTED);
        }

        $nb_engine = CNabuEngine::getEngine();
        $nb_cluster_user_group = $nb_cluster_user->getGroup();

        $vhosts_list = $this->nb_site->getHostsForUpdate($this->nb_server);

        if (count($vhosts_list) > 0) {
            $module_name = $this->getHTTPServer()->getPHPModule();
            $admin_user = $this->nb_server->getAdminUser();
            $server_key = $this->nb_server->getKey();
            $runtime_path = $this->nb_server->getRuntimePath();
            $logs_path = $this->nb_server->getLogsPath();
            $site_etc_path = CApacheHTTPServer::NABU_APACHE_ETC_PATH . DIRECTORY_SEPARATOR . $this->nb_site->getBasePath();
            error_log($site_etc_path);
            $site_base_path = $this->nb_site->getVirtualHostPath($this->nb_server);
            $site_lib_path = $this->nb_site->getVirtualLibrariesPath($this->nb_server);
            $site_cache_path = $this->nb_site->getVirtualCachePath($this->nb_server);
            $site_commons = $site_base_path . NABU_COMMONDOCS_FOLDER;
            $site_php_path = $site_base_path . NABU_PHP_FOLDER;
            $conf_path = $site_base_path . NABU_VHOST_CONFIG_FOLDER . DIRECTORY_SEPARATOR . $server_key;
            $site_key = $this->nb_site->getKey();
            $use_framework = $this->nb_site->isValueEqualThan('nb_site_use_framework', 'T');
            $framework_path = implode(PATH_SEPARATOR, $nb_engine->getPHPIncludeFolders());
            $open_basedir = array(
                $site_base_path,
                $site_lib_path,
                $site_cache_path,
                NABU_ETC_PATH,
                $framework_path,
                sys_get_temp_dir()
            );
            $open_basedir = implode(PATH_SEPARATOR, $open_basedir);

            foreach($vhosts_list as $vhost) {
                $server_name = $vhost['host']['nb_domain_zone_host_name'] === '@'
                             ? $vhost['host']['nb_domain_zone_name']
                             : $vhost['host']['nb_domain_zone_host_name'].'.'.$vhost['host']['nb_domain_zone_name'];
                $use_ssl = ($vhost['host']['nb_cluster_group_service_use_ssl'] === 'T');
                $docs = ($use_ssl ? NABU_HTTPDOCS_FOLDER : NABU_HTTPSDOCS_FOLDER);
                if (array_key_exists('redirections', $vhost) && count($vhost['redirections']) > 0) {
                    foreach ($vhost['redirections']  as $redirection) {
                        $target_name = $redirection['nb_domain_zone_host_name'] === '@'
                                     ? $redirection['nb_domain_zone_name']
                                     : $redirection['nb_domain_zone_host_name'].'.'.$redirection['nb_domain_zone_name'];
                        $target_ssl = ($redirection['nb_cluster_group_service_use_ssl'] === 'T');
                        $output .= $padding . "<VirtualHost " . $redirection['nb_ip_ip'] . ':' . $redirection['nb_server_host_port'] . ">\n";
                        $output .= $padding . "        ServerName $target_name\n";
                        $output .= $padding . "\n";
                        if ($target_ssl) {
                            $output .= $padding . "        <IfModule mod_ssl.c>\n";
                            $output .= $padding . "                SSLEngine on\n";
                            $output .= $padding . "                SSLVerifyClient none\n";
                            if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '.crt')) {
                                $output .= $padding . "                SSLCertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "$site_key.crt\n";
                            } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'server.crt')) {
                                $output .= $padding . "                SSLCertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "server.crt\n";
                            }
                            if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '.key')) {
                                $output .= $padding . "                SSLCertificateKeyFile $site_etc_path" . DIRECTORY_SEPARATOR . "$site_key.key\n";
                            } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'server.key')) {
                                $output .= $padding . "                SSLCertificateKeyFile $site_etc_path" . DIRECTORY_SEPARATOR . "server.key\n";
                            }
                            if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '_intermediate.crt')) {
                                $output .= $padding . "                SSLCertificateChainFile $site_etc_path". DIRECTORY_SEPARATOR . "${site_key}_intermediate.crt\n";
                            } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'intermediate.crt')) {
                                $output .= $padding . "                SSLCertificateChainFile $site_etc_path". DIRECTORY_SEPARATOR . "intermediate.crt\n";
                            }
                            if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '_root.crt')) {
                                $output .= $padding . "                SSLCACertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "${site_key}_root.crt\n";
                            } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'ca.crt')) {
                                $output .= $padding . "                SSLCACertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "ca.crt\n";
                            }
                            $output .= $padding . "                SSLProxyEngine on\n";
                            $output .= $padding . "        </IfModule>\n";
                        } else {
                            $output .= $padding . "        <IfModule mod_ssl.c>\n";
                            $output .= $padding . "                SSLEngine off\n";
                            $output .= $padding . "        </IfModule>\n";
                        }
                        $output .= $padding . "\n";
                        $output .= $padding . "        RewriteEngine on\n";
                        $output .= $padding . "        RewriteRule ^(.*)$ ".($use_ssl ? 'https://' : 'http://').$server_name."%{REQUEST_URI}?%{QUERY_STRING} [R=301,L]\n";

                        $output .= $padding . "</VirtualHost>\n";
                    }
                }
            }

            foreach($vhosts_list as $vhost) {
                $server_name = $vhost['host']['nb_domain_zone_host_name'] == '@'
                             ? $vhost['host']['nb_domain_zone_name']
                             : $vhost['host']['nb_domain_zone_host_name'].'.'.$vhost['host']['nb_domain_zone_name'];
                $use_ssl = ($vhost['host']['nb_cluster_group_service_use_ssl'] === 'T');
                $docs = ($use_ssl ? NABU_HTTPSDOCS_FOLDER : NABU_HTTPDOCS_FOLDER);
                $output .= $padding . "<VirtualHost " . $vhost['host']['nb_ip_ip'] . ':' . $vhost['host']['nb_server_host_port'] . ">\n";
                $output .= $padding . "        ServerName $server_name\n";
                if (array_key_exists('aliases', $vhost) && count($vhost['aliases']) > 0) {
                    $aux = "";
                    foreach ($vhost['aliases'] as $alias) {
                        $name = "$alias[nb_domain_zone_host_name].$alias[nb_domain_zone_name]";
                        $aux .= (strlen($aux) > 0 ? ' ' : '') . $name;
                    }
                    if (strlen($aux) > 0) {
                        $output .= $padding . "        ServerAlias $aux\n";
                    }
                }

                $output .= $padding . "\n";
                $output .= $padding . "        UseCanonicalName Off\n";
                $output .= $padding
                        . "        SuexecUserGroup "
                        . $nb_cluster_user->getOSNick()
                        . ' '
                        . $nb_cluster_user_group->getOSNick()
                        . "\n";

                if ($admin_user !== null && strlen($admin_user->getEmail()) > 0) {
                    $output .= $padding . "        ServerAdmin \"" . $admin_user->getEmail() . "\"\n";
                }

                $output .= $padding . "        DocumentRoot $site_base_path$docs\n";

                $output .= $padding . "        CustomLog \"|/usr/sbin/rotatelogs -l $logs_path/$server_name.%Y%m%d.access_log 86400\" combined\n";
                $output .= $padding . "        ErrorLog \"|/usr/sbin/rotatelogs -l $logs_path/$server_name.%Y%m%d.error_log 86400\"\n";

                $output .= $padding . "\n";
                if ($use_ssl) {
                    $output .= $padding . "        <IfModule mod_ssl.c>\n";
                    $output .= $padding . "                SSLEngine on\n";
                    $output .= $padding . "                SSLVerifyClient none\n";
                    if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '.crt')) {
                        $output .= $padding . "                SSLCertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "$site_key.crt\n";
                    } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'server.crt')) {
                        $output .= $padding . "                SSLCertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "server.crt\n";
                    }
                    if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '.key')) {
                        $output .= $padding . "                SSLCertificateKeyFile $site_etc_path" . DIRECTORY_SEPARATOR . "$site_key.key\n";
                    } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'server.key')) {
                        $output .= $padding . "                SSLCertificateKeyFile $site_etc_path" . DIRECTORY_SEPARATOR . "server.key\n";
                    }
                    if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '_intermediate.crt')) {
                        $output .= $padding . "                SSLCertificateChainFile $site_etc_path" . DIRECTORY_SEPARATOR . "${site_key}_intermediate.crt\n";
                    } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'intermediate.crt')) {
                        $output .= $padding . "                SSLCertificateChainFile $site_etc_path" . DIRECTORY_SEPARATOR . "intermediate.crt\n";
                    }
                    if (file_exists($site_etc_path . DIRECTORY_SEPARATOR . $site_key . '_root.crt')) {
                        $output .= $padding . "                SSLCACertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "${site_key}_root.crt\n";
                    } elseif (file_exists($site_etc_path . DIRECTORY_SEPARATOR . 'ca.crt')) {
                        $output .= $padding . "                SSLCACertificateFile $site_etc_path" . DIRECTORY_SEPARATOR . "ca.crt\n";
                    }
                    $output .= $padding . "                SSLProxyEngine on\n";
                    $output .= $padding . "        </IfModule>\n";
                } else {
                    $output .= $padding . "        <IfModule mod_ssl.c>\n";
                    $output .= $padding . "                SSLEngine off\n";
                    $output .= $padding . "        </IfModule>\n";
                }
                $output .= $padding . "\n";

                $output .= $padding . "        <Directory $site_base_path$docs>\n";
                $output .= $padding . "                <IfModule $module_name>\n";
                $output .= $padding . "                        php_admin_flag engine on\n";
                $output .= $padding . "                        php_admin_flag safe_mode off\n";
                if ($use_framework) {
                    $output .= $padding . "                        php_admin_value open_basedir \"$open_basedir\"\n";
                    $output .= $padding . "                        php_value include_path \".:$site_php_path:$framework_path\"\n";
                }
                $output .= $padding . "                </IfModule>\n";
                $output .= $padding . "                AllowOverride All\n";
                $output .= $padding . "                Options +Includes -ExecCGI +FollowSymLinks\n";
                $output .= $padding . "                Require all granted\n";
                $output .= $padding . "        </Directory>\n";
                $output .= $padding . "\n";

                $output .= $padding . "        Alias /runtime $runtime_path\n";
                $output .= $padding . "        <Location /runtime>\n";
                $output .= $padding . "                Order allow,deny\n";
                $output .= $padding . "                Allow from all\n";
                $output .= $padding . "        </Location>\n";
                $output .= $padding . "        <Directory $runtime_path>\n";
                $output .= $padding . "                AllowOverride All\n";
                $output .= $padding . "                Require all granted\n";
                $output .= $padding . "                <IfModule $module_name>\n";
                $output .= $padding . "                        php_admin_flag engine on\n";
                $output .= $padding . "                        php_admin_flag safe_mode off\n";
                if ($use_framework) {
                    $output .= $padding . "                        php_admin_value open_basedir \"$open_basedir\"\n";
                    $output .= $padding . "                        php_value include_path \".:$framework_path\"\n";
                }
                $output .= $padding . "                </IfModule>\n";
                $output .= $padding . "                Options -Includes -ExecCGI\n";
                $output .= $padding . "                Require all granted\n";
                $output .= $padding . "        </Directory>\n";
                $output .= $this->populateCommonDocs($padding . '        ', $site_commons);
                $output .= $padding . "\n";

                if ($this->nb_site->isValueEqualThan('nb_site_enable_vhost_file', 'T') && file_exists("$conf_path/vhost.conf")) {
                    $output .= $padding . "        Include $conf_path/vhost.conf\n";
                }

                if (file_exists("$conf_path/aliases.conf")) {
                    $output .= $padding . "        Include $conf_path/aliases.conf\n";
                }

                if (file_exists("$conf_path/mediotecas.conf")) {
                    $output .= $padding . "        Include $conf_path/mediotecas.conf\n";
                }

                $output .= $padding . "</VirtualHost>\n";
            }
        }

        return $output;
    }
718310
public static function errorOut($s) {
        // Always output errors
        $oldQuiet = self::getQuiet();
        self::setQuiet(false);

        self::lineOut($s, self::RED);
        self::setQuiet($oldQuiet);
    }
1023233
public static function write($message = null, $padding = null)
    {
        if ($padding > 0) {
            $message = str_pad($message, $padding, ' ');
        }

        self::stdOut($message);
    }
849761
protected function getContent(string $padding = '') : string
    {
        $content = '';

        if (count($this->fragments) > 0) {
            foreach ($this->fragments as $fragment) {
                if (is_string($fragment)) {
                    $content .= $padding . $fragment . "\n";
                } elseif ($fragment instanceof CNabuAbstractFragmentBuilder) {
                    $content .= $fragment->create($padding) . "\n";
                }
            }
        }

        return $content;
    }
727548
protected function getContent($padding = '')
    {
        $http_server = $this->getHTTPServer();
        $module_name = $http_server->getPHPModule();

        $site_base_path = $this->nb_server->getVirtualHostsPath();
        $site_httpdocs = $site_base_path . NABU_HTTPDOCS_FOLDER;
        $site_commons = $site_base_path . NABU_COMMONDOCS_FOLDER;
        $use_framework = ($this->nb_site->getUseFramework() === 'T');
        $framework_path = $this->nb_server->getFrameworkPath();

        $tmp = '/var/tmp:/tmp';

        $output = $padding . "DocumentRoot \"$site_httpdocs\"\n"
                . $padding . "ServerName builtin.nabu.local\n"
                . $padding . "<Directory \"$site_httpdocs\">\n"
                . $padding . "        <IfModule $module_name>\n"
                . $padding . "                php_admin_flag engine on\n"
                . $padding . "                php_admin_flag safe_mode off\n"
                . $padding . "                php_admin_value open_basedir \"$site_base_path" .
                           /* ":$icontact_path:$mediotecas_path:$emailing_path:$apps_path" .*/
                           ($use_framework ? ':'.$framework_path : '') . ":" . NABU_ETC_PATH . ":$tmp\"\n"
        ;

        if ($use_framework) {
            $output .= $padding . "                php_value include_path \".:$framework_path\"\n";
        }

        $output .= $padding . "        </IfModule>\n"
                 . $padding . "        Options -Includes -ExecCGI\n"
                 . $padding . "        AllowOverride All\n"
                 . $padding . "        Require all granted\n"
                 . $padding . "</Directory>\n"
        ;

        return $output . $this->populateCommonDocs($padding, $site_commons);
    }
843101
public function pad($length, $padding = ' ') {
		$len = $length - $this->length();
		return $this->applyPadding(floor($len / 2), ceil($len / 2), $padding);
	}
626433
public function pad(int $length, string $padding = ' '): Utility
    {
        $padLength = $length - $this->length();

        return $this->applyPadding(floor($padLength / 2), ceil($padLength / 2), $padding);
    }
1121089
private static function createPointerString(string $string, int $padding): string
    {
        $pointer = str_repeat(" ", $padding) . "^";

        return $string . "\n" . $pointer;
    }
665354
protected function getComments(string $padding = '') : string
    {
        $comments = '';

        if (count($this->comments) > 0) {
            $comments = $padding . "/**\n";
            foreach ($this->comments as $line) {
                $comments .= $this->truncateComment($padding, $line);
            }
            $comments .= $padding . " */\n";
        }

        return $comments;
    }
41351
public function writeError( $s )
	{
		$message = $this->cleanMessage( $s );

		if ( ! empty( $message ) )
		{
			$this->bag[] = array( self::ERROR , $message );
		}
	}
642085
protected function _dump($args) {
		// get function call position
		$backtrace = debug_backtrace();
		$backtrace = $backtrace[1];

		// get calling file
		if (isset($backtrace['file'])) {
			$file = file($backtrace['file']);
			$function = trim($file[$backtrace['line']-1]);
		}

		$output = '';
		foreach ($args as $arg) {
			// count errors to produce unique ids
			$this->errorcounter++;

			// create headline
			$output .= '<div class="dp_container">';
			$output .= '<h1 class="dump">'.htmlspecialchars($function).'</h1>';

			// highlight the file name
			$file = preg_replace('=[^/]+$=', '<strong>$0</strong>', $backtrace['file']);
			$output .= '<h3>'.$file.' (Line '.$backtrace['line'].')</h3>';

			// add var content
			$output .= $this->_dump_php($arg);
			$output .= '</div>';
			
			// add styles
			$output .= $this->_debug_styles();
		}
		
		// output to screen		
		if ($this->config['output']['screen'] == false) return '';

		echo $output;
	}
402484
function reportError( $text, $caption, $errCode = eZSiteInstaller::ERR_ABORT )
    {
        eZDebug::writeError( $text, $caption );

        $this->setLastErrorCode( $errCode );
    }
10682
public function dump()
    {
        $content = $this->response->getContent();

        $json = json_decode($content);

        if (json_last_error() === JSON_ERROR_NONE) {
            $content = $json;
        }

        dd($content);
    }
1342303
public function stream_write($data)
    {
        if ($this->getOnWriteDataMode()) {

            $length = strlen($data);
            $this->appendDataBuffer($data);
            $this->appendPosition($length);
            return $length;
        } else {
            throw new \Exception('dirty mode.');
        }
    }
1067058
protected static function _dump($string)
    {
        $es = ['0', 'x07', 'x08', 't', 'n', 'v', 'f', 'r'];
        $unescaped = '';
        $chars = str_split($string);
        foreach ($chars as $char) {
            if ($char === '') {
                continue;
            }
            $value = ord($char);
            if ($value >= 7 && $value <= 13) {
                $unescaped .= '\\' . $es[$value - 6];
            } elseif ($char === '"' || $char === '$' || $char === '\\') {
                $unescaped .= '\\' . $char;
            } else {
                $unescaped .= $char;
            }
        }
        return $unescaped;
    }