当前位置: 首页>>代码示例>>PHP>>正文


PHP YDDebugUtil类代码示例

本文整理汇总了PHP中YDDebugUtil的典型用法代码示例。如果您正苦于以下问题:PHP YDDebugUtil类的具体用法?PHP YDDebugUtil怎么用?PHP YDDebugUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了YDDebugUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     // Add a first set of elements
     $form->addElement('date', 'date1', 'Date1', '');
     $form->addElement('date', 'date2', 'Date2 (monthabbr = true)', array('id' => 'mydate'), array('monthabbr' => true));
     $form->addElement('date', 'date3', 'Date3 (monthnumber = true)', '', array('monthnumber' => true));
     $form->addElement('date', 'date4', 'Date4 (monthucfirst = true)', '', array('monthucfirst' => true));
     $form->addElement('date', 'date5', 'Date5 (yearstart = 1970, yearend=2007, yeartwodigits = true)', '', array('yearstart' => 1970, 'yearend' => 2007, 'yeartwodigits' => true));
     $form->addElement('date', 'time1', 'Time1', '', array('time'));
     $form->addElement('date', 'time2', 'Time2 (minutesoffset = 10)', '', array('time', 'minutesoffset' => 10));
     $form->addElement('date', 'time3', 'Time3 (secondsoffset = 15)', '', array('time', 'secondsoffset' => 15));
     $form->addElement('date', 'datetime1', 'DateTime1', '', array('datetime'));
     $form->addElement('date', 'date6', 'Date6 (month, year)', '', array('month', 'year'));
     $form->addElement('date', 'date7', 'Date7 (day, month)', '', array('day', 'month'));
     $form->addElement('date', 'date8', 'Date8 (day, hours, minutes)', '', array('day', 'hours', 'minutes'));
     $form->addElement('submit', '_cmdSubmit', 'Submit');
     // Add rules
     $form->addRule(array('date1', 'date2', 'date3', 'date4', 'date5', 'time1', 'time2', 'time3', 'datetime1', 'date6', 'date7', 'date8'), 'date', 'must be a valid date');
     if ($form->validate()) {
         YDDebugUtil::dump($form->getValues(), '$form->getValues()');
     }
     // Display form
     $form->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:26,代码来源:form_date.php

示例2: actionDefault

 function actionDefault()
 {
     // Get the data
     $db = YDDatabase::getInstance('mysql', 'test', 'root', '', 'localhost');
     $this->setVar('processList', $db->getRecords('show processlist'));
     $this->setVar('status', $db->getRecords('show status'));
     $this->setVar('variables', $db->getRecords('show variables'));
     $this->setVar('version', $db->getServerVersion());
     $this->setVar('sqlcount', $db->getSqlCount());
     // Output the template
     $this->outputTemplate();
     // Test string escaping
     YDDebugUtil::dump($db->string("Pieter's Framework"), '$db->string');
     // Test timestamps
     YDDebugUtil::dump($db->getDate(), 'getDate()');
     YDDebugUtil::dump($db->getTime(), 'getTime()');
     YDDebugUtil::dump($db->getDate('__NOW__'), 'getDate( \'__NOW__\' )');
     YDDebugUtil::dump($db->getTime('__NOW__'), 'getTime( \'__NOW__\' )');
     YDDebugUtil::dump($db->getDate('28-FEB-1977'), 'getDate( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->getTime('28-FEB-1977'), 'getTime( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->sqlString($db->getDate()), 'sqlString( getDate() )');
     YDDebugUtil::dump($db->sqlString($db->getTime()), 'sqlString( getTime() )');
     YDDebugUtil::dump($db->sqlString($db->getDate('__NOW__')), 'sqlString( getDate( \'__NOW__\' ) )');
     YDDebugUtil::dump($db->sqlString($db->getTime('__NOW__')), 'sqlString( getTime( \'__NOW__\' ) )');
     // Test errors
     YDDebugUtil::dump($db->getRecords('xx'), 'should return error');
     // Close the database connection
     $db->close();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:29,代码来源:database1.php

示例3: actionDefault

 function actionDefault()
 {
     // Get the data
     $db = YDDatabase::getInstance('postgres', 'template1', 'pieter', 'kermit', 'yellowduck');
     // Output the server version
     YDDebugUtil::dump($db->getServerVersion(), 'Version:');
     // Output some queries
     YDDebugUtil::dump($db->getRecords('select now()'), 'select now();');
     // Test string escaping
     YDDebugUtil::dump($db->string("Pieter's Framework"), '$db->string');
     // Show number of queries
     YDDebugUtil::dump($db->getSqlCount(), 'Number of queries');
     // Test timestamps
     YDDebugUtil::dump($db->getDate(), 'getDate()');
     YDDebugUtil::dump($db->getTime(), 'getTime()');
     YDDebugUtil::dump($db->getDate('__NOW__'), 'getDate( \'__NOW__\' )');
     YDDebugUtil::dump($db->getTime('__NOW__'), 'getTime( \'__NOW__\' )');
     YDDebugUtil::dump($db->getDate('28-FEB-1977'), 'getDate( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->getTime('28-FEB-1977'), 'getTime( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->sqlString($db->getDate()), 'sqlString( getDate() )');
     YDDebugUtil::dump($db->sqlString($db->getTime()), 'sqlString( getTime() )');
     YDDebugUtil::dump($db->sqlString($db->getDate('__NOW__')), 'sqlString( getDate( \'__NOW__\' ) )');
     YDDebugUtil::dump($db->sqlString($db->getTime('__NOW__')), 'sqlString( getTime( \'__NOW__\' ) )');
     // Test limits
     YDDebugUtil::dump($db->_prepareSqlForLimit('SELECT * FROM TABLE', 10));
     YDDebugUtil::dump($db->_prepareSqlForLimit('SELECT * FROM TABLE', 10, 25));
     // Test errors
     YDDebugUtil::dump($db->getRecords('xx'), 'should return error');
     // Close the database connection
     $db->close();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:31,代码来源:database4.php

示例4: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     $form->registerFilter('reverse', 'strrev');
     $form->setDefaults(array('txt2' => 'First text', 'txt3' => "2\nlines", 'hid1' => 'me hidden', 'chk1' => 'x', 'chk2' => false, 'sel1' => 2));
     $text =& $form->addElement('text', 'txt1', 'Enter text 1:');
     $text->_label = 'new label for txt1';
     $form->addElement('text', 'txt2', 'Enter text 2:', array('class' => 'textInputClass', 'name' => 'x'));
     $form->addElement('textarea', 'txt3', 'Enter text 2:');
     $form->addElement('textareacounter', 'txtcounter_1', 'Textarea counter 1', array(), array('maxlength' => 10, 'before' => ' (', 'after' => ' characters remaining)'));
     $form->addElement('textareacounter', 'txtcounter_2', 'Textarea counter 2');
     $form->addElement('radio', 'rad1', 'Select a value 1:', array(), array(1 => 'een', 2 => 'twee'));
     $form->addElement('radio', 'rad2', 'Select a value 2:', array(), array(1 => 'een<br/>', 2 => 'twee'));
     $form->addElement('hidden', 'hid1', '');
     $form->addElement('hidden', 'hid2', '', array(), 'i am also hidden');
     $form->addElement('image', 'img1', '', array(), 'http://www.scripting.com/images/xml.gif');
     $form->addElement('password', 'pas1', 'Enter your password');
     $form->addElement('bbtextarea', 'bbt1', 'Enter your BBCode');
     $form->addElement('checkbox', 'chk1', 'Select me please');
     $form->addElement('checkbox', 'chk2', 'Select me please');
     $form->addElement('select', 'sel1', 'Select an option:', array(), array(1 => 'een', 2 => 'twee'));
     $form->addElement('span', 'span1', 'This is a span. The next element is an image (img).');
     $form->addElement('img', 'img2', 'http://www.scripting.com/images/xml.gif');
     $form->addElement('file', 'fil1', 'Select an file:');
     $form->addElement('submit', 'cmd1', 'Send');
     $form->addElement('reset', 'res1', 'Reset');
     $form->addFilter('__ALL__', 'upper');
     $form->addFilter('txt1', 'trim');
     $form->addFilter('txt2', 'reverse');
     $form->addRule('txt1', 'required', 'txt1 is required');
     $form->addRule('chk2', 'exact', 'chk2 is required', 1);
     $form->addFormRule(array(&$this, 'formrule'), 'txt1 is required');
     if (YDConfig::get('YD_DEBUG') == 1 || YDConfig::get('YD_DEBUG') == 2) {
         YDDebugUtil::dump($form->_regElements, 'Registered elements');
         YDDebugUtil::dump($form->_regRules, 'Registered rules');
         YDDebugUtil::dump($form->_regFilters, 'Registered filters');
         YDDebugUtil::dump($form->_filters, 'Filters');
         YDDebugUtil::dump($form->_rules, 'Rules');
         YDDebugUtil::dump($form->_formrules, 'Form Rules');
         YDDebugUtil::dump($form->getValue('txt1'), 'txt1');
         YDDebugUtil::dump($form->getValue('txt2'), 'txt2');
         YDDebugUtil::dump($_POST, '$_POST');
         YDDebugUtil::dump($_FILES, '$_FILES');
         YDDebugUtil::dump($form->toArray());
     }
     if ($form->validate()) {
         YDDebugUtil::dump($form->getModifiedValues(), 'Form modified values');
         YDDebugUtil::dump($form->getValues(), 'Form values');
     } else {
         $form->display();
     }
     // Create the form
     $form2 = new YDForm('form2');
     $form2->setDefaults(array('txt1' => 'First text'));
     $form2->addElement('text', 'txt1', 'Enter text 1:');
     $form2->addElement('text', 'txt2', 'Enter text 2:');
     $form2->addElement('submit', 'cmd1', 'Send');
     $form2->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:60,代码来源:form2.php

示例5: actionDefault

 function actionDefault()
 {
     // We want to test the different image types
     foreach (array('jpg', 'gif', 'png') as $imgType) {
         // Get the file object for the current file
         $img = new YDFSImage(dirname(__FILE__) . '/fsimage.' . $imgType);
         // Dump the object
         YDDebugUtil::dump($img, __FILE__);
         // Dump the object
         echo '<br>Basename: ' . $img->getBasename();
         echo '<br>Extension: ' . $img->getExtension();
         echo '<br>Path: ' . $img->getPath();
         echo '<br>LastModified: ' . $img->getLastModified();
         echo '<br>File size: ' . $img->getSize();
         echo '<br>Width: ' . $img->getWidth();
         echo '<br>Height: ' . $img->getHeight();
         echo '<br>Image type: ' . $img->getImageType();
         echo '<br>MIME type: ' . $img->getMimeType();
         // Image size
         YDDebugUtil::dump($img->getImageSize(), 'Imagesize');
         // Save a thumbnail
         YDDebugUtil::dump($img->saveThumbnail(150, 110, 'fsimage.thumb.jpg'));
     }
     // Get the file object for the current file
     $file = new YDFSFile('nofile.php');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:26,代码来源:fsimage.php

示例6: actionDefault

 function actionDefault()
 {
     // Get the data
     $db = YDDatabase::getInstance('sqlite', 'database2.db');
     // Output the server version
     YDDebugUtil::dump($db->getServerVersion(), 'Version:');
     // Output some queries
     YDDebugUtil::dump($db->getRecords('select * from escalations'), 'escalations');
     YDDebugUtil::dump($db->getRecords('select * from sqlite_master'), 'sqlite_master');
     // Test string escaping
     YDDebugUtil::dump($db->string("Pieter's Framework"), '$db->string');
     // Show number of queries
     YDDebugUtil::dump($db->getSqlCount(), 'Number of queries');
     // Test timestamps
     YDDebugUtil::dump($db->getDate(), 'getDate()');
     YDDebugUtil::dump($db->getTime(), 'getTime()');
     YDDebugUtil::dump($db->getDate('__NOW__'), 'getDate( \'__NOW__\' )');
     YDDebugUtil::dump($db->getTime('__NOW__'), 'getTime( \'__NOW__\' )');
     YDDebugUtil::dump($db->getDate('28-FEB-1977'), 'getDate( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->getTime('28-FEB-1977'), 'getTime( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->sqlString($db->getDate()), 'sqlString( getDate() )');
     YDDebugUtil::dump($db->sqlString($db->getTime()), 'sqlString( getTime() )');
     YDDebugUtil::dump($db->sqlString($db->getDate('__NOW__')), 'sqlString( getDate( \'__NOW__\' ) )');
     YDDebugUtil::dump($db->sqlString($db->getTime('__NOW__')), 'sqlString( getTime( \'__NOW__\' ) )');
     // Test errors
     YDDebugUtil::dump($db->getRecords('xx'), 'should return error');
     // Close the database connection
     $db->close();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:29,代码来源:database2.php

示例7: actionDefault

 function actionDefault()
 {
     // Define the date format used for testing
     $fmt = '%A, %d %B %Y';
     // Default locale is always en
     YDDebugUtil::dump(YDLocale::get(), 'Current locale:');
     YDDebugUtil::dump(strftime($fmt), 'strftime test');
     // Set the locale to English
     YDLocale::set('eng');
     YDDebugUtil::dump(YDLocale::get(), 'Current locale:');
     YDDebugUtil::dump(strftime($fmt), 'strftime test');
     // Set the locale to Dutch
     YDLocale::set('nl');
     YDDebugUtil::dump(YDLocale::get(), 'Current locale:');
     YDDebugUtil::dump(strftime($fmt), 'strftime test');
     YDDebugUtil::dump(date("l dS of F Y h:i:s A"), 'date function');
     // Set the locale to Portugese
     YDLocale::set('ptg');
     YDDebugUtil::dump(YDLocale::get(), 'Current locale:');
     YDDebugUtil::dump(strftime($fmt), 'strftime test');
     // Set the locale to Italian
     YDLocale::set('ita');
     YDDebugUtil::dump(YDLocale::get(), 'Current locale:');
     YDDebugUtil::dump(strftime($fmt), 'strftime test');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:25,代码来源:locale.php

示例8: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     $form->addElement('text', 'text1', 'Enter text 1:');
     $form->addElement('text', 'text2', 'Enter text 2:');
     $form->addElement('textarea', 'textarea', 'Enter text 3:');
     $form->addElement('radio', 'radio1', 'Select a value 1:', array(), array(1 => 'one', 2 => 'two'));
     $form->addElement('radio', 'radio2', 'Select a value 2:', array(), array(1 => 'one', 2 => 'two'));
     $form->addElement('hidden', 'hidden1', '');
     $form->addElement('hidden', 'hidden2', '', array(), 'i am also hidden');
     $form->addElement('image', 'image', '', array(), 'http://www.scripting.com/images/xml.gif');
     $form->addElement('password', 'password', 'Enter your password');
     $form->addElement('bbtextarea', 'bbtextarea', 'Enter your BBCode');
     $form->addElement('checkbox', 'checkbox1', 'Check me 1');
     $form->addElement('checkbox', 'checkbox2', 'Check me 2');
     $form->addElement('select', 'select', 'Select an option:', array(), array(1 => 'one', 2 => 'two'));
     $form->addElement('dateselect', 'dateselect', 'Select a date:');
     $form->addElement('datetimeselect', 'datetimeselect', 'Select a date:');
     $form->addElement('timeselect', 'timeselect', 'Select a date:');
     $form->addElement('file', 'file', 'Select an file:');
     $form->addElement('submit', 'submit', 'Send');
     $form->addElement('button', 'button', 'Button');
     $form->addElement('reset', 'resest', 'Reset');
     $form->setDefaults(array('radio1' => 1, 'radio2' => 2, 'text1' => 'my text one', 'select' => 1, 'checkbox1' => 'on'));
     if ($form->validate()) {
         YDDebugUtil::dump($form->getDefaults(), 'Form default values');
         YDDebugUtil::dump($form->getModifiedValues(), 'Form modified values');
         YDDebugUtil::dump($form->getValues(), 'Form values');
     } else {
         $form->display();
     }
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:33,代码来源:form_modified.php

示例9: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1', 'GET', '', '_self', array('class' => 'myform'));
     // Add elements
     $form->addElement('text', 'txt1', 'Enter text 1:');
     $form->addElement('text', 'txt2', 'Enter text 2:');
     $form->addElement('submit', 'cmdSubmit', 'submit');
     $form->addRule('txt1', 'required', 'txt1 is required');
     $form->addRule('txt1', 'maxlength', 'txt1 must be smaller than 15', 15);
     $form->addCompareRule(array('txt1', 'txt2'), 'equal', 'txt1 and txt2 must be equal');
     $form->addFormRule('formrule1');
     $form->addFormRule(array('YDValidateRule', 'formrule2'));
     $form->addFilter('txt1', 'trim');
     $form->addFilter('txt2', 'trim');
     // Convert the form to XML
     $xml = $form->render('xml');
     YDDebugUtil::dump($xml, 'Form as XML data');
     //YDDebugUtil::dump( $form );
     // Recreate a new form from the XML data
     $form2 = new YDForm('form1');
     $form2->import('xml', $xml);
     //YDDebugUtil::dump( $form2 );
     YDDebugUtil::dump(array_diff_assoc($form->toArray(), $form2->toArray()), 'toArray difference');
     YDDebugUtil::dump(array_diff_assoc($form->_attributes, $form2->_attributes), '_attributes difference');
     YDDebugUtil::dump(array_diff_assoc($form->_elements, $form2->_elements), '_elements difference');
     YDDebugUtil::dump(array_diff_assoc($form->_rules, $form2->_rules), '_rules difference');
     YDDebugUtil::dump(array_diff_assoc($form->_filters, $form2->_filters), '_filters difference');
     YDDebugUtil::dump(array_diff_assoc($form->_comparerules, $form2->_comparerules), '_comparerules difference');
     YDDebugUtil::dump(array_diff_assoc($form->_formrules, $form2->_formrules), '_formrules difference');
     YDDebugUtil::dump(array_diff_assoc($form->_regElements, $form2->_regElements), '_regElements difference');
     YDDebugUtil::dump(array_diff_assoc($form->_regRules, $form2->_regRules), '_regRules difference');
     YDDebugUtil::dump(array_diff_assoc($form->_regFilters, $form2->_regFilters), '_regFilters difference');
     YDDebugUtil::dump(array_diff_assoc($form->_regRenderers, $form2->_regRenderers), '_regRenderers difference');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:35,代码来源:form_xml2.php

示例10: actionDefault

 function actionDefault()
 {
     // Get the file object for the current file
     $file = new YDFSFile(__FILE__);
     // Dump the object
     echo __FILE__;
     YDDebugUtil::dump($file);
     // Dump the object
     echo '<br>Basename: ' . $file->getBasename();
     echo '<br>Extension: ' . $file->getExtension();
     echo '<br>Path: ' . $file->getPath();
     echo '<br>LastModified: ' . $file->getLastModified();
     echo '<br>File size: ' . $file->getSize();
     // Get the contents
     YDDebugUtil::dump($file->getContents(), '$file->getContents()');
     // Get the partial contents
     YDDebugUtil::dump($file->getContents(2, 3), '$file->getContents( 2, 3 )');
     // Create a dummy file
     $dir = new YDFSDirectory('.');
     $file = $dir->createFile('dummy.txt', 'initial contents');
     // Update the contents
     $file->setContents('new contents');
     // Get the contents
     YDDebugUtil::dump($file->getContents(), '$file->getContents() after update');
     // Append the contents
     $file->setContents(YD_CRLF . 'appended contents', true);
     // Get the contents
     YDDebugUtil::dump($file->getContents(), '$file->getContents() after append');
     // Delete the file
     $file->delete();
     // Get the file object for the current file
     $file = new YDFSFile('nofile.php');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:33,代码来源:fsfile.php

示例11: actionDefault

 function actionDefault()
 {
     // Get the data
     $db = YDDatabase::getInstance('oracle', 'CREODB_STATLER', 'prinergy_rpt', 'prinergy_rpt');
     // Output the server version
     YDDebugUtil::dump($db->getServerVersion(), 'Version:');
     // Output some queries
     YDDebugUtil::dump($db->getRecords('select * from RPT_Customer_V'), 'RPT_Customer_V');
     // Output some queries
     YDDebugUtil::dump($db->getValue('select sysdate from dual'), 'sysdate');
     // Test string escaping
     YDDebugUtil::dump($db->escape("Pieter's Framework"), '$db->escape');
     // Show number of queries
     YDDebugUtil::dump($db->getSqlCount(), 'Number of queries');
     // Test timestamps
     YDDebugUtil::dump($db->getDate(), 'getDate()');
     YDDebugUtil::dump($db->getTime(), 'getTime()');
     YDDebugUtil::dump($db->getDate('__NOW__'), 'getDate( \'__NOW__\' )');
     YDDebugUtil::dump($db->getTime('__NOW__'), 'getTime( \'__NOW__\' )');
     YDDebugUtil::dump($db->getDate('28-FEB-1977'), 'getDate( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->getTime('28-FEB-1977'), 'getTime( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->escapeSql($db->getDate()), 'escapeSql( getDate() )');
     YDDebugUtil::dump($db->escapeSql($db->getTime()), 'escapeSql( getTime() )');
     YDDebugUtil::dump($db->escapeSql($db->getDate('__NOW__')), 'escapeSql( getDate( \'__NOW__\' ) )');
     YDDebugUtil::dump($db->escapeSql($db->getTime('__NOW__')), 'escapeSql( getTime( \'__NOW__\' ) )');
     // Test limits
     YDDebugUtil::dump($db->_prepareSqlForLimit('SELECT * FROM TABLE', 10));
     YDDebugUtil::dump($db->_prepareSqlForLimit('SELECT * FROM TABLE', 10, 25));
     // Test errors
     YDDebugUtil::dump($db->getRecords('xx'), 'should return error');
     // Close the database connection
     $db->close();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:33,代码来源:database3.php

示例12: actionDefault

 function actionDefault()
 {
     // Get the directory object for the current directory
     $dir = new YDFSDirectory(dirname(__FILE__));
     // Dump the object
     YDDebugUtil::dump($dir, dirname(__FILE__));
     // Dump the path properties
     YDDebugUtil::dump($dir->getBasename(), '$dir->getBasename()');
     YDDebugUtil::dump($dir->getPath(), '$dir->getPath()');
     YDDebugUtil::dump($dir->getAbsolutePath(), '$dir->getAbsolutePath()');
     YDDebugUtil::dump($dir->getAbsolutePath(), '$dir->getAbsolutePath()');
     YDDebugUtil::dump($dir->getSize(), '$dir->getSize()');
     YDDebugUtil::dump($dir->getSize(false, true), '$dir->getSize( false, true )');
     YDDebugUtil::dump($dir->getSize(true), '$dir->getSize( true )');
     YDDebugUtil::dump($dir->getSize(true, true), '$dir->getSize( true, true )');
     YDDebugUtil::dump($dir->getFileCount(), '$dir->getFileCount()');
     YDDebugUtil::dump($dir->getDirectoryCount(), '$dir->getDirectoryCount()');
     // All files in the directory
     YDDebugUtil::dump($dir->getContents(), '$dir->getContents()');
     // PHP files in the directory
     YDDebugUtil::dump($dir->getContents('*.tpl'), '$dir->getContents( \'*.tpl\' )');
     // PHP files in the directory
     YDDebugUtil::dump($dir->getContents(array('*.jpg', '*.txt')), '$dir->getContents( array( \'*.jpg\', \'*.txt\' ) )');
     // Getting files recursively
     YDDebugUtil::dump($dir->getFilesRecursively('*.tpl'), '$dir->getFilesRecursively( \'*.tpl\' )');
     // PHP files in the directory
     YDDebugUtil::dump($dir->getContents(array('*.jpg', '*.txt', '!bbcode.*')), '$dir->getContents( array( \'*.jpg\', \'*.txt\', \'!bbcode.*\' ) )');
     // Create subdirectory
     YDDebugUtil::dump($dir->createDirectory('test'), '$dir->createDirectory( \'test\' ) )');
     // Delete a directory tree
     YDDebugUtil::dump($dir->deleteDirectory('test'), '$dir->deleteDirectory( \'test\' )');
     YDDebugUtil::dump($dir->deleteDirectory('xxx'), '$dir->deleteDirectory( \'xxx\' )');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:33,代码来源:fsdirectory.php

示例13: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     $elementDate = $form->addElement('dateselect', 'dateSelect1', 'Enter data:');
     $elementDate = $form->addElement('dateselect', 'dateSelect2', 'Enter data:');
     $elementTime = $form->addElement('timeselect', 'timeSelect1', 'Enter data:');
     $elementDateTime = $form->addElement('datetimeselect', 'datetimeSelect1', 'Enter data:');
     $form->addElement('submit', 'cmd1', 'Send');
     $form->setDefaults(array('dateSelect1' => array('month' => 4, 'day' => 4, 'year' => 2002)));
     if (YD_DEBUG == 1) {
         YDDebugUtil::dump($form->_regElements, 'Registered elements');
         YDDebugUtil::dump($form->_regRules, 'Registered rules');
         YDDebugUtil::dump($form->_regFilters, 'Registered filters');
         YDDebugUtil::dump($form->_filters, 'Filters');
         YDDebugUtil::dump($form->_rules, 'Rules');
         YDDebugUtil::dump($form->_formrules, 'Form Rules');
         YDDebugUtil::dump($form->getValue('txt1'), 'txt1');
         YDDebugUtil::dump($form->getValue('txt2'), 'txt2');
         YDDebugUtil::dump($_POST, '$_POST');
         YDDebugUtil::dump($_FILES, '$_FILES');
     }
     if ($form->validate()) {
         YDDebugUtil::dump($elementDate->getTimeStamp(), '$elementDate->getTimeStamp()');
         YDDebugUtil::dump($elementDate->getTimeStamp('%d/%m/%Y'), '$elementDate->getTimeStamp( "%d/%m/%Y" )');
         YDDebugUtil::dump(date('M-d-Y', $elementDate->getTimeStamp()), '$elementDate->gdate( getTimeStamp() )');
         YDDebugUtil::dump($elementTime->getTimeStamp(), '$elementTime->getTimeStamp()');
         YDDebugUtil::dump($elementTime->getTimeStamp('%H:%M'), '$elementTime->getTimeStamp( "%H:%M" )');
         YDDebugUtil::dump($elementDateTime->getTimeStamp(), '$elementDateTime->getTimeStamp()');
         YDDebugUtil::dump($elementDateTime->getTimeStamp('%d/%m/%Y %H:%M'), '$elementDateTime->getTimeStamp( "%H:%M" )');
     }
     $form->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:33,代码来源:form_dateselect.php

示例14: actionDefault

 function actionDefault()
 {
     // Test the formatting of filesizes
     $filesizes = array('1152921504606846977', '1125899906842625', '1099511627777', '75715455455', '1048577', '6543', '42');
     // Format the filesizes
     foreach ($filesizes as $filesize) {
         YDDebugUtil::dump(YDStringUtil::formatFileSize($filesize), 'Formatting filesize: ' . $filesize);
     }
     // Test the formatDate function
     YDDebugUtil::dump(YDStringUtil::formatDate(time(), 'date'), 'Formatting date - date');
     YDDebugUtil::dump(YDStringUtil::formatDate(time(), 'time'), 'Formatting date - time');
     YDDebugUtil::dump(YDStringUtil::formatDate(time(), 'datetime'), 'Formatting date - datetime');
     YDDebugUtil::dump(YDStringUtil::formatDate(time(), '%x'), 'Formatting date - %x');
     // Test the encode string function
     $string = 'Pieter Claerhout @ creo.com "générales obsolète"';
     YDDebugUtil::dump(YDStringUtil::encodeString($string), 'Encoding: ' . $string);
     // Test the truncate function
     YDDebugUtil::dump(YDStringUtil::truncate($string), 'Truncate (default): ' . $string);
     YDDebugUtil::dump(YDStringUtil::truncate($string, 20), 'Truncate (20): ' . $string);
     YDDebugUtil::dump(YDStringUtil::truncate($string, 20, ' [more]'), 'Truncate (20/more): ' . $string);
     YDDebugUtil::dump(YDStringUtil::truncate($string, 20, ' [more]', true), 'Truncate (20/more/true): ' . $string);
     // Test the normalizing of newlines
     $string = "line1\nline2\rline3\r\nline4";
     YDDebugUtil::dump(explode("\n", $string), 'Original string');
     YDDebugUtil::dump(explode(YD_CRLF, YDStringUtil::normalizeNewlines($string)), 'normalizeNewlines');
     // Test the normalizing of newlines
     $string = "  line1  \n  line2  \r  line3  \r\n  line4  ";
     YDDebugUtil::dump(YDStringUtil::removeWhiteSpace($string), 'removeWhiteSpace');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:29,代码来源:stringutil.php

示例15: actionDefault

 function actionDefault()
 {
     // Set some variables
     YDConfig::set('MyConfigVar1', 'value cfg1');
     YDConfig::set('MyConfigVar2', 'value cfg2');
     YDConfig::set('MyConfigVar3', 'value cfg3');
     // Get the values
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3');
     // Check if the variables exist or not
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar1'), 'exists - MyConfigVar1');
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar2'), 'exists - MyConfigVar2');
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar3'), 'exists - MyConfigVar3');
     // Check an unexisting variable
     YDDebugUtil::dump(YDConfig::exists('xx'), 'exists - xx');
     // Set some variables, not overriding existing values
     YDConfig::set('MyConfigVar1', 'value cfg1 changed', false);
     YDConfig::set('MyConfigVar2', 'value cfg2 changed', false);
     YDConfig::set('MyConfigVar3', 'value cfg3 changed', false);
     // Get the values (should be unchanged)
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1 - changed1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2 - changed1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3 - changed1');
     // Set some variables, overriding existing values
     YDConfig::set('MyConfigVar1', 'value cfg1 changed', true);
     YDConfig::set('MyConfigVar2', 'value cfg2 changed', true);
     YDConfig::set('MyConfigVar3', 'value cfg3 changed', true);
     // Get the values (should be changed)
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1 - changed2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2 - changed2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3 - changed2');
     // Dump the contents of YDConfig
     YDConfig::dump();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:35,代码来源:config.php


注:本文中的YDDebugUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。