几个月前,我使用Amazon AWS CloudFront设置了“无效”文件。
有什么方法可以删除它,而不是复制它并以不同的方式命名吗?
如何将文本对齐图像图标的右侧,如示例图片中的那样.
我通常会使用" float:left"但它是用于移动响应式设计,所以我不喜欢使用像" float:left"这样的东西,因为它div通过响应式设计破坏了红色的高度.
我必须对齐标题,子标题和一个小方形图像.

当我在 CMD 中运行 PHP 时,我收到此错误消息:
'php' 不是内部或外部命令可操作的程序或批处理文件
路径已经添加,我遵循了本教程:
http://perials.com/install-composer-on-windows-and-wamp/
C:\Program Files (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Lenovo\Motion Control\;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\; C:\wamp\bin\php\php5.5.12; C:\wamp\www; C:\wamp\www\AKP\examples\AdWords\Auth;C:\Program Files (x86)\Skype\Phone\;C:\ProgramData\ComposerSetup\bin
Run Code Online (Sandbox Code Playgroud)
我创建了这篇文章中建议的文件: 为 Laravel 使用全局安装 Composer?
没事了。
我遇到的大多数帖子都通过添加路径解决了问题 - 这并不能解决我的问题。
我目前在 Windows 10 上使用 WAMP。
可能是什么问题?
var obj = {
111: {
user_id: 111,
user_name: "user111",
isActive: 0
},
112: {
user_id: 112,
user_name: "use112",
isActive: 1
},
113: {
user_id: 113,
user_name: "use113",
isActive: 0
},
...
}
Run Code Online (Sandbox Code Playgroud)
我想过滤所有内容,("isActive" === 0)但在返回newObj时保持键集相同(其值等于用户ID):
newObj = {
111: {
user_id: 111,
user_name: "user111",
isActive: 0
},
113: {
user_id: 113,
user_name: "use113",
isActive: 0
},
...
}
Run Code Online (Sandbox Code Playgroud)
这就是我现在所拥有的:
let newObj = Object.values(obj).filter( user => ( (obj.isActive === 0)));
Run Code Online (Sandbox Code Playgroud)
返回索引键
.forEach()必须使用ES6 )。自上次使用以来,Facebook SDK发生了变化。我想创建一个网站,该网站从用户已经加入的封闭组中提取信息。上一次使用javascript,现在我必须使用对我来说有点新的PHP。
Facebook上的示例并未很好地说明SDK中的内容(我认为..)。我的主要问题是将Facebook连接到我的网站,并使该网站与该应用同步。
在“应用程序域”中,我插入了“ localhost”,在“站点URL”中,我使用了PHP文件的确切目录(http://localhost/test/facebook-g.api/),并在“要复查的项目”(user_groups)中设置了正确的项目。
这是我到目前为止在代码中所拥有的:
<?php
session_start();
require_once 'autoload.php';
use src\Facebook\FacebookSession;
use src\Facebook\FacebookRedirectLoginHelper;
use src\Facebook\FacebookRequest;
use src\Facebook\FacebookResponse;
use src\Facebook\FacebookSDKException;
use src\Facebook\FacebookRequestException;
use src\Facebook\FacebookAuthorizationException;
use src\Facebook\GraphObject;
use src\Facebook\Entities\AccessToken;
use src\Facebook\HttpClients\FacebookCurlHttpClient;
use src\Facebook\HttpClients\FacebookHttpable;
FacebookSession::setDefaultApplication( '000','a866372f873730e7000000000009' );
Run Code Online (Sandbox Code Playgroud)
我需要一个最小的示例来说明如何开始使用Graph API,更具体地说是如何将我的页面连接到它。我知道我需要以某种方式生成令牌代码,但我不确定该怎么做。facebook上的示例不包含我必须添加到代码中的SDK中的哪些文件。
我希望这篇文章对像我这样的其他人在下一次Google搜寻时有用:)
我启用了Amazon CloudFront gzip功能:" 自动压缩对象 ".
我的CloudFront中的所有文件都会发生这种情况,而其他CSS/JS文件正在加载为gzip(Double检查我的服务器请求标头是否接受gzip文件Accept-Encoding: gzip).
我真的迷失了想要解决这个问题,因为所有的教程和谷歌搜索结果导致了如何检查单选按钮"自动压缩对象"的相同解释 - 这显然没有帮助.
我想也许我不能gzip文件因为它们太小而无法压缩 - 但是在谷歌速度测试后说清楚我可以用gzip压缩这些文件.
Compressing https://Cloudfront.cloudfront.net/live/static/rcss/bootstrap.min.css could save 100.3KiB (83% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/rcss/style.css could save 60.5KiB (80% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/shop/css/jquery.range.css could save 4.6KiB (83% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/rcss/font-awesome.min.css could save 21.9KiB (77% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/rcss/responsive.css could save 20KiB (80% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/general.min.js?ver=9.70 could save 232.9KiB (72% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/rcss/magnific-popup.css could save 5.7KiB (75% reduction).
Compressing https://Cloudfront.cloudfront.net/live/static/bootstrap.min.js could save 26.4KiB (73% reduction).
Compressing https://Cloudfront.cloudfront.net/…ve/static/plugins/jquery.validate.min.js could save 14KiB …Run Code Online (Sandbox Code Playgroud) 我试图打印出这个:
return $message . "\n\n in: " . $file . "\n\n Line: " . $line ."\n\n\n Trace: \n\n". $trace;
Run Code Online (Sandbox Code Playgroud)
在\n传递的时候,虽然不工作:
$this->logger->info($message, $variables);
Run Code Online (Sandbox Code Playgroud)
我在日志输出中将所有内容都放在一行中。我想用跟踪、行、文件显示错误,中间有一个新行。
遵循Monolog文档,在格式化程序部分 - 他们确实有一个名为 的类LineFormater,但我没有使用它:
LineFormatter:将日志记录格式化为单行字符串。
如果你过于好奇,这是我的完整代码:
<?php
namespace MyApp\Modules;
use MyApp\Helpers\Session;
use MyApp\Core\Config;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// use Monolog\Handler\FirePHPHandler;
// use Monolog\Handler\MailHandler;
/**
*
* Log Class: Handles logs
* This class uses Monolog repo: https://github.com/Seldaek/monolog/
* Documentation for Monolog: https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md
*
*/
class Log /*extends ExtendsName*/
{
/*=================================
= …Run Code Online (Sandbox Code Playgroud) 'phpwkhtmltopdf'的某些东西停止了工作.
使用以下代码在Web浏览器上运行:
$string = "http://www.google.com";
// You can add parameter for the constructor call
$binary = '/usr/bin/wkhtmltopdf';
$pdf = new Pdf(array(
// Explicitly tell wkhtmltopdf that we're using an X environment
// 'use-xserver',
// Enable built in Xvfb support in the command
'commandOptions' => array(
'enableXvfb' => true,
// Optional: Set your path to xvfb-run. Default is just 'xvfb-run'.
'xvfbRunBinary' => '/usr/bin/xvfb-run',
// Optional: Set options for xfvb-run. The following defaults are used.
//'xvfbRunOptions' => '--server-args="-screen 0, 1024x768x24"',
),
)); …Run Code Online (Sandbox Code Playgroud) 我正在开发基于 PHP 的 Web 应用程序(我没有构建)。
我正在运行这个ajax请求:
$.ajax({
type: 'POST',
url: "/potato/ajax.php?module=test_module",
dataType: 'json',
async: true,
data: {
start_ts: that.start_date,
stop_ts: that.end_date,
submitted: true
},
beforeSend: function() {
console.log('Start: ' + new Date().toLocaleString());
// Show Chart Loading
that.qwChart.showLoading({
color: '#00b0f0',
// text: that.returnNumWithPrecent(that.progress)
text: that.qwChartProgress
});
// If data div isn't displayed
if (!that.dataDisplayed) {
// Show divs loading
that.showMainDiv();
} else {
that.$qwTbody.slideUp('fast');
that.$qwTbody.html('');
}
},
complete: function(){},
success: function(result){
console.log('End: ' + new Date().toLocaleString());
// Clear timer
clearInterval(timer);
// …Run Code Online (Sandbox Code Playgroud) 我正在尝试实现 Symfonys 依赖注入容器。
我设置了 2 个容器,一个用于数据库,一个用于系统用户。
和我使用addArgument()的这两个App阶级和SystemUser阶级,推到App类SystemUser对象,并为SystemUser类Database对象。
索引.php:
require_once 'vendor/autoload.php';
use TestingDI\App;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
$containerBuilder = new ContainerBuilder();
$containerBuilder->register('database', '\TestingDI\Database');
$containerBuilder->register('system.user', '\TestingDI\SystemUser')
->addArgument(new Reference('database'));
$containerBuilder->register('app', '\TestingDI\App')
->addArgument(new Reference('system.user'));
$database = $containerBuilder->get('database');
$systemUser = $containerBuilder->get('system.user');
$app = $containerBuilder->get('app');
# Initialize App class
$app = new App();
Run Code Online (Sandbox Code Playgroud)
应用程序.php:
<?php
namespace TestingDI;
use TestingDI\SystemUser;
class App {
public $systemUser;
public function __construct(SystemUser $systemUser)
{
var_dump($systemUser);
}
} …Run Code Online (Sandbox Code Playgroud) php dependency-injection symfony symfony-dependency-injection
php ×5
javascript ×2
ajax ×1
amazon ×1
amazon-s3 ×1
asynchronous ×1
cmd ×1
compression ×1
css ×1
css3 ×1
ecmascript-6 ×1
facebook ×1
gzip ×1
html ×1
jquery ×1
monolog ×1
symfony ×1
symfony-dependency-injection ×1
ubuntu ×1
wamp ×1
wkhtmltopdf ×1
xvfb ×1