本文整理汇总了PHP中Output::println方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::println方法的具体用法?PHP Output::println怎么用?PHP Output::println使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::println方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
public function parse()
{
$executor = StepExecutor::getInstance();
$matches = array();
while ($line = fgets($this->_file)) {
$line = str_replace("\n", '', $line);
if (preg_match(self::STEP_PATTERN, $line, $matches) == 1) {
list($full, $step, $args) = $matches;
try {
$result = $executor->call($step, $args);
if (S_SUCCESS === $result) {
Output::success($line);
} elseif (S_PENDING === $result) {
Output::pending($line);
}
} catch (Exception $ex) {
Output::error($ex);
}
} else {
Output::println($line);
}
}
}
示例2: scan
public static function scan($url, $currentFolderDepth)
{
// debug : echo getRequest("https://docs.google.com/feeds/default/private/full?prettyprint=true");
$result = Connection::getRequest($url);
//."?prettyprint=true"
$folderContent = simplexml_load_string(str_replace('gd:etag', 'etag', $result));
$foldersArray = array();
$pagesArray = array();
// foldersArray: key:name => value:sub-folder
// pagesArray: key:menu_position => value:name
foreach ($folderContent->entry as $file) {
$type = (string) $file->content['type'];
$name = (string) $file->title;
$name = str_replace('"', '\\"', str_replace('$', '\\$', $name));
$srcUrl = (string) $file->content['src'];
$lastModified = (string) $file->updated;
$etag = (string) $file['etag'];
$path = $currentFolderDepth . ($currentFolderDepth == '' ? '' : '/') . StringTools::urlFormat(StringTools::indexClean($name));
$isNew = LAST_UPDATE_DATE < $lastModified;
if ($type == 'application/atom+xml;type=feed') {
if (!is_dir($path)) {
Output::createFolder($path);
Output::println("Folder: {$path}");
}
$foldersArray[$name . '!$!'] = self::scan($srcUrl, $path);
// Recursively store the sub folder.
} else {
if (substr($srcUrl, 0, strlen('https://docs.g')) == 'https://docs.g') {
$pagesArray[] = $name . '!$!';
// !$! is a end of name protection. It's removed in StringTools::serializeForInclude()
Output::println("Page: {$path}");
PageDownloader::download($srcUrl, $etag, $path . '.php');
} else {
if ($isNew || !file_exists($path)) {
Output::store(Connection::getRequest($srcUrl), $path);
Output::println("File: {$path}");
}
}
}
}
// Sort folders and pages by name
ksort($foldersArray);
sort($pagesArray);
// Remove indexes
foreach ($foldersArray as $key => $value) {
$cleanKey = StringTools::indexClean($key);
if ($key != $cleanKey) {
$foldersArray[$cleanKey] = $foldersArray[$key];
unset($foldersArray[$key]);
}
}
foreach ($pagesArray as $key => $value) {
$cleanValue = StringTools::indexClean($pagesArray[$key]);
$pagesArray[$key] = $cleanValue;
}
return array('folders' => $foldersArray, 'pages' => $pagesArray);
}