Changeset 2747
- Timestamp:
- 07/10/08 17:16:23 (17 months ago)
- Location:
- branches/release-41/lib/MT
- Files:
-
- 6 modified
-
Blocklist.pm (modified) (1 diff)
-
Core.pm (modified) (1 diff)
-
DateTime.pm (modified) (1 diff)
-
FileMgr.pm (modified) (1 diff)
-
Image.pm (modified) (4 diffs)
-
Tool.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-41/lib/MT/Blocklist.pm
r2359 r2747 42 42 43 43 1; 44 45 __END__ 46 47 =head1 NAME 48 49 MT::Blocklist - MT object class for storing rules for filtering content. 50 51 =head1 METHODS 52 53 =head2 MT::Blocklist->block_these($blog_id, $action, @urls) 54 55 Adds the specified URLs to the blocklist table with the specified I<$action> 56 and for the specified I<$blog_id>. 57 58 =head1 LICENSE 59 60 The license that applies is the one you agreed to when downloading 61 Movable Type. 62 63 =head1 AUTHOR & COPYRIGHT 64 65 Except where otherwise noted, MT is Copyright 2001-2008 Six Apart. 66 All rights reserved. 67 68 =cut -
branches/release-41/lib/MT/Core.pm
r2541 r2747 1003 1003 1004 1004 1; 1005 __END__ 1006 1007 =head1 NAME 1008 1009 MT::Core - Core component for Movable Type functionality. 1010 1011 =head1 METHODS 1012 1013 =head2 MT::Core::trans($phrase) 1014 1015 Stub method that returns the phrase it is given. 1016 1017 =head2 MT::Core->name() 1018 1019 Returns a string identifying this component. 1020 1021 =head2 MT::Core->id() 1022 1023 Returns the identifier for this component. 1024 1025 =head2 MT::Core::load_junk_filters() 1026 1027 Routine that returns the core junk filter registry elements (these 1028 live in the L<MT::JunkFilter> package). 1029 1030 =head2 MT::Core::load_core_tasks() 1031 1032 Routine that returns the core L<MT::TaskMgr> registry elements. 1033 1034 =head2 MT::Core->remove_temporary_files() 1035 1036 Utility method for removing any temporary files that MT generates. 1037 1038 =head2 MT::Core->remove_expired_sessions() 1039 1040 Utility method for clearing expired MT user session records. 1041 1042 =head2 MT::Core->remove_expired_search_caches() 1043 1044 Utility method for removing expired search cache records. 1045 1046 =head2 MT::Core::load_default_templates() 1047 1048 Routine that returns the default template set registry elements. 1049 1050 =head2 MT::Core::load_captcha_providers() 1051 1052 Routine that returns the CAPTCHA provider registry elements. 1053 1054 =head2 MT::Core::load_core_commenter_auth() 1055 1056 Routine that returns the core registry elements for commenter 1057 authentication methods. 1058 1059 =head2 MT::Core::load_core_tags() 1060 1061 Routine that returns the core registry elements for the MT 1062 template tags are enabled for the entire system (excludes 1063 application-specific tags). 1064 1065 =head2 MT::Core::load_upgrade_fns() 1066 1067 Routine that returns the core registry elements for the MT 1068 schema upgrade framework. 1069 1070 =head2 MT::Core::load_backup_instructions 1071 1072 Routine that returns the core registry elements for the MT 1073 Backup/Restore framework. 1074 1075 =head2 MT::Core->l10n_class 1076 1077 Returns the localization package for the core component. 1078 1079 =head2 $core->init_registry() 1080 1081 =head2 MT::Core::load_archive_types() 1082 1083 Routine that returns the core registry elements for the 1084 publishable archive types. See L<MT::ArchiveType>. 1085 1086 =head2 MT::Core::PerformanceLoggingPath 1087 1088 A L<MT::ConfigMgr> get/set method for the C<PerformanceLoggingPath> 1089 configuration setting. If the user has not designated a path, this 1090 will return a default location, which is programatically determined. 1091 1092 =head2 MT::Core::ProcessMemoryCommand 1093 1094 A L<MT::ConfigMgr> get/set method for the C<ProcessMemoryCommand> 1095 configuration setting. If the user has not assigned this themselves, 1096 it will return a default command, determined by the operating system 1097 Movable Type is running on. 1098 1099 =head2 MT::Core::SecretToken 1100 1101 A L<MT::ConfigMgr> get/set method for the C<SecretToken> 1102 configuration setting. If the user has not assigned this themselves, 1103 it will return a random token value, and save it to the database for 1104 future use. 1105 1106 =head2 MT::Core::DefaultUserTagDelimiter 1107 1108 A L<MT::ConfigMgr> get/set method for the C<DefaultUserTagDelimiter> 1109 configuration setting. Translates the keyword values 'comma' and 1110 'space' to the ASCII code for those characters. 1111 1112 =head2 MT::Core::NewUserAutoProvisioning 1113 1114 A L<MT::ConfigMgr> get/set method for the C<NewUserAutoProvisioning> 1115 configuration setting. Even if the user has enabled this setting, 1116 it will force a value of '0' unless the C<DefaultSiteRoot> and 1117 C<DefaultSiteURL> configuration settings are also assigned. 1118 1119 =head2 MT::Core::UserSessionCookieName 1120 1121 A L<MT::ConfigMgr> get/set method for the C<UserSessionCookieName> 1122 configuration setting. If the user has not specifically assigned 1123 this setting, a default value is returned, affected by the 1124 C<SingleCommunity> setting. If C<SingleCommunity> is enabled, it 1125 returns a cookie name that is the same for all blogs. If it is 1126 off, it returns a cookie name that is blog-specific (contains the 1127 blog id in the cookie name). 1128 1129 =head2 UserSessionCookiePath 1130 1131 A L<MT::ConfigMgr> get/set method for the C<UserSessionCookiePath> 1132 configuration setting. If the user has not specifically assigned 1133 this setting, a default value is returned, affected by the 1134 C<SingleCommunity> setting. If C<SingleCommunity> is enabled, it 1135 returns a path that is the same for all blogs ('/'). If it is 1136 off, it returns a value that will yield the blog's relative 1137 URL path. 1138 1139 =head1 LICENSE 1140 1141 The license that applies is the one you agreed to when downloading 1142 Movable Type. 1143 1144 =head1 AUTHOR & COPYRIGHT 1145 1146 Except where otherwise noted, MT is Copyright 2001-2008 Six Apart. 1147 All rights reserved. 1148 1149 =cut -
branches/release-41/lib/MT/DateTime.pm
r1745 r2747 245 245 =head1 NAME 246 246 247 MT::DateTime 247 MT::DateTime - A utility package for handling date/time values for Movable 248 Type. 248 249 249 250 =head1 METHODS 250 251 252 =head2 MT::DateTime->new(%attr) 253 254 Constructs a new C<MT::DateTime> object using the values in C<%attr>. 255 C<%attr> may contain: 256 257 =over 4 258 259 =item * year 260 261 A 4-digit year. 262 263 =item * month 264 265 Month number, where January is 0. 266 267 =item * day 268 269 Day number, from 1 to 31. 270 271 =item * hour 272 273 Hour in 24 hour notation (0-23). 274 275 =item * minute 276 277 Minutes (0-59). 278 279 =item * second 280 281 Seconds (0-59). 282 283 =item * time_zone 284 285 Timezone, in '+HH:MM', '-HH:MM', '+HH', or '-HH' notation. 286 287 =back 288 251 289 =head2 compare( a => $a, b => $b, blog => $blog ) 252 290 253 Compares two timestamp strings and returns negative valye, 0, or positive value 254 depending on whether the "a" argument is less than, equal to, or greater than 255 the "b" argument. 256 257 You can specify scalar value to "a" and "b". They are treated as timestamp values 258 (e.g. 20080405123456). You can also specify either epoch string (e.g the string 259 returned from time method), or MT::DateTime object. In those cases, you must 260 specify both value and type in a hash, for example: 261 262 MT::DateTime->compare( blog => $blog, 263 a => '20041231123456', b => { value => time(), type => 'epoch' } ); 291 Compares two timestamp strings and returns negative valye, 0, or 292 positive value depending on whether the "a" argument is less than, 293 equal to, or greater than the "b" argument. 294 295 You can specify scalar value to "a" and "b". They are treated as 296 timestamp values (e.g. 20080405123456). You can also specify either 297 epoch string (e.g the string returned from time method), or C<MT::DateTime> 298 object. In those cases, you must specify both value and type in a hash, 299 for example: 300 301 MT::DateTime->compare( blog => $blog, 302 a => '20041231123456', b => { value => time(), type => 'epoch' } ); 303 304 =head2 $datetime->week_year() 305 306 Returns the year for the start of the week for the object. 307 308 =head2 $datetime->week_number() 309 310 Returns the week number calculated for the object. 311 312 =head2 $datetime->year() 313 314 Returns the year component of the object. 315 316 =head2 $datetime->month() 317 318 Returns the month component of the object. 319 320 =head2 $datetime->day() 321 322 Returns the day component of the object. 323 324 =head2 $datetime->hour() 325 326 Returns the hours component of the object. 327 328 =head2 $datetime->minute() 329 330 Returns the minutes component of the object. 331 332 =head2 $datetime->second() 333 334 Returns the seconds component of the object. 335 336 =head2 $datetime->time_zone() 337 338 Returns the time zone component of the object. 339 340 =head2 $datetime->day_of_year() 341 342 Returns the day number of the year of the object. 343 344 =head2 $datetime->week() 345 346 Returns a list containing the year of the week (C<week_year>) and 347 the week number (C<week_number>). 348 349 =head2 MT::DateTime->weeks_in_year($year) 350 351 Returns the number of weeks that are in the specified C<$year>. Returns 352 either 52 or 53, depending on the year. 353 354 =head2 $datetime->ymd2rd( [ $year, $month, $day ]) 355 356 Converts the given C<$year>, C<$month>, C<$day> (or, if unspecified, 357 uses the year, month, day elements from C<$datetime>) into a 'Rata Die' 358 days value. 359 360 =head2 $datetime->tz_offset_as_seconds( [$offset] ) 361 362 Converts the given C<$offset> (or, if absent, uses the time_zone 363 component of C<$datetime>) into an expression of seconds. I.e., 364 an C<$offset> of '-1:30' would yield -5400. 264 365 265 366 =head1 AUTHOR & COPYRIGHT -
branches/release-41/lib/MT/FileMgr.pm
r1779 r2747 152 152 On error, returns C<undef>; see L<ERROR HANDLING>, below. 153 153 154 =head2 content_is_updated( )154 =head2 content_is_updated($file, $content) 155 155 156 Return one (1). 156 Returns true if the contents of I<$file> differs from the value in 157 I<$content>. 158 159 =head2 $fmgr->file_mod_time($file) 160 161 Returns the modification timestamp for I<$file>. 157 162 158 163 =head2 $fmgr->is_handle($file) -
branches/release-41/lib/MT/Image.pm
r2649 r2747 466 466 =head1 USAGE 467 467 468 =head2 MT::Image->new( %arg)468 =head2 MT::Image->new( %arg ) 469 469 470 470 Constructs a new I<MT::Image> object. Returns the new object on success; on … … 491 491 =back 492 492 493 =head2 $img->scale( %arg)493 =head2 $img->scale( %arg ) 494 494 495 495 Creates a thumbnail from the image represented by I<$img>; on success, returns … … 519 519 520 520 =back 521 522 =head2 MT::Image->inscribe_square( %arg ) 523 524 Calculates a square of dimensions that are capable of holding an image 525 of the height and width indicated. This method receives I<%arg>, which 526 may contain: 527 528 =over 4 529 530 =item * Height 531 532 =item * Width 533 534 =back 535 536 The square will be the smaller value of the Height and Width parameter. 537 538 The method returns a hash containing the following information: 539 540 =over 4 541 542 =item * Size 543 544 The size of the calculated square, in pixels. 545 546 =item * X 547 548 The horizontal space to crop from the image, in pixels. 549 550 =item * Y 551 552 The vertical space to crop from the image, in pixels. 553 554 =back 555 556 This information is suited for the L<crop> method. 557 558 =head2 $img->make_square() 559 560 Takes an image which may or may not be a square in dimension and forces 561 it into a square shape (trimming the longer side, as necesary). 521 562 522 563 =head2 $img->get_dimensions(%arg) … … 529 570 between 1 to 100). 530 571 572 =head2 MT::Image->check_upload( %arg ) 573 574 Utility method used to handle image upload and storage, along with some 575 constraining factors. The I<%arg> hash may contain the following elements: 576 577 =over 4 578 579 =item * Fh 580 581 A filehandle for the uploaded file. 582 583 =item * Fmgr 584 585 A handle to a L<MT::FileMgr> object that will be used for writing the 586 file into place. 587 588 =item * Local 589 590 A path and filename for the location to write the uploaded file. 591 592 =item * Max (optional) 593 594 A number that specifies the maximum physical file size for the uploaded 595 image (specified in bytes). 596 597 =item * MaxDim (optional) 598 599 A number that specifies the maximum dimension allowed for the uploaded 600 image (specified in pixels). 601 602 =back 603 604 If the uploaded image is valid and passes the file size and image 605 dimension requirements (assuming those parameters are given), 606 the return value is a list consisting of the following elements: 607 608 =over 4 609 610 =item * $width 611 612 The width of the uploaded image, in pixels. 613 614 =item * $height 615 616 The height of the uploaded image, in pixels. 617 618 =item * $id 619 620 A string identifying the type of image file (returned by L<Image::Size>, 621 so typically "GIF", "JPG", "PNG"). 622 623 =item * $write_coderef 624 625 A Perl coderef that, when invoked writes the image to the specified 626 location. 627 628 =back 629 630 If any error occurs from this routine, it will return 'undef', and 631 assign the error message, accessible using the L<errstr> class method. 632 531 633 =head1 AUTHOR & COPYRIGHT 532 634 -
branches/release-41/lib/MT/Tool.pm
r2659 r2747 178 178 requested by the user (that is, how many times the C<-v> option was used). 179 179 180 =head2 $tool-E<gt>set_up_app() 181 182 This helper method creates a MT instance and configures it to look like 183 a L<MT::App> instance (although, it isn't), and invokes the 'init_app' 184 callback using this instance. 185 186 =head2 $class-E<gt>show_help 187 188 Displays command-line help provided by the C<MT::Tool> subclass L<help> 189 method. 190 191 =head2 $class-E<gt>show_usage 192 193 Displays commnad-line usage instructions provided by the C<MT::Tool> 194 subclass L<usage> method. 195 180 196 =head1 SEE ALSO 181 197
