我正在使用Composer使用以下语法安装多个包:
{
"require": {
"aws/aws-sdk-php": "2.*",
"vimeo/vimeo-api" : "1.1.*",
"phpoffice/phpexcel": "dev-master"
}
}
Run Code Online (Sandbox Code Playgroud)
上面的工作正常,但现在我想通过composer添加tcpdf.我在这里找到了这个代码,但不确定如何与我当前的需求集成.我试过的一件事就是将其添加到最后,但我担心它会开始删除我当前的包.
{ "name": "tecnick.com/tcpdf",
"version": "6.2.11",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"keywords": ["PDF","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"],
"license": "LGPLv3",
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"homepage": "http://nicolaasuni.tecnick.com"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"classmap": [
"fonts",
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php", …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 LTI 将 LMS (Canvas) 与我的第 3 方学习工具集成。作为该过程的一部分,我将获取 Canvas 发送给我的请求变量:
Array ( [oauth_consumer_key] => key
[oauth_nonce] => s78gkWprnVJ6qp2UaCaEZ39WoYm91yOztiCBRhDx7s
[oauth_signature] => l82UMpiOt62vTd7Eu4GzyVVxYk0=
[oauth_signature_method] => HMAC-SHA1
[oauth_timestamp] => 1367072335 [oauth_version] => 1.0 )
Run Code Online (Sandbox Code Playgroud)
并通过标头将它们发送到我的“request_token.php”脚本(取自谷歌的oAuth代码)。结果是无效签名。不过,我已经在本地测试了代码,当不从我的 LMS 中提取信息时,它似乎工作正常。我已经 var_dumped OAuthRequest 对象作为进一步的指示,表明 OAuthRequest 实际上正在使用正确的变量。
OAuthRequest Object
( [parameters:protected] =>
Array ( [oauth_consumer_key] => key
[oauth_nonce] => s78gkWprnVJ6qp2UaCaEZ39WoYm91yOztiCBRhDx7s
[oauth_signature] => l82UMpiOt62vTd7Eu4GzyVVxYk0=
[oauth_signature_method] => HMAC-SHA1
[oauth_timestamp] => 1367072335 [oauth_version] => 1.0 )
[http_method:protected] => GET
[http_url:protected] => http://www.itsmorethanatextbook.com:80/oauth/example/request_token.php?oauth_consumer_key=key&oauth_nonce=s78gkWprnVJ6qp2UaCaEZ39WoYm91yOztiCBRhDx7s&oauth_signature=l82UMpiOt62vTd7Eu4GzyVVxYk0=&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1367072335&oauth_version=1.0
[base_string] => GET&http%3A%2F%2Fwww.itsmorethanatextbook.com%2Foauth%2Fexample%2Frequest_token.php&oauth_consumer_key%3Dkey%26oauth_nonce%3Ds78gkWprnVJ6qp2UaCaEZ39WoYm91yOztiCBRhDx7s%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1367072335%26oauth_version%3D1.0 )
Run Code Online (Sandbox Code Playgroud)
是否需要对 LTI 变量采取一些额外的步骤才能使其发挥作用?(我尝试对它们进行编码但无济于事)
是否有办法在 window.getSelection() 之后获取下一个字符?我需要检查所选文本后面的字符是否是空格...
编辑:谢谢您的回答!我基本上使用此链接 来突出显示文本,但希望将内容限制为完整的单词。我使用下面提出的解决方案(由史蒂文)作为起点;我认为以下应该有效:
sel = window.getSelection();
var text = sel.anchorNode.nodeValue;
var index = sel.baseOffset + sel.focusOffset-1;
var isSpace = text[index] === undefined;
if (isSpace) {
alert("space");
}
Run Code Online (Sandbox Code Playgroud)
(在上面的链接中,我在 makeEditableAndHighlight 函数调用之后立即使用了此代码)。
我想在 pine 脚本中为 TradingView 中的几只股票使用相同的警报条件。问题是,除非我创建脚本的副本并为每个脚本自定义消息,否则我不知道哪个股票触发了警报。我想要一些类似的东西:
alertcondition(someCondition, title='Bullish', message=tickerid)
Run Code Online (Sandbox Code Playgroud)
我在这里使用tickerid变量,它是内置变量的松树脚本之一。但是,当我尝试这样做时,我得到的消息实际上是tickerid,而不是与脚本关联的图表的tickerid。有没有办法动态生成tickerid?
使用代码提示,PHPStorm可以向我显示快速的函数定义; 它可以配置为向我展示功能使用的更详细的例子吗?
我在Youtube上有一堆视频,我使用相同的代码嵌入.所有的视频都运行正常,直到我上传了最后一个.每次我现在执行代码时,%E2%80%8F会附加到上次上传的视频中,除非我特别要求子字符串(0,11); 请注意,如果没有这个黑客,代码仍然适用于我所有其他上传的视频.尽管代码现在适用于我的hack,但理解为什么会发生这种情况会很棒.
我的HTML标记如下所示:
<li><a href="#" class="help_video" id="oG-M25hnDII?">sidebars</a></li>
Run Code Online (Sandbox Code Playgroud)
我的javascript/jquery看起来像这样:
function openNewWindow(youtube_link) {
var youtube_link = youtube_link.toString();
youtube_link = youtube_link.substring(0,11);
popupWin = window.open('/videos/help.php?youtube_link='+youtube_link,
'open_window',
'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=800, height=440, left=0, top=0')
}
$(".help_video").click(function(){
openNewWindow($(this).attr('id'));
return false;
});
});
Run Code Online (Sandbox Code Playgroud)
然后,我关联的help.php具有以下代码:
<iframe width="756" height="426" src="//www.youtube.com/embed/<?php echo $_GET['youtube_link'];?>?rel=0&vq=hd720" frameborder="0" allowfullscreen></iframe>
Run Code Online (Sandbox Code Playgroud)
谢谢!
我发现了 2 个不同的代码片段可以在我的网站上强制使用 https:
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
Run Code Online (Sandbox Code Playgroud)
和
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Run Code Online (Sandbox Code Playgroud)
我确信它们都可以工作(一个来自 Httpd Wiki,另一个来自 SSL shopper)。有人能够解释他们如何执行重定向的差异吗?
javascript ×2
php ×2
apache ×1
code-hinting ×1
composer-php ×1
getselection ×1
https ×1
iframe ×1
jquery ×1
lti ×1
mod-rewrite ×1
oauth ×1
phpstorm ×1
pine-script ×1
redirect ×1
youtube ×1