本文整理汇总了PHP中_echo函数的典型用法代码示例。如果您正苦于以下问题:PHP _echo函数的具体用法?PHP _echo怎么用?PHP _echo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_echo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionFind
public function actionFind()
{
if (isset($_POST['flightNumber'])) {
$current = date('Y-m-d');
$flightNumber = $_POST['flightNumber'];
$criteria = new CDbCriteria();
$criteria->join = 'LEFT JOIN tbl_mry_user ON tbl_mry_plan.userId=tbl_mry_user.userId';
$criteria->addCondition('flightNumber=:flightNumber');
$criteria->params = array(':flightNumber' => $flightNumber);
$criteria->order = 'startDate DESC';
$UserModel = User::model();
$total = $UserModel->count($criteria);
$pager = new CPagination($total);
$pager->pageSize = 10;
$pager->applyLimit($criteria);
$UserList = $UserModel->findAll($criteria);
//删除PASSWORD相关的信息
$dataFormat = new DataFormat();
$format = $dataFormat->format($userList, null, null);
$clientFlash = new ClientFlash();
if ($total > 0) {
$clientFlash->pushMobile(0, $format);
} else {
_echo(3, 数据为空);
}
}
}
示例2: parsePage
/**
* Parses the page
*
* @author Art <a.molcanovas@gmail.com>
* @return Apache
*/
protected function parsePage()
{
$d = new DOMDocument();
@$d->loadhtml($this->raw_html);
$xpath = new DOMXPath($d);
$versions = $xpath->query('//a[starts-with(@href, "/download/VC14/binaries/")]');
/** @var DOMNode $v */
foreach ($versions as $v) {
$c14 = $v->C14N();
if (stripos($c14, '.zip"') !== false && stripos($c14, '-win32-') !== false) {
$matches = [];
preg_match('~"[/a-z0-9\\-.]+"~i', $c14, $matches);
if (!empty($matches)) {
$matches = $matches[0];
$link = explode('-win32-', explode('httpd-', $matches)[1])[0];
$this->download_links[$link] = self::HOST . trim($matches, ' "');
}
}
}
if (empty($this->download_links)) {
_echo('No download links found.');
} else {
_echo(count($this->download_links) . ' Apache HTTPD versions found for download.');
}
return $this;
}
示例3: download
/**
* Downloads a version
*
* @author Art <a.molcanovas@gmail.com>
* @return AbstractBinSetup
*/
protected function download()
{
$this->downloader = new Downloader($this->links[$this->version], $this->dest);
if ($this->downloader->download()) {
_echo('Download successful. Setting up version ' . $this->version);
sleep(1);
} else {
die('Download failed. Aborting setup.');
}
return $this;
}
示例4: route
/**
* Attempts to route a request
*
* @author Art <a.molcanovas@gmail.com>
*/
function route()
{
if (!defined('PHPUNIT_RUNNING')) {
$route = trim(strtolower(get(IO::$argv[0])));
$file = DIR_CORE . 'routes' . DIRECTORY_SEPARATOR . $route . '.php';
if (file_exists($file)) {
include $file;
} else {
_echo('The route ' . $route . ' is invalid.');
}
}
}
示例5: downloadPage
/**
* Downloads the page
*
* @author Art <a.molcanovas@gmail.com>
* @return PHP
*/
protected function downloadPage()
{
_echo('Loading PHP download page');
$this->curl = new cURL(self::HOST . '/download/');
$this->curl->exec();
if ($this->curl->errno() != CURLE_OK) {
die('Failed to load PHP download page');
} else {
_echo('PHP download page loaded');
$this->raw_html = $this->curl->get();
}
return $this;
}
示例6: promptDownload
/**
* Prompts to download a different version
*
* @author Art <a.molcanovas@gmail.com>
* @return BinDownloaderTrait
*/
protected function promptDownload()
{
$this->getInstalledVers()->filterLinks();
if (!empty($this->links)) {
$version_numbers = array_keys($this->links);
_echo('The following versions were found for download (versions already installed are not included): ' . PHP_EOL . "\t" . implode(PHP_EOL . "\t", $version_numbers));
$io = trim(IO::readline('Which version would you like to download? Input N to abort'));
if (!$io) {
$this->promptDownload();
} elseif ($io == 'n') {
die('Aborting.');
} elseif (!isset($this->links[$io])) {
_echo('The version you selected is not available for download.');
$this->promptDownload();
} else {
$this->version = $io;
$this->download();
return $this;
}
} else {
die('There are no versions available to download that aren\'t installed already.');
}
return $this;
}
示例7: _info
function _info($text, $prefix = true)
{
_echo($text, '[info]: ');
}
示例8: copy
/**
* Copies unzipped contents
*
* @author Art <a.molcanovas@gmail.com>
* @return MySQL
*/
protected function copy()
{
$scan = scandir($this->dest_unzip);
Format::formatScandir($scan);
$dir = null;
foreach ($scan as $s) {
if (is_dir($this->dest_unzip . $s)) {
$dir = $this->dest_unzip . $s;
break;
}
}
if (!$dir) {
die('Could not find the MySQL source directory in the unzipped files. Aborting.');
} else {
_echo('Copying downloaded contents. It\'s usually over 1GB so this might take a while...');
$source = $dir;
$this->unzipped_destination = DIR_MYSQL . $this->version;
if (!file_exists($this->unzipped_destination . DIRECTORY_SEPARATOR)) {
mkdir($this->unzipped_destination . DIRECTORY_SEPARATOR, 777, true);
}
shell_exec('xcopy /s /e "' . $source . '" "' . $this->unzipped_destination . '"');
$this->unzipped_destination .= DIRECTORY_SEPARATOR;
if (file_exists($this->unzipped_destination . 'bin')) {
_echo('Copy successful!');
$this->cleanup();
$this->updateSettings();
} else {
die('Failed to copy. Terminating setup.');
}
}
return $this;
}
示例9: download
/**
* Starts the download
*
* @author Art <a.molcanovas@gmail.com>
* @return bool Whther the download was successful (on the cURL side)
*/
function download()
{
if (file_exists($this->dest)) {
unlink($this->dest);
}
$this->fp = fopen($this->dest, 'w');
$this->curl->setopt(CURLOPT_FILE, $this->fp);
$this->curl->exec();
fclose($this->fp);
$errno = $this->curl->errno();
if ($errno === CURLE_OK) {
return true;
} else {
_echo($this->curl->error());
return false;
}
}
示例10: strpos
$hs = "," . $str . ",";
$n = "," . $val . ",";
$pos = strpos($hs, $n);
$_wallet_prev = null;
$_wallet_next = null;
if ($pos !== false) {
$_wallet_prev = wallet_prev($hs, $n);
$_wallet_next = wallet_next($hs, $n);
}
return array("wallet_prev" => $_wallet_prev, "wallet_next" => $_wallet_next);
}
function _echo($str, $val)
{
echo "needle: " . $val . "\n";
$res = pagination($str, $val);
echo "prev: " . $res["wallet_prev"] . "\n";
echo "next: " . $res["wallet_next"] . "\n";
echo "------------------------------------\n";
}
echo "* ******************************** *\n";
echo "* STRING EXPLOSION without explode *\n";
echo "* ******************************** *\n";
echo "\n";
echo "Given Input " . $str . "\n";
echo "____________________________________\n\n";
foreach ($seed["arr"] as $val) {
_echo($seed["str"], (string) $val);
}
$endTime = time();
echo "\n\n";
echo "The calculations took " . (string) ($endTime - $startTime) . "ms!\n\n";
示例11: checkMemcache
/**
* Checks and creates the memcache directory
*
* @author Art <a.molcanovas@gmail.com>
* @return Setup
*/
function checkMemcache()
{
if (file_exists(DIR_MEMCACHE)) {
_echo('Memcache OK');
} else {
$rl = \IO::readline('Memcache not found. Would you like to download it? It\'s an optional module. [Y/N]');
switch ($rl) {
case 'y':
_echo('Contacting download server...');
new \Setup\Memcache();
break;
case 'n':
_echo('Memcache skipped');
break;
default:
return $this->checkMemcache();
}
}
return $this;
}
示例12: getAcutalLinks
/**
* Generates the actual download links (MySQL has a two-page thing for this)
*
* @author Art <a.molcanovas@gmail.com>
* @return MySQL
*/
protected function getAcutalLinks()
{
foreach ($this->download_links as $version => &$download_page) {
$html = file_get_contents($download_page);
if ($html) {
$domdoc = new DOMDocument();
@$domdoc->loadHTML($html);
$xpath = new DOMXPath($domdoc);
$link = $xpath->query('//a[contains(.,"No thanks, just start my download.")]')->item(0);
if ($link) {
$matches = [];
preg_match('~"[a-z0-9\\-\\?\\./=]+"~i', $link->C14N(), $matches);
if (!empty($matches)) {
$download_page = self::HOST . trim($matches[0], ' "');
continue;
}
}
}
unset($this->download_links[$version]);
}
if (empty($this->download_links)) {
_echo('No download links found.');
} else {
_echo(count($this->download_links) . ' MySQL versions found for download.');
}
return $this;
}
示例13: cli_processPlaylist
function cli_processPlaylist($folder, $info)
{
$nextPageToken = null;
$items = array();
do {
$data = tubeAPI::getInstance()->playlistItems($info['id'], $nextPageToken);
if (!empty($data->nextPageToken)) {
$nextPageToken = $data->nextPageToken;
}
$items = array_merge($items, $data->items);
} while (!empty($data->nextPageToken));
if (!empty($info['filter'])) {
_echo(' Using title filter: `' . $info['filter'] . '`');
foreach ($items as $i => $item) {
if (false === strstr($item->snippet->title, $info['filter'])) {
unset($items[$i]);
}
}
}
$items = array_values($items);
_echo(' ' . count($items) . ' items found');
$itemsInFolder = 0;
$itemsDownloaded = 0;
foreach ($items as $item) {
if (!empty($info['inRegex']) && !empty($info['outRegex'])) {
$fileName = preg_replace(chr(1) . $info['inRegex'] . chr(1), $info['outRegex'], $item->snippet->title) . '.mp4';
} else {
$fileName = $item->snippet->title . '.mp4';
}
$fileName = preg_replace('"\\s+"', ' ', $fileName);
if (file_exists($folder . '/' . $fileName)) {
// _echo( ' File `' . $fileName . '` exists' );
$itemsInFolder++;
continue;
} else {
ini_set('set_time_limit', '0');
$vUrl = 'http://www.youtube.com/watch?v=' . $item->snippet->resourceId->videoId;
_echo(' Downloading file `' . $fileName . '` from `' . $vUrl . '`...');
_echo(' > youtube-dl -f 22 -o "%(title)s.%(ext)s" "' . $item->snippet->resourceId->videoId . '"');
$downFileName = exec('youtube-dl -f 22 --get-filename -o "%(title)s.%(ext)s" "' . $item->snippet->resourceId->videoId . '"', $null, $ret);
exec('youtube-dl -f 22 -o "' . $folder . '/%(title)s.%(ext)s" ' . $item->snippet->resourceId->videoId, $null, $ret);
if (!empty($info['inRegex']) && !empty($info['outRegex']) && $downFileName != $fileName) {
if (!rename($folder . '/' . $downFileName, $folder . '/' . $fileName)) {
_error('Unable to rename file');
_error(' >"' . $folder . '/' . $downFileName . '"' . (file_exists($folder . '/' . $downFileName) ? ' [exists]' : ' [NOT exists]'), false);
_error(' <"' . $folder . '/' . $fileName . '"' . (file_exists($folder . '/' . $fileName) ? ' [EXISTS]' : ' [not exists]'), true);
}
}
_echo(' Done');
$itemsDownloaded++;
}
}
if ($itemsInFolder == count($items)) {
_echo(' Playlist is up to date. Nothing to download.');
} else {
if (!empty($itemsDownloaded)) {
_echo(' ' . $itemsDownloaded . ' files downloaded.');
}
}
}
示例14: _echo
<?php
// echo or print
function _echo($string)
{
$out = fopen('php://output', 'w');
fwrite($out, $string);
fclose($out);
}
_echo('Hello php://output!');
示例15: wordwrap
echo wordwrap($string, 79) . "\n";
}
if (!$cmd_line) {
_echo('<pre>');
}
if ($version === 'master') {
_echo('You are using a development version, I cannot check how up to date it is.');
_echo('You can download the latest stable release from ' . urlify($DOWNLOAD_URL));
} else {
_echo('Checking version...');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Luminous ' . LUMINOUS_VERSION . ' version check');
$json = curl_exec($ch);
curl_close($ch);
if (!$json) {
_echo('Remote request failed. Try again later or visit ' . urlify($DOWNLOAD_URL) . ' to see what the latest version is');
} else {
$data = json_decode($json, true);
if ($data['release_number'] === $version || 'v' . $data['release_number'] === $version) {
_echo('You are up to date!');
} else {
$output = "You are not up to date: your version is " . $version . " and the most recent release is " . $data['release_number'] . ", released " . $data['release_date'] . '. ' . ' Visit ' . urlify($DOWNLOAD_URL) . ' to upgrade';
_echo($output);
}
}
}
if (!$cmd_line) {
_echo('</pre>');
}