Example #1
0
                        <th>access</th>
                    </tr>
                    <?php 
foreach (ini_get_all() as $k => $v) {
    ?>
                                <tr>
                                    <td><?php 
    echo $k;
    ?>
</td>
                                    <td><?php 
    echo VarDump($v['global_value']);
    ?>
</td>
                                    <td><?php 
    echo VarDump($v['local_value']);
    ?>
</td>
                                    <td><?php 
    echo DebugPanel::ShowPhpIniAccess($v['access']);
    ?>
</td>
                                </tr>
                            <?php 
}
?>
                </table>
            </div>
        </div>

        <div style="clear: both"></div>
 /**
  * Receives left, right and level for node with number $NodeID.
  * 
  * @param int $NodeID.
  * @param array $Conditions.
  *	ResetCache
  * @return mixed $Result.
  */
 public function GetNode($NodeID, $Conditions = False)
 {
     if (!is_numeric($NodeID)) {
         trigger_error(sprintf("Not numeric NodeID (%s)", VarDump($NodeID)), E_USER_ERROR);
     }
     $Result =& $this->CachedNodeResults[$NodeID];
     $ResetCache = GetValue('ResetCache', $Conditions, False, True);
     if ($ResetCache) {
         $Result = Null;
     }
     if ($Result === Null) {
         $Conditions[$this->PrimaryKey] = $NodeID;
         $Conditions['CacheNodes'] = True;
         $this->GetNodes($Conditions);
         // If still null set to false because node with $NodeID is not exists.
         if (is_null($Result)) {
             $Result = False;
         }
     }
     return $Result;
 }
Example #3
0
    ?>
                <?php 
    $i = 0;
    foreach ($arr as $k => $v) {
        ?>
                    <tr>
                        <td class="num"><?php 
        echo ++$i;
        ?>
</td>
                        <td><?php 
        echo $k;
        ?>
</td>
                        <td><?php 
        echo VarDump($v);
        ?>
</td>
                    </tr>
                <?php 
    }
    ?>
            <?php 
} else {
    ?>
                <tr>
                    <td colspan="3" class="center">Empty</td>
                </tr>
            <?php 
}
?>
 function d()
 {
     static $bSetStyle = True;
     static $bExit = True;
     if (!class_exists('Dumphper', False)) {
         define('DPHP_USE_ACCESSIBLE', version_compare(PHP_VERSION, '5.3.0') >= 0);
         $Path = defined('USEFULFUNCTIONS_VENDORS') ? USEFULFUNCTIONS_VENDORS : dirname(__FILE__) . '/../vendors';
         require $Path . '/class.dumphper.php';
         Dumphper::$escape_keys = false;
         Dumphper::$max_showw_depth = 8;
         Dumphper::$encoding = 'utf-8';
     }
     $Args = func_get_args();
     if (count($Args) == 0 && $bExit) {
         $bExit = False;
     }
     if (PHP_SAPI != 'cli') {
         if (!headers_sent()) {
             if (defined('CP1251')) {
                 header('Content-Type: text/html; charset=windows-1251');
             } else {
                 header('Content-Type: text/html; charset=utf-8');
             }
         }
         if ($bSetStyle) {
             $bSetStyle = False;
             echo "<style type='text/css'>.dumphper span{font-size:14px !important;font-family:'Arial' !important;}</style>\n";
         }
         if (defined('CP1251')) {
             echo '<pre style="font-size:14px">';
             $Count = 0;
             foreach ($Args as $A) {
                 $String = VarDump($A);
                 $String = preg_replace("/\\=\\>\n +/s", '=> ', $String);
                 echo str_repeat("*", ++$Count) . ' ';
                 echo $String;
             }
             die;
         }
         //var_dump($Args);
         foreach ($Args as $A) {
             //var_dump($A);die;
             if (is_string($A) && defined('CP1251')) {
                 $A = mb_convert_encoding($A, 'utf-8', 'windows-1251');
             }
             Dumphper::dump($A);
         }
     } else {
         $i = 1;
         ob_start();
         foreach ($Args as $A) {
             echo str_repeat('*', $i++) . ' ';
             var_dump($A);
         }
         $String = ob_get_contents();
         @ob_end_clean();
         $Encoding = 'cp866';
         if (class_exists('Gdn', FALSE)) {
             $Encoding = Gdn::Config('Plugins.UsefulFunctions.Console.MessageEnconding');
         }
         $String = preg_replace("/\\=\\>\n +/s", '=> ', $String);
         if ($Encoding && $Encoding != 'utf-8') {
             $String = mb_convert_encoding($String, $Encoding, 'utf-8');
         }
         echo $String;
     }
     if (class_exists('Gdn', FALSE)) {
         if (method_exists('Gdn', 'Database')) {
             $Database = Gdn::Database();
             if ($Database != Null) {
                 $Database->CloseConnection();
             }
         }
     }
     if ($bExit) {
         exit;
     }
 }
Example #5
0
<?php

require_once dirname(__FILE__) . '/../../../plugins/UsefulFunctions/bootstrap.console.php';
$SQL = Gdn::SQL();
$Px = $SQL->Database->DatabasePrefix;
$ChunkModel = new ChunkModel();
$Limit = Console::Argument('limit', 5);
if (!is_numeric($Limit) || $Limit <= 0) {
    $Limit = 5;
}
Gdn::Config()->Set('Plugins.UsefulFunctions.LoremIpsum.Language', 'noIpsum', True, False);
/**
* Examples:
* 
*/
Console::Message("Start.");
for ($i = 0; $i < $Limit; $i++) {
    $Format = 'xHtml';
    $Name = LoremIpsum(2);
    $Body = LoremIpsum('p' . rand(2, 3));
    $InsertUserID = rand(1, 5);
    $Fields = compact('Format', 'Name', 'Body', 'InsertUserID');
    $ChunkID = $ChunkModel->Save($Fields);
    if (!$ChunkID) {
        Console::Message('^1Error: %s', VarDump($ChunkModel->Validation->Results()));
        return;
    }
    Console::Message("Saved ^3%s (%s)", $ChunkID, $Name);
}
Example #6
0
 protected function _NodeValues($Node)
 {
     if (!is_object($Node)) {
         $Node = $this->GetNode($Node);
         if ($Node === False) {
             trigger_error(ErrorMessage('Empty node.', __CLASS__, __FUNCTION__, VarDump(func_get_arg(0))));
             return False;
         }
     }
     $Result = array_map('intval', array($Node->{$this->LeftKey}, $Node->{$this->RightKey}, $Node->{$this->DepthKey}, $Node->{$this->PrimaryKey}, $Node->{$this->ParentKey}));
     return $Result;
 }