对于每个新项目,我想:
我知道我可以手动指定packagist.org的最新版本,但理想情况下我喜欢这种自动化。
我希望这是有道理的。
由于
答案 0 :(得分:3)
Sub Utility()
Dim objIE As Object, htmldoc As Object, data, i As Long, lrow As Long
Dim TinNo As String
Cells(1, 2).Select
Range(Selection, Selection.End(xlDown)).Select
lrow = Selection.Count
For i = 1 To lrow
Cells(i, 2) = cleartext(Cells(i, 2).Value)
On Error Resume Next
Next
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate "http://mahavat.gov.in/Tin_Search/Tinsearch.jsp"
Do While .readyState <> 4: DoEvents: Loop
Set TIN = .document.getelementsbyname("tin")
Set htmldoc = CreateObject("HTMLfile")
'data = Range("B1:G" & lrow)
On Error Resume Next
For i = 1 To lrow
Set TIN = .document.getelementsbyname("tin")
Cells(i, 2).Select
If Not IsError(Cells(i, 2)) Then
TIN.Item(0).Value = Cells(i, 2)
.document.getElementById("Submit").Click
Do While .Busy Or .readyState <> 4: DoEvents: Loop
htmldoc.body.innerhtml = objIE.document.body.innerhtml
temp = Trim(Split(htmldoc.getElementsByTagName("Table")(14).innertext, Cells(i, 2))(1))
If Err.Number <> 0 Then
.Navigate "http://mahavat.gov.in/Tin_Search/Tinsearch.jsp"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
Err.Clear
Cells(i, 3) = "Invelid TIN(Shl'd Start with 27,Totl 12 Chr)"
Cells(i, 4) = "Invelid TIN"
Else
Cells(i, 3) = Mid(temp, InStrRev(temp, " ") + 1, Len(temp))
Cells(i, 4) = Trim(Split(temp, Cells(i, 3))(0))
End If
End If
Next
End With
End Sub
Function cleartext(inputstring As String) As String
Dim onlynumbers As String
onlynumbers = OnlyNums(inputstring)
'MsgBox onlynumbers
onlynumbers = Mid(onlynumbers, InStr(1, onlynumbers, "27"), 11) & "V"
'MsgBox onlynumbers
If Len(onlynumbers) < 12 Then
cleartext = CVErr(xlErrValue)
End If
cleartext = onlynumbers
End Function
Function OnlyNums(sWord As String) As String
Dim sChar As String
Dim x As Integer
Dim sTemp As String
sTemp = ""
For x = 1 To Len(sWord)
sChar = Mid(sWord, x, 1)
If Asc(sChar) >= 48 And _
Asc(sChar) <= 57 Then
sTemp = sTemp & sChar
End If
Next
OnlyNums = sTemp
End Function
答案 1 :(得分:0)
运行composer require vendor/package
将向packagist.org咨询最新发布的版本,并添加最新版本和版本要求以便稍后获得此版本和兼容更新。
这将仅安装稳定版本。
初始安装后,您有两个选择:
composer install
将再次安装以前找到的软件包。composer update
将查找符合版本要求的更新包。永远不要无人看管update
。开发人员应该有意识地运行它,然后运行测试套件以确定一切是否仍然有效(或者如果可用的话,持续集成作业会执行)。特别是在部署到生产时仅运行install
。