本文整理汇总了PHP中Debug::out方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::out方法的具体用法?PHP Debug::out怎么用?PHP Debug::out使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::out方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isCached
function isCached()
{
if (!$this->refreshCacheDir()) {
Debug::out('pageRender::isCached() : Impossible de rafraichir le dossier de cache. Mauvaise utilisation ?');
return false;
}
$page = 'page' . Config::getTemplateExt();
return $this->is_cached($page, $this->cacheId);
}
示例2: updateModelBaseFile
public function updateModelBaseFile($objName, $structure)
{
$dependency = new Dependency();
$dependencies = $dependency->getDependencies($objName);
$this->_createComponents($objName, $structure, $dependencies);
$this->_createModelBaseFileStr($objName, $structure);
$modelBaseFileName = NamingConvention::camelCaseToSnakeCase($objName) . '_base.php';
$modelBasePath = ROOT . '/app/model/base/' . $modelBaseFileName;
Debug::out('update: ' . $modelBasePath);
file_put_contents($modelBasePath, $this->_modelBaseFileStr);
}
示例3: dump
function dump($var, $varName = '')
{
ob_start();
var_dump($var);
$out = ob_get_contents();
ob_end_clean();
if ($varName != '') {
$out = $varName . ' : ' . $out;
}
Debug::out($out);
}
示例4: checkLoggedIn
static function checkLoggedIn($html, $login)
{
$matches = array('@log\\s?(out|off)@i', '@sign\\s?(out|off)@i', '@Last Month|Last Week@i', '@[^a-z]My [a-z]@i', '@[ >]Scoop Interactive[< ]@i');
foreach ($matches as $match) {
if (preg_match($match, $html)) {
return true;
}
}
Debug::out('||ERROR||: Could not login');
Debug::out($login);
return false;
}
示例5: build
public static function build()
{
self::$enabled = $GLOBALS['config']['DEBUG']['enabled'];
self::$out = $GLOBALS['config']['DEBUG']['out'];
self::$outfile = $GLOBALS['config']['DEBUG']['outfile'];
self::$verbosity = $GLOBALS['config']['DEBUG']['verbosity'];
if (self::$enabled && !is_writable(self::$outfile) && (self::$out === "file" || self::$out === "both")) {
self::$out = "stdout";
self::write("Debug outfile is not writable. Switching back to stdout", 0);
}
if (self::$enabled === true) {
self::write(date('Ymd-Gis - ') . "Debug mode enabled. Use in development env. only!", 0);
}
}
示例6: createModelControllerFile
public function createModelControllerFile($objName, $app)
{
$app = ucfirst($app);
if ($app == '') {
$app = 'Public';
}
$objName .= 's';
$controllerTmpl = file_get_contents(ROOT . '/library/core/console/tmpl/obj_controller.tmpl');
$controllerTmpl = str_replace('{CLASS_NAME}', $objName, $controllerTmpl);
$controllerTmpl = str_replace('{APP}', $app, $controllerTmpl);
$controllerName = NamingConvention::camelCaseToSnakeCase($objName) . '_' . lcfirst($app) . '.php';
$controllerPath = ROOT . '/app/controller/' . lcfirst($app) . '/' . $controllerName;
Debug::out('create: ' . $controllerPath);
file_put_contents($controllerPath, $controllerTmpl);
}
示例7: getInstance
public static function getInstance()
{
if (!self::$PDOINSTANCE) {
try {
self::$PDOINSTANCE = new PDO('mysql:host=' . self::$HOST . ';dbname=' . self::$BASE . ';charset=' . self::$CHAR . ';', self::$USER, self::$PASS);
//self::$PDOINSTANCE->exec("SET NAMES 'utf8';");
} catch (PDOException $e) {
//Debug::out($e);
Debug::out('PDO connection error: ' . $e->getMessage());
Debug::out('Or maybe you have to set: export PATH=/Applications/MAMP/bin/php/phpX.X.X/bin/:$PATH');
die;
//Debug::log($dbh->errorInfo());
}
}
return self::$PDOINSTANCE;
}
示例8: load_file
function load_file($relativPath, $showError = true)
{
$absolutePath = ROOT . $relativPath;
if (file_exists($absolutePath)) {
require_once $absolutePath;
return false;
} else {
if ($showError) {
if (class_exists('Debug')) {
Debug::out('Warning: load_file() could not find "' . $absolutePath . '"<br> in ' . debug_backtrace()[0]['file'] . ' on line ' . debug_backtrace()[0]['line']);
} else {
echo 'Warning: load_file() could not find "' . $absolutePath . '" in ' . debug_backtrace()[0]['file'] . ' on line ' . debug_backtrace()[0]['line'];
}
}
}
return true;
}
示例9: action
public function action($argv)
{
$command = $argv[1];
if ($command == 'migrate' || $command == '-m') {
$migration = new Migration();
$migration->up();
} elseif ($command == 'rollback' || $command == '-r') {
$migration = new Migration();
$migration->rollback();
} elseif ($command == 'status' || $command == '-s') {
$migration = new Migration();
$migration->printStatus();
} elseif ($command === 'help' || $command == '-h') {
Debug::out('Command: -h (help)');
Debug::out('migrate or -m');
Debug::out('rollback or -r');
Debug::out('status or -s');
} else {
Debug::out('Command unknown. Try -h for help.');
}
}
示例10: updateRepositoryBaseFile
public function updateRepositoryBaseFile($objName, $structure)
{
foreach ($structure as $name => $definitions) {
$strRepoAttributes[$name] = $this->_createStrRepoAttribute($name, $definitions);
}
$last = count($strRepoAttributes);
foreach ($strRepoAttributes as $strRepoAttribute) {
$strRepoAttributeResult .= $strRepoAttribute;
if (++$count != $last) {
$strRepoAttributeResult .= ",\n";
}
}
$repoBaseFileName = NamingConvention::camelCaseToSnakeCase($objName) . '_base_repo.php';
$repoBasePath = ROOT . '/app/repository/base/' . $repoBaseFileName;
$repoBaseTmpl = file_get_contents(ROOT . '/library/core/console/tmpl/obj_repo_base.tmpl');
$classNameSnakeCase = NamingConvention::camelCaseToSnakeCase($objName);
$repoBaseTmpl = str_replace('{CLASS_NAME_SNAKE_CASE}', $classNameSnakeCase, $repoBaseTmpl);
$repoBaseTmpl = str_replace('{CLASS_NAME}', $objName, $repoBaseTmpl);
$repoBaseTmpl = str_replace('{OBJ_NAME}', $objName, $repoBaseTmpl);
$repoBaseTmpl = str_replace('{ATTRIBUTES}', $strRepoAttributeResult, $repoBaseTmpl);
Debug::out('update: ' . $repoBasePath);
file_put_contents($repoBasePath, $repoBaseTmpl);
}
示例11: getSchema
public function getSchema()
{
$sql = 'SHOW full columns FROM ' . $this->getTableName();
$dbh = Database::getInstance();
$dbResult = $dbh->query($sql, PDO::FETCH_ASSOC);
if (!$dbResult) {
Debug::out($dbh->errorInfo());
}
foreach ($dbResult as $row) {
foreach ($row as $key => $value) {
$schemaRow[strtolower($key)] = $value;
}
$schema[] = $schemaRow;
}
Debug::out($schema);
}
示例12: _checkQueryNamingConvention
private function _checkQueryNamingConvention($query)
{
if ($query['app'] && !NamingConvention::isSnakeCase($query['app'])) {
Debug::out('Dispatcher NamingConventionError: app=' . $query['app'] . ' has to be snake_case.');
die;
}
if ($query['module'] && !NamingConvention::isSnakeCase($query['module'])) {
Debug::out('Dispatcher NamingConventionError: module=' . $query['module'] . ' has to be snake_case.');
die;
}
if ($query['action'] && !NamingConvention::isSnakeCase($query['action'])) {
Debug::out('Dispatcher NamingConventionError: action=' . $query['action'] . ' has to be snake_case.');
die;
}
}
示例13: checkConfig
static function checkConfig()
{
Control::req('scripts/crons/config');
$run = self::getRun(new Time());
Debug::out('Config check completed');
}
示例14: end_out
function end_out()
{
$end = $this->end();
Debug::out($end);
}
示例15: lowerCase
static function lowerCase($str, $minLen = 0, $maxLen = 0, $upCase = 0, $dreg = 0)
{
if (!$str || !mb_check_encoding($str, 'UTF-8')) {
Debug::out('The input string can not be empty and it must be encoded in UTF-8.');
return '';
}
$md5 = md5($str);
$str = is_array($dreg) ? preg_replace('/' . implode('|', $dreg) . '/', '', $str) : $str;
$str = preg_replace('/^[^0-9A-Za-z]|[^0-9A-Za-z-]*|[^0-9A-Za-z]$/x', '', strtolower(self::rawConvByUtf8($str, $upCase)));
$len = strlen($str);
return $minLen && $len < $minLen ? $str . substr($md5, 0, $minLen - $len) : ($maxLen && $len > $maxLen ? substr($str, 0, $maxLen) : $str);
}