本文整理汇总了PHP中Functions::format_dates方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions::format_dates方法的具体用法?PHP Functions::format_dates怎么用?PHP Functions::format_dates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions::format_dates方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
/*
# Copyright 2012 NodeSocket, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*/
require_once dirname(__DIR__) . "/classes/Requires.php";
$result = MySQLQueries::get_settings();
$settings = null;
$result = MySQLQueries::get_settings();
$row = MySQLConnection::fetch_object($result);
if (isset($row->data)) {
$row->data = json_decode($row->data);
}
$settings = $row;
Functions::format_dates($settings);
echo json_encode($settings);
示例2: array
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*/
$_SERVER['SCRIPT_NAME'] !== "/controller.php" ? require_once __DIR__ . "/classes/Requires.php" : (Links::$pretty = true);
Functions::check_required_parameters(array($_GET['param1']));
//Get recipe
$result = MySQLQueries::get_recipe($_GET['param1']);
$recipe = MySQLConnection::fetch_object($result);
$recipe = Functions::format_dates($recipe);
$interpreters = array("shell", "bash", "perl", "python", "node.js");
Header::set_title("Commando.io - Edit Recipe");
Header::render(array("chosen", "codemirror"));
Navigation::render("recipes");
?>
<div class="container">
<div class="row">
<div class="span12">
<h1 class="header" style="float: left;"><?php
echo $recipe->name;
?>
</h1>
示例3: format_dates
public static function format_dates($row)
{
if (!isset($row) || empty($row)) {
return;
}
foreach ($row as $property => $value) {
if (is_object($value) || is_array($value)) {
Functions::format_dates($value);
} else {
if (DateTime::createFromFormat('Y-m-d G:i:s', $value) !== FALSE) {
$row->{$property} = date(DATE_FORMAT, strtotime($value));
}
}
}
return $row;
}
示例4: array
$_SERVER['SCRIPT_NAME'] !== "/controller.php" ? require_once __DIR__ . "/classes/Requires.php" : (Links::$pretty = true);
//Get recipes
$recipes = array();
$result = MySQLQueries::get_recipes();
while ($row = MySQLConnection::fetch_object($result)) {
//Calculate Statistics
$row->lines = substr_count($row->content, "\n") + 1;
$row->length = Functions::format_bytes(strlen($row->content));
$recipes[$row->id] = $row;
}
//Get number of versions for all recipes
$result = MySQLQueries::get_number_of_recipe_versions();
while ($row = MySQLConnection::fetch_object($result)) {
$recipes[$row->id]->number_of_versions = $row->count;
}
$recipes = Functions::format_dates($recipes);
Header::set_title("Commando.io - Recipes");
Header::render();
Navigation::render("recipes");
?>
<div class="container">
<h1 class="header">Recipes</h1>
<div class="row">
<div class="span12">
<div class="well">
<a href="<?php
echo Links::render("add-recipe");
?>
示例5: dirname
<?php
/*
# Copyright 2012 NodeSocket, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*/
require_once dirname(__DIR__) . "/classes/Requires.php";
Functions::check_required_parameters(array($_POST['id']));
$result = MySQLQueries::get_group($_POST['id']);
$row = MySQLConnection::fetch_object($result);
$row = Functions::format_dates($row);
echo json_encode($row);
示例6: array
}
$recipe = Functions::format_dates($recipe);
//Get recipe versions
$recipe_versions = array();
$result = MySQLQueries::get_recipe_versions($_GET['param1']);
while ($row = MySQLConnection::fetch_object($result)) {
////
// Move head to the top of the array
////
if ($row->id === $head->recipe_version) {
array_unshift($recipe_versions, $row);
} else {
$recipe_versions[] = $row;
}
}
$recipe_versions = Functions::format_dates($recipe_versions, "l, F j, Y");
//Calculate Statistics
$recipe->lines = substr_count($recipe->content, "\n") + 1;
$recipe->length = Functions::format_bytes(strlen($recipe->content));
//Get the correct language for code-pretty
switch ($recipe->interpreter) {
case 'shell':
$code_pretty_lang = "lang-sh";
break;
case 'bash':
$code_pretty_lang = "lang-bsh";
break;
case 'node.js':
$code_pretty_lang = "lang-js";
break;
case 'perl':